public class MongoDbSnapshotChangeEventSource extends AbstractSnapshotChangeEventSource
SnapshotChangeEventSource that performs multi-threaded snapshots of replica sets.| Modifier and Type | Class and Description |
|---|---|
private static class |
MongoDbSnapshotChangeEventSource.MongoDbSnapshotContext
Mutable context that is populated in the course of snapshotting.
|
static class |
MongoDbSnapshotChangeEventSource.MongoDbSnapshottingTask
A configuration describing the task to be performed during snapshotting.
|
AbstractSnapshotChangeEventSource.SnapshotContext, AbstractSnapshotChangeEventSource.SnapshottingTaskChangeEventSource.ChangeEventSourceContext| Modifier and Type | Field and Description |
|---|---|
private AtomicBoolean |
aborted |
private static String |
AUTHORIZATION_FAILURE_MESSAGE |
protected Clock |
clock |
private ConnectionContext |
connectionContext |
private MongoDbConnectorConfig |
connectorConfig |
private EventDispatcher<CollectionId> |
dispatcher |
private ErrorHandler |
errorHandler |
private static org.slf4j.Logger |
LOGGER |
private MongoDbOffsetContext |
previousOffset |
private ReplicaSets |
replicaSets |
private SnapshotProgressListener |
snapshotProgressListener |
private MongoDbTaskContext |
taskContext |
| Constructor and Description |
|---|
MongoDbSnapshotChangeEventSource(MongoDbConnectorConfig connectorConfig,
MongoDbTaskContext taskContext,
ReplicaSets replicaSets,
MongoDbOffsetContext previousOffset,
EventDispatcher<CollectionId> dispatcher,
Clock clock,
SnapshotProgressListener snapshotProgressListener,
ErrorHandler errorHandler) |
complete, delaySnapshotIfNeeded, determineDataCollectionsToBeSnapshotted, executeprivate static final org.slf4j.Logger LOGGER
private static final String AUTHORIZATION_FAILURE_MESSAGE
private final MongoDbConnectorConfig connectorConfig
private final MongoDbTaskContext taskContext
private final MongoDbOffsetContext previousOffset
private final ConnectionContext connectionContext
private final ReplicaSets replicaSets
private final EventDispatcher<CollectionId> dispatcher
protected final Clock clock
private final SnapshotProgressListener snapshotProgressListener
private final ErrorHandler errorHandler
private AtomicBoolean aborted
public MongoDbSnapshotChangeEventSource(MongoDbConnectorConfig connectorConfig, MongoDbTaskContext taskContext, ReplicaSets replicaSets, MongoDbOffsetContext previousOffset, EventDispatcher<CollectionId> dispatcher, Clock clock, SnapshotProgressListener snapshotProgressListener, ErrorHandler errorHandler)
protected SnapshotResult doExecute(ChangeEventSource.ChangeEventSourceContext context, AbstractSnapshotChangeEventSource.SnapshotContext snapshotContext, AbstractSnapshotChangeEventSource.SnapshottingTask snapshottingTask) throws Exception
doExecute in class AbstractSnapshotChangeEventSourceExceptionprotected AbstractSnapshotChangeEventSource.SnapshottingTask getSnapshottingTask(OffsetContext previousOffset)
getSnapshottingTask in class AbstractSnapshotChangeEventSourceprotected AbstractSnapshotChangeEventSource.SnapshotContext prepare(ChangeEventSource.ChangeEventSourceContext sourceContext) throws Exception
prepare in class AbstractSnapshotChangeEventSourceExceptionprivate void snapshotReplicaSet(ChangeEventSource.ChangeEventSourceContext sourceContext, MongoDbSnapshotChangeEventSource.MongoDbSnapshotContext ctx, ReplicaSet replicaSet) throws InterruptedException
InterruptedExceptionprivate ConnectionContext.MongoPrimary establishConnectionToPrimary(ReplicaSet replicaSet)
private boolean isSnapshotExpected(ConnectionContext.MongoPrimary primaryClient, ReplicaSetOffsetContext offsetContext)
protected void determineSnapshotOffsets(MongoDbSnapshotChangeEventSource.MongoDbSnapshotContext ctx, ReplicaSets replicaSets)
private void createDataEvents(ChangeEventSource.ChangeEventSourceContext sourceContext, MongoDbSnapshotChangeEventSource.MongoDbSnapshotContext snapshotContext, ReplicaSet replicaSet, ConnectionContext.MongoPrimary primaryClient) throws InterruptedException
InterruptedExceptionprivate void createDataEventsForReplicaSet(ChangeEventSource.ChangeEventSourceContext sourceContext, MongoDbSnapshotChangeEventSource.MongoDbSnapshotContext snapshotContext, EventDispatcher.SnapshotReceiver snapshotReceiver, ReplicaSet replicaSet, ConnectionContext.MongoPrimary primaryClient) throws InterruptedException
InterruptedExceptionprivate void createDataEventsForCollection(ChangeEventSource.ChangeEventSourceContext sourceContext, MongoDbSnapshotChangeEventSource.MongoDbSnapshotContext snapshotContext, EventDispatcher.SnapshotReceiver snapshotReceiver, ReplicaSet replicaSet, CollectionId collectionId, ConnectionContext.MongoPrimary primaryClient) throws InterruptedException
InterruptedExceptionprotected ChangeRecordEmitter getChangeRecordEmitter(AbstractSnapshotChangeEventSource.SnapshotContext snapshotContext, CollectionId collectionId, org.bson.Document document, ReplicaSet replicaSet)
protected Clock getClock()
Copyright © 2021 JBoss by Red Hat. All rights reserved.