Interface OffsetContext

All Known Implementing Classes:
CommonOffsetContext

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
  • Method Details

    • getOffset

      Map<String,?> 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

      void markSnapshotRecord(SnapshotRecord record)
      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

      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 by TransactionMonitor 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 by IncrementalSnapshotChangeEventSource so persist its internal state into offsets to survive between restarts.
      Returns:
      incremental snapshot context