|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.loader.Loader
com.continuent.tungsten.replicator.loader.JdbcLoader
public abstract class JdbcLoader
| Field Summary | |
|---|---|
protected java.util.ArrayList<OneRowChange.ColumnSpec> |
columnDefinitions
|
protected Database |
conn
|
protected java.lang.String |
driver
|
protected java.sql.ResultSet |
importTables
|
protected java.util.List<java.lang.String> |
includeSchemas
|
protected boolean |
includeStructure
|
protected java.sql.DatabaseMetaData |
metadata
|
protected java.lang.String |
password
|
protected java.sql.Statement |
statement
|
protected java.lang.String |
tungstenServiceSchema
|
protected java.lang.String |
tungstenServiceSchemaPosition
|
protected java.lang.String |
url
|
protected java.lang.String |
user
|
| Fields inherited from class com.continuent.tungsten.replicator.loader.Loader |
|---|
chunkSize, lockTables, params, uri |
| Constructor Summary | |
|---|---|
JdbcLoader()
|
|
| Method Summary | |
|---|---|
protected java.lang.String |
buildCreateSchemaStatement()
Return a statement that will create the schema, null if no create schema can be given |
protected java.lang.String |
buildCreateTableStatement()
Return a statement that will create the table structure, null if no create table can be given |
void |
configure(PluginContext context)
Complete plug-in configuration. |
DBMSEvent |
extract()
Extract a THL event up to getChunkSize() rows Extract the next available DBMSEvent from the database log. |
DBMSEvent |
extract(java.lang.String eventId)
Extract starting after the event ID provided as an argument. |
protected int |
extractColumnType(java.sql.ResultSet columnList)
Determine the java.sql.Types type of a column based on the column metadata |
protected RowChangeData |
extractRowChangeData()
Extract the actual rows from the database and build the change set |
protected java.io.Serializable |
extractRowValue(int type,
java.sql.ResultSet rowValues,
java.lang.String columnName)
Take a raw value and return the proper Java data type for the java.sql.Types type given |
java.lang.String |
getCurrentResourceEventId()
Parse the value of tungstenServiceSchemaPosition for the current eventId |
java.lang.String |
getTungstenSchema()
|
java.lang.String |
getTungstenServiceSchema()
|
protected boolean |
includeImportTable()
Should the current table be imported |
void |
lockTables()
A placeholder function for loaders that can lock tables |
protected void |
nextTable()
Prepare the next table for extraction by resetting the position and parsing column definitions |
void |
prepare(PluginContext context)
Prepare plug-in for use. |
protected void |
prepareImportTable()
Parse column definitions for the current table |
void |
release(PluginContext context)
Release all resources used by plug-in. |
void |
setIncludeSchemas(java.lang.String includeSchemas)
Set the list of schemas to include when extracting events. |
void |
setIncludeStructure(boolean includeStructure)
|
void |
setLastEventId(java.lang.String eventId)
Prepare to start extraction from the first table found Set the value of the last event ID we have processed. |
void |
setPassword(java.lang.String password)
Set the MySQL password to connect with |
void |
setTungstenServiceSchema(java.lang.String schemaName)
|
void |
setUser(java.lang.String user)
Set the MySQL user to connect with |
| Methods inherited from class com.continuent.tungsten.replicator.loader.Loader |
|---|
getChunkSize, getFinishLoadEvent, getLockTables, parseStringValue, setChunkSize, setLockTables, setUri |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String driver
protected java.lang.String url
protected java.lang.String user
protected java.lang.String password
protected Database conn
protected java.sql.Statement statement
protected java.sql.DatabaseMetaData metadata
protected java.sql.ResultSet importTables
protected java.util.List<java.lang.String> includeSchemas
protected java.util.ArrayList<OneRowChange.ColumnSpec> columnDefinitions
protected java.lang.String tungstenServiceSchema
protected java.lang.String tungstenServiceSchemaPosition
protected boolean includeStructure
| Constructor Detail |
|---|
public JdbcLoader()
| Method Detail |
|---|
public void setUser(java.lang.String user)
user - public void setPassword(java.lang.String password)
password - public void setTungstenServiceSchema(java.lang.String schemaName)
public java.lang.String getTungstenServiceSchema()
public void setIncludeSchemas(java.lang.String includeSchemas)
includeSchemas - public void setIncludeStructure(boolean includeStructure)
public java.lang.String getTungstenSchema()
public void setLastEventId(java.lang.String eventId)
throws ReplicatorException
eventId - Event ID at which to begin extracting
ReplicatorExceptionRawExtractor.setLastEventId(java.lang.String)
protected void nextTable()
throws ReplicatorException,
java.sql.SQLException
ReplicatorException
java.sql.SQLException
protected boolean includeImportTable()
throws java.sql.SQLException
java.sql.SQLException
protected void prepareImportTable()
throws java.sql.SQLException
java.sql.SQLException
protected int extractColumnType(java.sql.ResultSet columnList)
throws java.sql.SQLException
columnList -
java.sql.SQLException
protected java.io.Serializable extractRowValue(int type,
java.sql.ResultSet rowValues,
java.lang.String columnName)
throws java.lang.Exception
java.lang.Exception
public DBMSEvent extract()
throws ReplicatorException,
java.lang.InterruptedException
ReplicatorException
java.lang.InterruptedExceptionRawExtractor.extract()
protected java.lang.String buildCreateSchemaStatement()
throws ReplicatorException
ReplicatorException
protected java.lang.String buildCreateTableStatement()
throws ReplicatorException
ReplicatorException
protected RowChangeData extractRowChangeData()
throws java.sql.SQLException
java.sql.SQLException
public DBMSEvent extract(java.lang.String eventId)
throws ReplicatorException,
java.lang.InterruptedException
RawExtractor
eventId - Event ID at which to begin extracting
ReplicatorException - Thrown if extractor processing fails
java.lang.InterruptedException - Thrown if the applier is interrupted
public void configure(PluginContext context)
throws ReplicatorException,
java.lang.InterruptedException
ReplicatorPlugin
ReplicatorException - Thrown if configuration is incomplete or
fails
java.lang.InterruptedException
public void prepare(PluginContext context)
throws ReplicatorException,
java.lang.InterruptedException
ReplicatorPlugin
ReplicatorException - Thrown if resource allocation fails
java.lang.InterruptedException
public void release(PluginContext context)
throws ReplicatorException,
java.lang.InterruptedException
ReplicatorPlugin
ReplicatorException - Thrown if resource deallocation fails
java.lang.InterruptedException
public java.lang.String getCurrentResourceEventId()
throws ReplicatorException,
java.lang.InterruptedException
ReplicatorException
java.lang.InterruptedException
public void lockTables()
throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||