Package io.debezium.connector.mongodb
Class MongoDbOffsetContext
java.lang.Object
io.debezium.connector.mongodb.MongoDbOffsetContext
- All Implemented Interfaces:
OffsetContext
A context that facilitates the management of the current offsets across a set of mongodb replica sets.
- Author:
- Chris Cranford
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IncrementalSnapshotContext<CollectionId>private final Map<ReplicaSet,ReplicaSetOffsetContext> private final Map<ReplicaSet,ReplicaSetPartition> private final SourceInfoprivate final TransactionContext -
Constructor Summary
ConstructorsConstructorDescriptionMongoDbOffsetContext(SourceInfo sourceInfo, TransactionContext transactionContext, IncrementalSnapshotContext<CollectionId> incrementalSnapshotContext) MongoDbOffsetContext(SourceInfo sourceInfo, TransactionContext transactionContext, IncrementalSnapshotContext<CollectionId> incrementalSnapshotContext, Map<ReplicaSet, org.bson.Document> offsets) -
Method Summary
Modifier and TypeMethodDescriptionvoidevent(DataCollectionId collectionId, Instant timestamp) getReplicaSetOffsetContext(ReplicaSet replicaSet) Get aReplicaSetOffsetContextinstance for a givenReplicaSet.getReplicaSetPartition(ReplicaSet replicaSet) Get aReplicaSetPartitioninstance for a givenReplicaSet.org.apache.kafka.connect.data.Structorg.apache.kafka.connect.data.Schemavoidbooleanvoidvoidvoidvoid(package private) voidstartReplicaSetSnapshot(String replicaSetName) (package private) voidstopReplicaSetSnapshot(String replicaSetName) toString()
-
Field Details
-
sourceInfo
-
transactionContext
-
replicaSetPartitions
-
replicaSetOffsetContexts
-
incrementalSnapshotContext
-
-
Constructor Details
-
MongoDbOffsetContext
public MongoDbOffsetContext(SourceInfo sourceInfo, TransactionContext transactionContext, IncrementalSnapshotContext<CollectionId> incrementalSnapshotContext) -
MongoDbOffsetContext
public MongoDbOffsetContext(SourceInfo sourceInfo, TransactionContext transactionContext, IncrementalSnapshotContext<CollectionId> incrementalSnapshotContext, Map<ReplicaSet, org.bson.Document> offsets)
-
-
Method Details
-
startReplicaSetSnapshot
-
stopReplicaSetSnapshot
-
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
-
markLastSnapshotRecord
public void markLastSnapshotRecord()- Specified by:
markLastSnapshotRecordin interfaceOffsetContext
-
getTransactionContext
- Specified by:
getTransactionContextin interfaceOffsetContext
-
incrementalSnapshotEvents
public void incrementalSnapshotEvents()- Specified by:
incrementalSnapshotEventsin interfaceOffsetContext
-
getIncrementalSnapshotContext
- Specified by:
getIncrementalSnapshotContextin interfaceOffsetContext
-
event
- Specified by:
eventin interfaceOffsetContext
-
getReplicaSetPartition
Get aReplicaSetPartitioninstance for a givenReplicaSet.- Parameters:
replicaSet- the replica set; must not be null.- Returns:
- a replica set partition; never null.
-
getReplicaSetOffsetContext
Get aReplicaSetOffsetContextinstance for a givenReplicaSet.- Parameters:
replicaSet- the replica set; must not be null.- Returns:
- a replica set offset context; never null.
-
toString
-