Class BinlogReadOnlyIncrementalSnapshotContext<T>

java.lang.Object
io.debezium.pipeline.source.snapshot.incremental.AbstractIncrementalSnapshotContext<T>
io.debezium.connector.binlog.BinlogReadOnlyIncrementalSnapshotContext<T>
All Implemented Interfaces:
IncrementalSnapshotContext<T>

public abstract class BinlogReadOnlyIncrementalSnapshotContext<T> extends AbstractIncrementalSnapshotContext<T>
Abstract common base class for binlog-based connector read only incremental snapshot context state.
Author:
Chris Cranford
  • Field Details

  • Constructor Details

    • BinlogReadOnlyIncrementalSnapshotContext

      public BinlogReadOnlyIncrementalSnapshotContext(boolean useCatalogBeforeSchema)
  • Method Details

    • getSignalOffset

      public Long getSignalOffset()
    • setSignalOffset

      public void setSignalOffset(Long signalOffset)
    • store

      public Map<String,Object> store(Map<String,Object> offset)
      Specified by:
      store in interface IncrementalSnapshotContext<T>
      Overrides:
      store in class AbstractIncrementalSnapshotContext<T>
    • getCurrentGtid

      public String getCurrentGtid(OffsetContext offsetContext)
    • setLowWatermark

      public abstract void setLowWatermark(GtidSet gtidSet)
      Set the GTID as the low watermark.
      Parameters:
      gtidSet - the global transaction identifier set; should not be null
    • setHighWatermark

      public abstract void setHighWatermark(GtidSet gtidSet)
      Set the GTID as the high watermark.
      Parameters:
      gtidSet - the global transaction identifier set; should not be null
    • reachedHighWatermark

      public abstract boolean reachedHighWatermark(String currentGtid)
      Checks whether the GTID has reached the high watermark.
      Parameters:
      currentGtid - the GTID to be checked
      Returns:
      true if the high watermark has been reached; false otherwise
    • hasServerIdentifierChanged

      public abstract boolean hasServerIdentifierChanged()
      Returns:
      whether the global transaction identifier's server id has changed
    • updateWindowState

      public abstract boolean updateWindowState(OffsetContext offsetContext)
      Update the window state in the offsets.
      Parameters:
      offsetContext - the offsets to be updated; should not be null
      Returns:
      true if the process should end; false if it should continue
    • watermarksChanged

      public abstract boolean watermarksChanged()
      Returns:
      true if the watermarks have changed; false otherwise
    • closeWindow

      public abstract void closeWindow()
      Closes the current open incremental snapshot window.
    • init

      protected static <U> IncrementalSnapshotContext<U> init(BinlogReadOnlyIncrementalSnapshotContext<U> context, Map<String,?> offsets)
      Initialize the incremental snapshot context.
      Parameters:
      context - the read only incremental snapshot context, should not be null
      offsets - the connector offsets, should not be null
      Returns:
      the initialized context, never null