Package io.debezium.connector.mongodb
Class MongoDbOffsetContext
java.lang.Object
io.debezium.pipeline.CommonOffsetContext<SourceInfo>
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 TransactionContextFields inherited from class io.debezium.pipeline.CommonOffsetContext
sourceInfo -
Constructor Summary
ConstructorsConstructorDescriptionMongoDbOffsetContext(SourceInfo sourceInfo, TransactionContext transactionContext, IncrementalSnapshotContext<CollectionId> incrementalSnapshotContext) MongoDbOffsetContext(SourceInfo sourceInfo, TransactionContext transactionContext, IncrementalSnapshotContext<CollectionId> incrementalSnapshotContext, Map<ReplicaSet, org.bson.BsonDocument> 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.Schemabooleanvoidvoid(package private) voidstartReplicaSetSnapshot(String replicaSetName) (package private) voidstopReplicaSetSnapshot(String replicaSetName) toString()Methods inherited from class io.debezium.pipeline.CommonOffsetContext
getSourceInfo, incrementalSnapshotEvents, markSnapshotRecord, postSnapshotCompletion
-
Field Details
-
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.BsonDocument> offsets)
-
-
Method Details
-
startReplicaSetSnapshot
-
stopReplicaSetSnapshot
-
getOffset
-
getSourceInfoSchema
public org.apache.kafka.connect.data.Schema getSourceInfoSchema() -
isSnapshotRunning
public boolean isSnapshotRunning() -
preSnapshotStart
public void preSnapshotStart() -
preSnapshotCompletion
public void preSnapshotCompletion() -
getTransactionContext
-
getIncrementalSnapshotContext
-
event
-
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
-