Package io.debezium.connector.binlog
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 Summary
FieldsFields inherited from class io.debezium.pipeline.source.snapshot.incremental.AbstractIncrementalSnapshotContext
CORRELATION_ID, EVENT_PRIMARY_KEY, INCREMENTAL_SNAPSHOT_KEY, TABLE_MAXIMUM_KEY, windowOpened -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidCloses the current open incremental snapshot window.getCurrentGtid(OffsetContext offsetContext) abstract booleanprotected static <U> IncrementalSnapshotContext<U>init(BinlogReadOnlyIncrementalSnapshotContext<U> context, Map<String, ?> offsets) Initialize the incremental snapshot context.abstract booleanreachedHighWatermark(String currentGtid) Checks whether the GTID has reached the high watermark.abstract voidsetHighWatermark(GtidSet gtidSet) Set the GTID as the high watermark.abstract voidsetLowWatermark(GtidSet gtidSet) Set the GTID as the low watermark.voidsetSignalOffset(Long signalOffset) abstract booleanupdateWindowState(OffsetContext offsetContext) Update the window state in the offsets.abstract booleanMethods inherited from class io.debezium.pipeline.source.snapshot.incremental.AbstractIncrementalSnapshotContext
addDataCollectionNamesToSnapshot, chunkEndPosititon, closeWindow, currentChunkId, currentDataCollectionId, dataCollectionsToBeSnapshottedCount, deduplicationNeeded, getCorrelationId, getDataCollections, getSchema, init, isNonInitialChunk, isSchemaVerificationPassed, isSnapshotPaused, maximumKey, maximumKey, nextChunkPosition, nextDataCollection, openWindow, pauseSnapshot, removeDataCollectionFromSnapshot, resumeSnapshot, revertChunk, sendEvent, setSchema, setSchemaVerificationPassed, snapshotRunning, startNewChunk, stopSnapshot, toString, unsetCorrelationId
-
Field Details
-
SIGNAL_OFFSET
- See Also:
-
signalOffset
-
-
Constructor Details
-
BinlogReadOnlyIncrementalSnapshotContext
public BinlogReadOnlyIncrementalSnapshotContext(boolean useCatalogBeforeSchema)
-
-
Method Details
-
getSignalOffset
-
setSignalOffset
-
store
- Specified by:
storein interfaceIncrementalSnapshotContext<T>- Overrides:
storein classAbstractIncrementalSnapshotContext<T>
-
getCurrentGtid
-
setLowWatermark
Set the GTID as the low watermark.- Parameters:
gtidSet- the global transaction identifier set; should not be null
-
setHighWatermark
Set the GTID as the high watermark.- Parameters:
gtidSet- the global transaction identifier set; should not be null
-
reachedHighWatermark
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
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 nulloffsets- the connector offsets, should not be null- Returns:
- the initialized context, never null
-