Package io.debezium.pipeline
Class CommonOffsetContext<T extends BaseSourceInfo>
java.lang.Object
io.debezium.pipeline.CommonOffsetContext<T>
- All Implemented Interfaces:
OffsetContext
public abstract class CommonOffsetContext<T extends BaseSourceInfo>
extends Object
implements OffsetContext
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.debezium.pipeline.spi.OffsetContext
OffsetContext.Loader<O extends OffsetContext> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SnapshotTypeIndicates the type of in progress snapshot (INITIAL, BLOCKING, INCREMENTAL).static final Stringprotected booleanWhether an initial/blocking snapshot has been completed or not.protected final T -
Constructor Summary
ConstructorsConstructorDescriptionCommonOffsetContext(T sourceInfo) CommonOffsetContext(T sourceInfo, boolean snapshotCompleted) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.kafka.connect.data.StructvoidSignals 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.voidpreSnapshotStart(boolean onDemand) Signals that a snapshot will begin, which should reflect in an updated offset state.voidsetSnapshot(SnapshotType snapshotType) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.pipeline.spi.OffsetContext
event, getIncrementalSnapshotContext, getOffset, getSourceInfoSchema, getTransactionContext
-
Field Details
-
SNAPSHOT_COMPLETED_KEY
- See Also:
-
sourceInfo
-
snapshot
Indicates the type of in progress snapshot (INITIAL, BLOCKING, INCREMENTAL). In case of an INITIAL or BLOCKING snapshot it will be used in conjunction withsnapshotCompletedto define if it is running or not.The following table lists the possible status:
Status snapshot snapshotCompleted incomplete initial snapshot initial false completed initial snapshot null true incomplete blocking snapshot blocking false completed blocking snapshot null true running incremental snapshot incremental true completed incremental snapshot null true -
snapshotCompleted
protected boolean snapshotCompletedWhether an initial/blocking snapshot has been completed or not.
-
-
Constructor Details
-
CommonOffsetContext
-
CommonOffsetContext
-
-
Method Details
-
getSourceInfo
public org.apache.kafka.connect.data.Struct getSourceInfo()- Specified by:
getSourceInfoin interfaceOffsetContext
-
markSnapshotRecord
Description copied from interface:OffsetContextMark the position of the record in the snapshot.- Specified by:
markSnapshotRecordin interfaceOffsetContext
-
isInitialSnapshotRunning
public boolean isInitialSnapshotRunning()Description copied from interface:OffsetContextWhether this offset indicates that an (uncompleted) snapshot is currently running or not.- Specified by:
isInitialSnapshotRunningin interfaceOffsetContext- Returns:
-
preSnapshotStart
public void preSnapshotStart(boolean onDemand) Description copied from interface:OffsetContextSignals that a snapshot will begin, which should reflect in an updated offset state.- Specified by:
preSnapshotStartin interfaceOffsetContext- Parameters:
onDemand- indicates whether the snapshot is initial or blocking
-
preSnapshotCompletion
public void preSnapshotCompletion()Description copied from interface:OffsetContextSignals that a snapshot will complete, which should reflect in an updated offset state.- Specified by:
preSnapshotCompletionin interfaceOffsetContext
-
postSnapshotCompletion
public void postSnapshotCompletion()Description copied from interface:OffsetContextSignals that a snapshot has been completed, which should reflect in an updated offset state.- Specified by:
postSnapshotCompletionin interfaceOffsetContext
-
incrementalSnapshotEvents
public void incrementalSnapshotEvents()Description copied from interface:OffsetContextSignals that the streaming of a batch of incremental snapshot events will begin, which should reflect in an updated offset state.- Specified by:
incrementalSnapshotEventsin interfaceOffsetContext
-
getSnapshot
-
setSnapshot
-