com.continuent.tungsten.replicator.loader
Class Loader

java.lang.Object
  extended by com.continuent.tungsten.replicator.loader.Loader
All Implemented Interfaces:
RawExtractor, ReplicatorPlugin
Direct Known Subclasses:
CSVLoader, JdbcLoader

public abstract class Loader
extends java.lang.Object
implements RawExtractor

This class defines the base class for all THL Loader extractor classes. All classes that will be used with the loader must extend this.

Version:
1.0
Author:
Jeff Mace

Field Summary
protected  int chunkSize
           
protected  boolean lockTables
           
protected  java.util.Map<java.lang.String,java.util.List<java.lang.String>> params
           
protected  java.net.URI uri
           
 
Constructor Summary
Loader()
           
 
Method Summary
 int getChunkSize()
          Get the number of rows to include in each THL event
protected  DBMSEvent getFinishLoadEvent()
          Build an event that includes the heartbeat name to indicate that all data has been extracted
 boolean getLockTables()
          Are locks required on the tables during the load?
 java.io.Serializable parseStringValue(int type, java.lang.String value)
          Take a raw string value and return the proper Java data type for the java.sql.Types type given
 void setChunkSize(int chunkSize)
          Set the number of rows to include in each THL event
 void setLockTables(boolean lockTables)
          Set if the tables should be locked at runtime
 void setUri(java.lang.String uri)
          Parse the URI to extract events from
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.continuent.tungsten.replicator.extractor.RawExtractor
extract, extract, getCurrentResourceEventId, setLastEventId
 
Methods inherited from interface com.continuent.tungsten.replicator.plugin.ReplicatorPlugin
configure, prepare, release
 

Field Detail

uri

protected java.net.URI uri

params

protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> params

chunkSize

protected int chunkSize

lockTables

protected boolean lockTables
Constructor Detail

Loader

public Loader()
Method Detail

setUri

public void setUri(java.lang.String uri)
            throws java.lang.Exception
Parse the URI to extract events from

Parameters:
uri -
Throws:
java.lang.Exception

setChunkSize

public void setChunkSize(int chunkSize)
Set the number of rows to include in each THL event

Parameters:
chunkSize -

getChunkSize

public int getChunkSize()
Get the number of rows to include in each THL event


getFinishLoadEvent

protected DBMSEvent getFinishLoadEvent()
                                throws ReplicatorException,
                                       java.lang.InterruptedException
Build an event that includes the heartbeat name to indicate that all data has been extracted

Returns:
The DBMSEvent with the heartbeat metadata set
Throws:
ReplicatorException
java.lang.InterruptedException

setLockTables

public void setLockTables(boolean lockTables)
Set if the tables should be locked at runtime

Parameters:
lockTables -

getLockTables

public boolean getLockTables()
Are locks required on the tables during the load?


parseStringValue

public java.io.Serializable parseStringValue(int type,
                                             java.lang.String value)
                                      throws java.lang.Exception
Take a raw string value and return the proper Java data type for the java.sql.Types type given

Parameters:
type -
value -
Throws:
java.lang.Exception