com.continuent.tungsten.replicator.loader
Class MySQLLoader
java.lang.Object
com.continuent.tungsten.replicator.loader.Loader
com.continuent.tungsten.replicator.loader.JdbcLoader
com.continuent.tungsten.replicator.loader.MySQLLoader
- All Implemented Interfaces:
- RawExtractor, ReplicatorPlugin
public class MySQLLoader
- extends JdbcLoader
| Fields inherited from class com.continuent.tungsten.replicator.loader.JdbcLoader |
columnDefinitions, conn, driver, importTables, includeSchemas, includeStructure, metadata, password, statement, tungstenServiceSchema, tungstenServiceSchemaPosition, url, user |
|
Constructor Summary |
MySQLLoader()
Creates a new MySQLLoader object |
|
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)
Build a MySQL JDBC connection string Complete plug-in configuration. |
java.lang.String |
getCurrentResourceEventId()
Use the output of SHOW MASTER STATUS to get the extractor Event ID
Parse the value of tungstenServiceSchemaPosition for the current eventId |
void |
lockTables()
A placeholder function for loaders that can lock tables |
| Methods inherited from class com.continuent.tungsten.replicator.loader.JdbcLoader |
extract, extract, extractColumnType, extractRowChangeData, extractRowValue, getTungstenSchema, getTungstenServiceSchema, includeImportTable, nextTable, prepare, prepareImportTable, release, setIncludeSchemas, setIncludeStructure, setLastEventId, setPassword, setTungstenServiceSchema, setUser |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MySQLLoader
public MySQLLoader()
- Creates a new
MySQLLoader object
configure
public void configure(PluginContext context)
throws ReplicatorException,
java.lang.InterruptedException
- Build a MySQL JDBC connection string Complete plug-in configuration. This is called after setters are invoked
at the time that the replicator goes through configuration.
- Specified by:
configure in interface ReplicatorPlugin- Overrides:
configure in class JdbcLoader
- Throws:
ReplicatorException - Thrown if configuration is incomplete or
fails
java.lang.InterruptedException- See Also:
JdbcLoader.configure(com.continuent.tungsten.replicator.plugin.PluginContext)
lockTables
public void lockTables()
throws java.sql.SQLException
- A placeholder function for loaders that can lock tables
- Overrides:
lockTables in class JdbcLoader
- Throws:
java.sql.SQLException- See Also:
JdbcLoader.lockTables()
buildCreateSchemaStatement
protected java.lang.String buildCreateSchemaStatement()
throws ReplicatorException
- Return a statement that will create the schema, null if no create schema
can be given
- Overrides:
buildCreateSchemaStatement in class JdbcLoader
- Throws:
java.sql.SQLException
ReplicatorException- See Also:
JdbcLoader.buildCreateSchemaStatement()
buildCreateTableStatement
protected java.lang.String buildCreateTableStatement()
throws ReplicatorException
- Return a statement that will create the table structure, null if no
create table can be given
- Overrides:
buildCreateTableStatement in class JdbcLoader
- Throws:
java.sql.SQLException
ReplicatorException- See Also:
JdbcLoader.buildCreateTableStatement()
getCurrentResourceEventId
public java.lang.String getCurrentResourceEventId()
throws ReplicatorException,
java.lang.InterruptedException
- Use the output of SHOW MASTER STATUS to get the extractor Event ID
Parse the value of tungstenServiceSchemaPosition for the current eventId
- Specified by:
getCurrentResourceEventId in interface RawExtractor- Overrides:
getCurrentResourceEventId in class JdbcLoader
- Returns:
- A current event ID that can be compared with event IDs in
DBMSEvent
- Throws:
ReplicatorException
java.lang.InterruptedException- See Also:
RawExtractor.getCurrentResourceEventId()