Package io.debezium.connector.postgresql
Class PostgresOffsetContext
java.lang.Object
io.debezium.connector.postgresql.PostgresOffsetContext
- All Implemented Interfaces:
OffsetContext
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IncrementalSnapshotContext<TableId>static final Stringstatic final Stringprivate Lsnprivate Lsnprivate booleanprivate static final org.slf4j.Loggerprivate final SourceInfoprivate final org.apache.kafka.connect.data.Schemaprivate Lsnprivate final TransactionContext -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePostgresOffsetContext(PostgresConnectorConfig connectorConfig, Lsn lsn, Lsn lastCompletelyProcessedLsn, Lsn lastCommitLsn, Long txId, Instant time, boolean snapshot, boolean lastSnapshotRecord, TransactionContext transactionContext, IncrementalSnapshotContext<TableId> incrementalSnapshotContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidevent(DataCollectionId tableId, Instant instant) org.apache.kafka.connect.data.Structorg.apache.kafka.connect.data.Schema(package private) LsnReturns the LSN that the streaming phase should stream events up to or null if a stopping point is not set.(package private) boolean(package private) booleanvoidstatic PostgresOffsetContextinitialContext(PostgresConnectorConfig connectorConfig, PostgresConnection jdbcConnection, Clock clock) static PostgresOffsetContextinitialContext(PostgresConnectorConfig connectorConfig, PostgresConnection jdbcConnection, Clock clock, Lsn lastCommitLsn, Lsn lastCompletelyProcessedLsn) boolean(package private) Lsn(package private) Lsn(package private) Lsnlsn()voidvoidvoidvoidvoidsetStreamingStoppingLsn(Lsn streamingStoppingLsn) toString()voidupdateCommitPosition(Lsn lsn, Lsn lastCompletelyProcessedLsn) voidupdateWalPosition(Lsn lsn, Lsn lastCompletelyProcessedLsn, Instant commitTime, Long txId, Long xmin) update wal position for lsn events that do not have an associated table or schemavoidupdateWalPosition(Lsn lsn, Lsn lastCompletelyProcessedLsn, Instant commitTime, Long txId, Long xmin, TableId tableId) (package private) Longxmin()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
LAST_COMPLETELY_PROCESSED_LSN_KEY
- See Also:
-
LAST_COMMIT_LSN_KEY
- See Also:
-
sourceInfoSchema
private final org.apache.kafka.connect.data.Schema sourceInfoSchema -
sourceInfo
-
lastSnapshotRecord
private boolean lastSnapshotRecord -
lastCompletelyProcessedLsn
-
lastCommitLsn
-
streamingStoppingLsn
-
transactionContext
-
incrementalSnapshotContext
-
-
Constructor Details
-
PostgresOffsetContext
private PostgresOffsetContext(PostgresConnectorConfig connectorConfig, Lsn lsn, Lsn lastCompletelyProcessedLsn, Lsn lastCommitLsn, Long txId, Instant time, boolean snapshot, boolean lastSnapshotRecord, TransactionContext transactionContext, IncrementalSnapshotContext<TableId> incrementalSnapshotContext)
-
-
Method Details
-
getOffset
- Specified by:
getOffsetin interfaceOffsetContext
-
getSourceInfoSchema
public org.apache.kafka.connect.data.Schema getSourceInfoSchema()- Specified by:
getSourceInfoSchemain interfaceOffsetContext
-
getSourceInfo
public org.apache.kafka.connect.data.Struct getSourceInfo()- Specified by:
getSourceInfoin interfaceOffsetContext
-
isSnapshotRunning
public boolean isSnapshotRunning()- Specified by:
isSnapshotRunningin interfaceOffsetContext
-
preSnapshotStart
public void preSnapshotStart()- Specified by:
preSnapshotStartin interfaceOffsetContext
-
preSnapshotCompletion
public void preSnapshotCompletion()- Specified by:
preSnapshotCompletionin interfaceOffsetContext
-
postSnapshotCompletion
public void postSnapshotCompletion()- Specified by:
postSnapshotCompletionin interfaceOffsetContext
-
updateWalPosition
-
updateWalPosition
public void updateWalPosition(Lsn lsn, Lsn lastCompletelyProcessedLsn, Instant commitTime, Long txId, Long xmin) update wal position for lsn events that do not have an associated table or schema -
updateCommitPosition
-
hasLastKnownPosition
boolean hasLastKnownPosition() -
hasCompletelyProcessedPosition
boolean hasCompletelyProcessedPosition() -
lsn
Lsn lsn() -
lastCompletelyProcessedLsn
Lsn lastCompletelyProcessedLsn() -
lastCommitLsn
Lsn lastCommitLsn() -
getStreamingStoppingLsn
Lsn getStreamingStoppingLsn()Returns the LSN that the streaming phase should stream events up to or null if a stopping point is not set. If set during the streaming phase, any event with an LSN less than the stopping LSN will be processed and once the stopping LSN is reached, the streaming phase will end. Useful for a pre-snapshot catch up streaming phase. -
setStreamingStoppingLsn
-
xmin
Long xmin() -
toString
-
initialContext
public static PostgresOffsetContext initialContext(PostgresConnectorConfig connectorConfig, PostgresConnection jdbcConnection, Clock clock) -
initialContext
public static PostgresOffsetContext initialContext(PostgresConnectorConfig connectorConfig, PostgresConnection jdbcConnection, Clock clock, Lsn lastCommitLsn, Lsn lastCompletelyProcessedLsn) -
asOffsetState
-
markLastSnapshotRecord
public void markLastSnapshotRecord()- Specified by:
markLastSnapshotRecordin interfaceOffsetContext
-
event
- Specified by:
eventin interfaceOffsetContext
-
getTransactionContext
- Specified by:
getTransactionContextin interfaceOffsetContext
-
incrementalSnapshotEvents
public void incrementalSnapshotEvents()- Specified by:
incrementalSnapshotEventsin interfaceOffsetContext
-
getIncrementalSnapshotContext
- Specified by:
getIncrementalSnapshotContextin interfaceOffsetContext
-