Package io.debezium.connector.oracle
Class OracleOffsetContext
java.lang.Object
io.debezium.pipeline.CommonOffsetContext<SourceInfo>
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 org.apache.kafka.connect.data.Schemaprivate final TransactionContextFields inherited from class io.debezium.pipeline.CommonOffsetContext
sourceInfo -
Constructor Summary
ConstructorsConstructorDescriptionOracleOffsetContext(OracleConnectorConfig connectorConfig, Scn scn, Long scnIndex, CommitScn commitScn, String lcrPosition, Scn snapshotScn, Map<String, Scn> snapshotPendingTransactions, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext, IncrementalSnapshotContext<TableId> incrementalSnapshotContext) OracleOffsetContext(OracleConnectorConfig connectorConfig, Scn scn, Long scnIndex, String lcrPosition, Scn snapshotScn, Map<String, Scn> snapshotPendingTransactions, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext, IncrementalSnapshotContext<TableId> incrementalSnapshotContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic OracleOffsetContext.Buildercreate()voidgetScn()static ScngetScnFromOffsetMapByKey(Map<String, ?> offset, String key) Helper method to resolve aScnby key from the offset map.org.apache.kafka.connect.data.SchemabooleanloadSnapshotPendingTransactions(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.voidvoidvoidsetEventScn(Scn eventScn) voidsetLcrPosition(String lcrPosition) voidsetRedoThread(Integer redoThread) voidvoidvoidsetScnIndex(Long scnIndex) voidsetSnapshotPendingTransactions(Map<String, Scn> snapshotPendingTransactions) voidsetSourceTime(Instant instant) voidsetSsn(long ssn) voidsetTableId(TableId tableId) voidsetTransactionId(String transactionId) voidsetUserName(String userName) voidtableEvent(TableId tableId, Instant timestamp) voidtableEvent(Set<TableId> tableIds, Instant timestamp) toString()Methods inherited from class io.debezium.pipeline.CommonOffsetContext
getSourceInfo, incrementalSnapshotEvents, markSnapshotRecord, postSnapshotCompletion
-
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 -
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, Long scnIndex, 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, Long scnIndex, String lcrPosition, Scn snapshotScn, Map<String, Scn> snapshotPendingTransactions, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext, IncrementalSnapshotContext<TableId> incrementalSnapshotContext)
-
-
Method Details
-
create
-
getOffset
-
getSourceInfoSchema
public org.apache.kafka.connect.data.Schema getSourceInfoSchema() -
setScn
-
setScnIndex
-
setEventScn
-
getScn
-
getScnIndex
-
getCommitScn
-
getEventScn
-
setLcrPosition
-
getLcrPosition
-
getSnapshotScn
-
getSnapshotPendingTransactions
-
setSnapshotPendingTransactions
-
setTransactionId
-
setUserName
-
setSourceTime
-
setTableId
-
getRedoThread
-
setRedoThread
-
setRsId
-
setSsn
public void setSsn(long ssn) -
isSnapshotRunning
public boolean isSnapshotRunning() -
preSnapshotStart
public void preSnapshotStart() -
preSnapshotCompletion
public void preSnapshotCompletion() -
toString
-
event
-
tableEvent
-
tableEvent
-
getTransactionContext
-
getIncrementalSnapshotContext
-
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
-