Package io.debezium.connector.oracle
Class OracleOffsetContext
java.lang.Object
io.debezium.connector.oracle.OracleOffsetContext
- All Implemented Interfaces:
OffsetContext
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.debezium.pipeline.spi.OffsetContext
OffsetContext.Loader<O extends OffsetContext> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IncrementalSnapshotContext<TableId>static final Stringstatic final Stringstatic final Stringprivate booleanWhether a snapshot has been completed or not.Map of (txid, start SCN) for all transactions in progress at the time the snapshot was taken.private final ScnSCN that was used for the initial consistent snapshot.private final SourceInfoprivate final org.apache.kafka.connect.data.Schemaprivate final TransactionContext -
Constructor Summary
ConstructorsConstructorDescriptionOracleOffsetContext(OracleConnectorConfig connectorConfig, Scn scn, CommitScn commitScn, String lcrPosition, Scn snapshotScn, Map<String, Scn> snapshotPendingTransactions, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext, IncrementalSnapshotContext<TableId> incrementalSnapshotContext) OracleOffsetContext(OracleConnectorConfig connectorConfig, Scn scn, String lcrPosition, Scn snapshotScn, Map<String, Scn> snapshotPendingTransactions, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext, IncrementalSnapshotContext<TableId> incrementalSnapshotContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic OracleOffsetContext.Buildercreate()voidevent(DataCollectionId tableId, Instant timestamp) getScn()static ScngetScnFromOffsetMapByKey(Map<String, ?> offset, String key) Helper method to resolve aScnby key from the offset map.org.apache.kafka.connect.data.Structorg.apache.kafka.connect.data.SchemavoidbooleanloadSnapshotPendingTransactions(Map<String, ?> offset) Helper method to read the in-progress transaction map from the offset map.static ScnloadSnapshotScn(Map<String, ?> offset) Helper method to read the snapshot SCN from the offset map.voidvoidvoidvoidvoidsetEventScn(Scn eventScn) voidsetLcrPosition(String lcrPosition) voidsetRedoThread(Integer redoThread) voidvoidvoidsetSnapshotPendingTransactions(Map<String, Scn> snapshotPendingTransactions) voidsetSourceTime(Instant instant) voidsetSsn(int ssn) voidsetTableId(TableId tableId) voidsetTransactionId(String transactionId) voidtableEvent(TableId tableId, Instant timestamp) voidtableEvent(Set<TableId> tableIds, Instant timestamp) toString()
-
Field Details
-
SNAPSHOT_COMPLETED_KEY
- See Also:
-
SNAPSHOT_PENDING_TRANSACTIONS_KEY
- See Also:
-
SNAPSHOT_SCN_KEY
- See Also:
-
sourceInfoSchema
private final org.apache.kafka.connect.data.Schema sourceInfoSchema -
sourceInfo
-
transactionContext
-
incrementalSnapshotContext
-
snapshotScn
SCN that was used for the initial consistent snapshot. We keep track of this field because it's a cutoff for emitting DDL statements, in case we start mining _before_ the snapshot SCN to cover transactions that were ongoing at the time the snapshot was taken. -
snapshotPendingTransactions
Map of (txid, start SCN) for all transactions in progress at the time the snapshot was taken. -
snapshotCompleted
private boolean snapshotCompletedWhether a snapshot has been completed or not.
-
-
Constructor Details
-
OracleOffsetContext
public OracleOffsetContext(OracleConnectorConfig connectorConfig, Scn scn, CommitScn commitScn, String lcrPosition, Scn snapshotScn, Map<String, Scn> snapshotPendingTransactions, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext, IncrementalSnapshotContext<TableId> incrementalSnapshotContext) -
OracleOffsetContext
public OracleOffsetContext(OracleConnectorConfig connectorConfig, Scn scn, String lcrPosition, Scn snapshotScn, Map<String, Scn> snapshotPendingTransactions, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext, IncrementalSnapshotContext<TableId> incrementalSnapshotContext)
-
-
Method Details
-
create
-
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
-
setScn
-
setEventScn
-
getScn
-
getCommitScn
-
getEventScn
-
setLcrPosition
-
getLcrPosition
-
getSnapshotScn
-
getSnapshotPendingTransactions
-
setSnapshotPendingTransactions
-
setTransactionId
-
setSourceTime
-
setTableId
-
getRedoThread
-
setRedoThread
-
setRsId
-
setSsn
public void setSsn(int ssn) -
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
-
toString
-
markLastSnapshotRecord
public void markLastSnapshotRecord()- Specified by:
markLastSnapshotRecordin interfaceOffsetContext
-
event
- Specified by:
eventin interfaceOffsetContext
-
tableEvent
-
tableEvent
-
getTransactionContext
- Specified by:
getTransactionContextin interfaceOffsetContext
-
incrementalSnapshotEvents
public void incrementalSnapshotEvents()- Specified by:
incrementalSnapshotEventsin interfaceOffsetContext
-
getIncrementalSnapshotContext
- Specified by:
getIncrementalSnapshotContextin interfaceOffsetContext
-
getScnFromOffsetMapByKey
Helper method to resolve aScnby key from the offset map.- Parameters:
offset- the offset mapkey- the entry key, eitherSourceInfo.SCN_KEYorSourceInfo.COMMIT_SCN_KEY.- Returns:
- the
Scnor null if not found
-
loadSnapshotPendingTransactions
Helper method to read the in-progress transaction map from the offset map.- Parameters:
offset- the offset map- Returns:
- the in-progress transaction map
-
loadSnapshotScn
Helper method to read the snapshot SCN from the offset map.- Parameters:
offset- the offset map- Returns:
- the snapshot SCN
-