@NotThreadSafe public final class MySqlConnectorTask extends BaseSourceTask
MySqlConnector| Modifier and Type | Class and Description |
|---|---|
class |
MySqlConnectorTask.ServerIdGenerator |
BaseSourceTask.State| Modifier and Type | Field and Description |
|---|---|
private MySqlJdbcContext |
connectionContext |
private org.slf4j.Logger |
logger |
private ChainedReader |
readers |
private MySqlTaskContext |
taskContext |
| Constructor and Description |
|---|
MySqlConnectorTask()
Create an instance of the log reader that uses Kafka to store database schema history and the
default topic selector of "<serverName>.<databaseName>.<tableName>"
for
data and "<serverName>" for metadata. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
completeReaders()
When the task is
stopped, the readers may have additional work to perform before they actually
stop and before all their records have been consumed via the BaseSourceTask.poll() method. |
private static MySqlTaskContext |
createAndStartTaskContext(Configuration config,
Filters filters) |
List<org.apache.kafka.connect.source.SourceRecord> |
doPoll() |
protected void |
doStop() |
protected String |
earliestBinlogFilename()
Determine the earliest binlog filename that is still available in the server.
|
protected Iterable<Field> |
getAllConfigurationFields() |
private static Filters |
getAllFilters(Configuration config)
Get the filters representing all tables represented by the config.
|
private static Filters |
getNewFilters(Map<String,?> offsets,
Configuration config)
Get the filters representing the tables that have been newly added to the config, but
not those that previously existed in the config.
|
private static Filters |
getOldFilters(Map<String,?> offsets,
Configuration config)
Get the filters representing those tables that previously existed in the config, but
not those newly added to the config.
|
private Map<String,?> |
getRestartOffset(Map<String,?> storedOffset)
Get the offset to restart the connector from.
|
protected boolean |
isBinlogAvailable()
Determine whether the binlog position as set on the
SourceInfo is available in the
server. |
protected boolean |
isBinlogFormatRow()
Determine whether the MySQL server has the row-level binlog enabled.
|
protected boolean |
isBinlogRowImageFull()
Determine whether the MySQL server has the binlog_row_image set to 'FULL'.
|
private boolean |
newTablesInConfig() |
ChangeEventSourceCoordinator |
start(Configuration config) |
String |
version() |
commit, commitRecord, getPreviousOffset, poll, start, stopprivate final org.slf4j.Logger logger
private volatile MySqlTaskContext taskContext
private volatile MySqlJdbcContext connectionContext
private volatile ChainedReader readers
public MySqlConnectorTask()
default topic selector of "<serverName>.<databaseName>.<tableName>"
for
data and "<serverName>" for metadata.public String version()
public ChangeEventSourceCoordinator start(Configuration config)
start in class BaseSourceTaskprivate Map<String,?> getRestartOffset(Map<String,?> storedOffset)
storedOffset - the stored offset.RecordMakers.RecordMakers(MySqlSchema, SourceInfo, TopicSelector, boolean, Map)private static MySqlTaskContext createAndStartTaskContext(Configuration config, Filters filters)
private boolean newTablesInConfig()
private static Filters getNewFilters(Map<String,?> offsets, Configuration config)
Filtersprivate static Filters getOldFilters(Map<String,?> offsets, Configuration config)
Filtersprivate static Filters getAllFilters(Configuration config)
Filterspublic List<org.apache.kafka.connect.source.SourceRecord> doPoll() throws InterruptedException
doPoll in class BaseSourceTaskInterruptedExceptionprotected void doStop()
doStop in class BaseSourceTaskprotected Iterable<Field> getAllConfigurationFields()
getAllConfigurationFields in class BaseSourceTaskprotected void completeReaders()
stopped, the readers may have additional work to perform before they actually
stop and before all their records have been consumed via the BaseSourceTask.poll() method. This method signals that
all of this has completed.protected boolean isBinlogAvailable()
SourceInfo is available in the
server.true if the server has the binlog coordinates, or false otherwiseprotected String earliestBinlogFilename()
protected boolean isBinlogRowImageFull()
true if the server's binlog_row_image is set to FULL, or false otherwiseprotected boolean isBinlogFormatRow()
true if the server's binlog_format is set to ROW, or false otherwiseCopyright © 2020 JBoss by Red Hat. All rights reserved.