@NotThreadSafe public final class MySqlConnectorTask extends org.apache.kafka.connect.source.SourceTask
MySqlConnector| Modifier and Type | Field and Description |
|---|---|
private BinlogReader |
binlogReader |
private AbstractReader |
currentReader |
private org.slf4j.Logger |
logger |
private AtomicBoolean |
runningReader |
private SnapshotReader |
snapshotReader |
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 String |
earliestBinlogFilename()
Determine the earliest binlog filename that is still available in the server.
|
protected boolean |
isBinlogAvailable()
Determine whether the binlog position as set on the
SourceInfo is available in the
server. |
protected boolean |
isGtidModeEnabled()
Determine whether the MySQL server has GTIDs enabled.
|
protected boolean |
isRowBinlogEnabled()
Determine whether the MySQL server has the row-level binlog enabled.
|
List<org.apache.kafka.connect.source.SourceRecord> |
poll() |
protected void |
skipReadBinlog() |
void |
start(Map<String,String> props) |
void |
stop() |
protected void |
transitionToReadBinlog()
Transition from the snapshot reader to the binlog reader.
|
String |
version() |
private final org.slf4j.Logger logger
private final AtomicBoolean runningReader
private volatile MySqlTaskContext taskContext
private volatile SnapshotReader snapshotReader
private volatile BinlogReader binlogReader
private volatile AbstractReader currentReader
public MySqlConnectorTask()
default topic selector of "<serverName>.<databaseName>.<tableName>"
for
data and "<serverName>" for metadata.public String version()
public void start(Map<String,String> props)
start in interface org.apache.kafka.connect.connector.Taskstart in class org.apache.kafka.connect.source.SourceTaskpublic List<org.apache.kafka.connect.source.SourceRecord> poll() throws InterruptedException
poll in class org.apache.kafka.connect.source.SourceTaskInterruptedExceptionpublic void stop()
stop in interface org.apache.kafka.connect.connector.Taskstop in class org.apache.kafka.connect.source.SourceTaskprotected void transitionToReadBinlog()
start(Map)
and stop()) to ensure that we don't transition while we've already begun to stop.protected void skipReadBinlog()
protected boolean isBinlogAvailable()
SourceInfo is available in the
server.true if the server has the binlog coordinates, or false otherwiseprotected String earliestBinlogFilename()
protected boolean isGtidModeEnabled()
false if the server's gtid_mode is set and is OFF, or true otherwiseprotected boolean isRowBinlogEnabled()
true if the server's binlog_format is set to ROW, or false otherwiseCopyright © 2016 JBoss by Red Hat. All rights reserved.