Package io.debezium.connector.mysql
Class MySqlConnectorTask
java.lang.Object
org.apache.kafka.connect.source.SourceTask
io.debezium.connector.common.BaseSourceTask<MySqlPartition,MySqlOffsetContext>
io.debezium.connector.mysql.MySqlConnectorTask
- All Implemented Interfaces:
org.apache.kafka.connect.connector.Task
The main task executing streaming from MySQL.
Responsible for lifecycle management of the streaming code.
- Author:
- Jiri Pechanec
-
Nested Class Summary
Nested classes/interfaces inherited from class io.debezium.connector.common.BaseSourceTask
BaseSourceTask.State
Nested classes/interfaces inherited from class org.apache.kafka.connect.source.SourceTask
org.apache.kafka.connect.source.SourceTask.TransactionBoundary
-
Field Summary
Modifier and TypeFieldDescriptionprivate MySqlConnection
private static final String
private ErrorHandler
private static final org.slf4j.Logger
private ChangeEventQueue<DataChangeEvent>
private MySqlDatabaseSchema
private MySqlTaskContext
Fields inherited from class org.apache.kafka.connect.source.SourceTask
context, TRANSACTION_BOUNDARY_CONFIG
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.kafka.connect.source.SourceRecord>
doPoll()
protected void
doStop()
private MySqlValueConverters
getValueConverters
(MySqlConnectorConfig configuration) protected boolean
isBinlogAvailable
(MySqlConnectorConfig config, MySqlOffsetContext offset) Determine whether the binlog position as set on theMySqlOffsetContext
is available in the server.start
(Configuration configuration) private boolean
validateAndLoadSchemaHistory
(MySqlConnectorConfig config, MySqlPartition partition, MySqlOffsetContext offset, MySqlDatabaseSchema schema) private void
private boolean
validateSnapshotFeasibility
(MySqlConnectorConfig config, MySqlOffsetContext offset) version()
Methods inherited from class io.debezium.connector.common.BaseSourceTask
commit, commitRecord, getPreviousOffsets, getTaskState, logStatistics, poll, start, stop, withMaskedSensitiveOptions
Methods inherited from class org.apache.kafka.connect.source.SourceTask
commitRecord, initialize
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
CONTEXT_NAME
- See Also:
-
taskContext
-
queue
-
connection
-
errorHandler
-
schema
-
-
Constructor Details
-
MySqlConnectorTask
public MySqlConnectorTask()
-
-
Method Details
-
version
-
start
public ChangeEventSourceCoordinator<MySqlPartition,MySqlOffsetContext> start(Configuration configuration) - Specified by:
start
in classBaseSourceTask<MySqlPartition,
MySqlOffsetContext>
-
getValueConverters
-
doPoll
- Specified by:
doPoll
in classBaseSourceTask<MySqlPartition,
MySqlOffsetContext> - Throws:
InterruptedException
-
doStop
protected void doStop()- Specified by:
doStop
in classBaseSourceTask<MySqlPartition,
MySqlOffsetContext>
-
getAllConfigurationFields
- Specified by:
getAllConfigurationFields
in classBaseSourceTask<MySqlPartition,
MySqlOffsetContext>
-
validateBinlogConfiguration
-
isBinlogAvailable
Determine whether the binlog position as set on theMySqlOffsetContext
is available in the server.- Returns:
true
if the server has the binlog coordinates, orfalse
otherwise
-
validateAndLoadSchemaHistory
private boolean validateAndLoadSchemaHistory(MySqlConnectorConfig config, MySqlPartition partition, MySqlOffsetContext offset, MySqlDatabaseSchema schema) -
validateSnapshotFeasibility
-