Package io.debezium.pipeline.spi
Interface OffsetContext
-
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 Classes Modifier and Type Interface Description static interface
OffsetContext.Loader<O extends OffsetContext>
Implementations load a connector-specific offset context based on the offset values stored in Kafka.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
event(DataCollectionId collectionId, Instant timestamp)
Records the name of the collection and the timestamp of the last eventdefault IncrementalSnapshotContext<?>
getIncrementalSnapshotContext()
Provide a context used byIncrementalSnapshotChangeEventSource
so persist its internal state into offsets to survive between restarts.Map<String,?>
getOffset()
org.apache.kafka.connect.data.Struct
getSourceInfo()
org.apache.kafka.connect.data.Schema
getSourceInfoSchema()
TransactionContext
getTransactionContext()
Provide a context used byTransactionMonitor
so persist its internal state into offsets to survive between restarts.default void
incrementalSnapshotEvents()
Signals that the streaming of a batch of incremental snapshot events will begin, which should reflect in an updated offset state.boolean
isSnapshotRunning()
Whether this offset indicates that an (uncompleted) snapshot is currently running or not.void
markLastSnapshotRecord()
mark current record as the last one in the snapshotvoid
postSnapshotCompletion()
Signals that a snapshot has been completed, which should reflect in an updated offset state.void
preSnapshotCompletion()
Signals that a snapshot will complete, which should reflect in an updated offset state.void
preSnapshotStart()
Signals that a snapshot will begin, which should reflect in an updated offset state.
-
-
-
Method Detail
-
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:
-
markLastSnapshotRecord
void markLastSnapshotRecord()
mark current record as the last one 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
void event(DataCollectionId collectionId, Instant timestamp)
Records the name of the collection and the timestamp of the last event
-
getTransactionContext
TransactionContext getTransactionContext()
Provide a context used byTransactionMonitor
so 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
default IncrementalSnapshotContext<?> getIncrementalSnapshotContext()
Provide a context used byIncrementalSnapshotChangeEventSource
so persist its internal state into offsets to survive between restarts.- Returns:
- incremental snapshot context
-
-