Package io.debezium.connector.binlog
Class BinlogSourceTask<P extends Partition,O extends OffsetContext>
java.lang.Object
org.apache.kafka.connect.source.SourceTask
io.debezium.connector.common.BaseSourceTask<P,O>
io.debezium.connector.binlog.BinlogSourceTask<P,O>
- All Implemented Interfaces:
org.apache.kafka.connect.connector.Task
public abstract class BinlogSourceTask<P extends Partition,O extends OffsetContext>
extends BaseSourceTask<P,O>
Abstract base class for all binlog-based source tasks.
- Author:
- Chris Cranford
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCommon heartbeat error handler for binlog-based connectors.Nested classes/interfaces inherited from class io.debezium.connector.common.BaseSourceTask
BaseSourceTask.StateNested classes/interfaces inherited from class org.apache.kafka.connect.source.SourceTask
org.apache.kafka.connect.source.SourceTask.TransactionBoundary -
Field Summary
FieldsFields inherited from class io.debezium.connector.common.BaseSourceTask
coordinatorFields inherited from class org.apache.kafka.connect.source.SourceTask
context, TRANSACTION_BOUNDARY_CONFIG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract LonggetReadOnlyIncrementalSnapshotSignalOffset(O previousOffset) Obtain the read-only incremental snapshot signal offset.protected voidresetOffset(BinlogConnectorConfig connectorConfig, O previousOffset, SignalProcessor<P, O> signalProcessor) Reset the specified offset.protected voidvalidateBinlogConfiguration(io.debezium.spi.snapshot.Snapshotter snapshotter, BinlogConnectorConnection connection) Validates the binlog configuration.protected booleanvalidateSnapshotFeasibility(io.debezium.spi.snapshot.Snapshotter snapshotter, O offsetContext, BinlogConnectorConnection connection) Validates the feasibility of snapshot.Methods inherited from class io.debezium.connector.common.BaseSourceTask
commit, commitRecord, doPoll, doStop, getAllConfigurationFields, getAvailableSignalChannels, getNotificationChannels, getPreviousOffsets, getTaskState, isLogPositionAvailable, logStatistics, poll, registerServiceProviders, resetErrorHandlerRetriesIfNeeded, start, start, stop, validateAndLoadSchemaHistory, withMaskedSensitiveOptionsMethods inherited from class org.apache.kafka.connect.source.SourceTask
commitRecord, initializeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.connect.connector.Task
version
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
BinlogSourceTask
public BinlogSourceTask()
-
-
Method Details
-
validateSnapshotFeasibility
protected boolean validateSnapshotFeasibility(io.debezium.spi.snapshot.Snapshotter snapshotter, O offsetContext, BinlogConnectorConnection connection) Validates the feasibility of snapshot.- Parameters:
snapshotter- the snapshotter, should not be nulloffsetContext- the offset context, may be nullconnection- the database connection, should not be null- Returns:
- validates whether a snapshot can be taken
-
validateBinlogConfiguration
protected void validateBinlogConfiguration(io.debezium.spi.snapshot.Snapshotter snapshotter, BinlogConnectorConnection connection) Validates the binlog configuration.- Parameters:
snapshotter- the snapshotter, should ont be nullconnection- the database connection, should not be null
-
resetOffset
protected void resetOffset(BinlogConnectorConfig connectorConfig, O previousOffset, SignalProcessor<P, O> signalProcessor) Reset the specified offset.- Parameters:
connectorConfig- the connector configuration, should not be nullpreviousOffset- the previous offsetssignalProcessor- the signal processor, should not be null
-
getReadOnlyIncrementalSnapshotSignalOffset
Obtain the read-only incremental snapshot signal offset.- Parameters:
previousOffset- the previous offsets- Returns:
- the read-only incremental snapshot signal offset
-