Package io.debezium.pipeline.spi
Interface OffsetContext
- All Known Implementing Classes:
CommonOffsetContext,SinkNotificationChannel.EmptyOffsetContext
public interface OffsetContext
Keeps track of the current offset within the source DB's change stream. This reflects in the offset as committed to
Kafka and in the source info block contained within CDC messages themselves.
- Author:
- Gunnar Morling
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceOffsetContext.Loader<O extends OffsetContext>Implementations load a connector-specific offset context based on the offset values stored in Kafka. -
Method Summary
Modifier and TypeMethodDescriptionvoidevent(DataCollectionId collectionId, Instant timestamp) Records the name of the collection and the timestamp of the last eventdefault IncrementalSnapshotContext<?>Provide a context used byIncrementalSnapshotChangeEventSourceso persist its internal state into offsets to survive between restarts.org.apache.kafka.connect.data.Structorg.apache.kafka.connect.data.SchemaProvide a context used byTransactionMonitorso persist its internal state into offsets to survive between restarts.default voidSignals that the streaming of a batch of incremental snapshot events will begin, which should reflect in an updated offset state.booleanWhether this offset indicates that an (uncompleted) snapshot is currently running or not.voidmarkSnapshotRecord(SnapshotRecord record) Mark the position of the record in the snapshot.voidSignals that a snapshot has been completed, which should reflect in an updated offset state.voidSignals that a snapshot will complete, which should reflect in an updated offset state.voidSignals that a snapshot will begin, which should reflect in an updated offset state.
-
Method Details
-
getOffset
-
getSourceInfoSchema
org.apache.kafka.connect.data.Schema getSourceInfoSchema() -
getSourceInfo
org.apache.kafka.connect.data.Struct getSourceInfo() -
isSnapshotRunning
boolean isSnapshotRunning()Whether this offset indicates that an (uncompleted) snapshot is currently running or not.- Returns:
-
markSnapshotRecord
Mark the position of the record in the snapshot. -
preSnapshotStart
void preSnapshotStart()Signals that a snapshot will begin, which should reflect in an updated offset state. -
preSnapshotCompletion
void preSnapshotCompletion()Signals that a snapshot will complete, which should reflect in an updated offset state. -
postSnapshotCompletion
void postSnapshotCompletion()Signals that a snapshot has been completed, which should reflect in an updated offset state. -
event
Records the name of the collection and the timestamp of the last event -
getTransactionContext
TransactionContext getTransactionContext()Provide a context used byTransactionMonitorso persist its internal state into offsets to survive between restarts.- Returns:
- transaction context
-
incrementalSnapshotEvents
default void incrementalSnapshotEvents()Signals that the streaming of a batch of incremental snapshot events will begin, which should reflect in an updated offset state. -
getIncrementalSnapshotContext
Provide a context used byIncrementalSnapshotChangeEventSourceso persist its internal state into offsets to survive between restarts.- Returns:
- incremental snapshot context
-