Package io.debezium.connector.oracle
Class OracleOffsetContext
- java.lang.Object
-
- io.debezium.connector.oracle.OracleOffsetContext
-
- All Implemented Interfaces:
OffsetContext
public class OracleOffsetContext extends Object implements OffsetContext
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOracleOffsetContext.Builder-
Nested classes/interfaces inherited from interface io.debezium.pipeline.spi.OffsetContext
OffsetContext.Loader<O extends OffsetContext>
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,String>partitionstatic StringSERVER_PARTITION_KEYstatic StringSNAPSHOT_COMPLETED_KEYprivate booleansnapshotCompletedWhether a snapshot has been completed or not.private SourceInfosourceInfoprivate org.apache.kafka.connect.data.SchemasourceInfoSchemaprivate TransactionContexttransactionContext
-
Constructor Summary
Constructors Constructor Description OracleOffsetContext(OracleConnectorConfig connectorConfig, Scn scn, Scn commitScn, String lcrPosition, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext)OracleOffsetContext(OracleConnectorConfig connectorConfig, Scn scn, String lcrPosition, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.debezium.pipeline.spi.OffsetContext
getIncrementalSnapshotContext, incrementalSnapshotEvents
-
-
-
-
Field Detail
-
SERVER_PARTITION_KEY
public static final String SERVER_PARTITION_KEY
- See Also:
- Constant Field Values
-
SNAPSHOT_COMPLETED_KEY
public static final String SNAPSHOT_COMPLETED_KEY
- See Also:
- Constant Field Values
-
sourceInfoSchema
private final org.apache.kafka.connect.data.Schema sourceInfoSchema
-
sourceInfo
private final SourceInfo sourceInfo
-
transactionContext
private final TransactionContext transactionContext
-
snapshotCompleted
private boolean snapshotCompleted
Whether a snapshot has been completed or not.
-
-
Constructor Detail
-
OracleOffsetContext
public OracleOffsetContext(OracleConnectorConfig connectorConfig, Scn scn, Scn commitScn, String lcrPosition, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext)
-
OracleOffsetContext
public OracleOffsetContext(OracleConnectorConfig connectorConfig, Scn scn, String lcrPosition, boolean snapshot, boolean snapshotCompleted, TransactionContext transactionContext)
-
-
Method Detail
-
create
public static OracleOffsetContext.Builder create()
-
getPartition
public Map<String,?> getPartition()
- Specified by:
getPartitionin interfaceOffsetContext
-
getOffset
public Map<String,?> 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
public void setScn(Scn scn)
-
setCommitScn
public void setCommitScn(Scn commitScn)
-
getScn
public Scn getScn()
-
getCommitScn
public Scn getCommitScn()
-
setLcrPosition
public void setLcrPosition(String lcrPosition)
-
getLcrPosition
public String getLcrPosition()
-
setTransactionId
public void setTransactionId(String transactionId)
-
setSourceTime
public void setSourceTime(Instant instant)
-
setTableId
public void setTableId(TableId tableId)
-
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
-
markLastSnapshotRecord
public void markLastSnapshotRecord()
- Specified by:
markLastSnapshotRecordin interfaceOffsetContext
-
event
public void event(DataCollectionId tableId, Instant timestamp)
- Specified by:
eventin interfaceOffsetContext
-
getTransactionContext
public TransactionContext getTransactionContext()
- Specified by:
getTransactionContextin interfaceOffsetContext
-
getScnFromOffsetMapByKey
public static Scn getScnFromOffsetMapByKey(Map<String,?> offset, String key)
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
-
-