Package io.debezium.connector.mongodb
Class BlockingSnapshotIT
java.lang.Object
io.debezium.embedded.AbstractConnectorTest
io.debezium.connector.mongodb.AbstractMongoConnectorIT
io.debezium.connector.mongodb.BlockingSnapshotIT
- All Implemented Interfaces:
Testing
-
Nested Class Summary
Nested classes/interfaces inherited from class io.debezium.embedded.AbstractConnectorTest
AbstractConnectorTest.SourceRecordsNested classes/interfaces inherited from interface io.debezium.util.Testing
Testing.Debug, Testing.Files, Testing.InterruptableFunction, Testing.Network, Testing.Print, Testing.Timer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprotected static final intprivate static final StringFields inherited from class io.debezium.connector.mongodb.AbstractMongoConnectorIT
config, context, logInterceptor, mongoFields inherited from class io.debezium.embedded.AbstractConnectorTest
consumedLines, engine, isEngineRunning, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafter()private voidassertRecordsFromSnapshotAndStreamingArePresent(int expectedRecords) private voidassertRecordsWithValuesPresent(int expectedRecords, List<Integer> expectedValues, String topicName) private voidassertStreamingRecordsArePresent(int expectedRecords) voidbefore()protected Configuration.Builderconfig()protected Class<io.debezium.connector.mongodb.MongoDbConnector>protected Stringprivate Future<?>executeAsync(Runnable operation) voidvoidvoidprotected IntegerextractFieldValue(org.apache.kafka.connect.source.SourceRecord record, String fieldName) protected StringgetExpectedValues(Long totalSnapshotRecords) private LonggetTotalSnapshotRecords(String table, String connector, String server, String task, String database) protected intprivate voidinsertRecords(int rowCount, int startingPkId) private voidinsertRecordsWithRandomSleep(int rowCount, int startingPkId, int maxSleep) private voidinsertRecordsWithRandomSleep(int rowCount, int startingPkId, int maxSleep, Runnable actionOnInsert) private Runnableprotected voidprotected voidpopulateDataCollection(String dataCollectionName) private @NotNull Stringprotected voidsendAdHocBlockingSnapshotSignal(String... dataCollectionIds) protected voidsendAdHocSnapshotSignalWithAdditionalConditionsWithSurrogateKey(Map<String, String> additionalConditions, String... dataCollectionIds) protected voidstartConnector(Function<Configuration.Builder, Configuration.Builder> custConfig) protected voidstartConnector(Function<Configuration.Builder, Configuration.Builder> custConfig, io.debezium.engine.DebeziumEngine.CompletionCallback callback) protected Stringprivate static voidwaitForLogMessage(String message, Class<?> logEmitterClass) static intMethods inherited from class io.debezium.connector.mongodb.AbstractMongoConnectorIT
afterAll, afterEach, beforeAll, beforeEach, connect, deleteDocuments, dropAndInsertDocuments, getSnapshotMetricsObjectName, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, insertDocuments, insertDocumentsInTx, loadTestDocuments, storeDocuments, storeDocuments, updateDocument, updateDocumentsInTx, waitForSnapshotToBeCompleted, waitForSnapshotToBeCompleted, waitForStreamingRunning, waitForStreamingRunningMethods inherited from class io.debezium.embedded.AbstractConnectorTest
assertBeginTransaction, assertConfigurationErrors, assertConfigurationErrors, assertConfigurationErrors, assertConnectorIsRunning, assertConnectorNotRunning, assertDelete, assertEndTransaction, assertEngineIsRunning, assertHasNoSourceQuery, assertInsert, assertKey, assertNoConfigurationErrors, assertNoRecordsToConsume, assertOffset, assertOffset, assertOnlyTransactionRecordsToConsume, assertRecordTransactionMetadata, assertSchemaMatchesStruct, assertSchemaMatchesStruct, assertSourceQuery, assertTombstone, assertTombstone, assertUpdate, assertValueField, configValue, consumeAvailableRecords, consumeAvailableRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeRecord, consumeRecords, consumeRecords, consumeRecords, consumeRecordsButSkipUntil, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopicUntil, consumeRecordsUntil, debug, getConsumer, getMaximumEnqueuedRecordCount, getSnapshotMetricsObjectName, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingNamespace, initializeConnectorTestFramework, isStreamingRunning, isStreamingRunning, isStreamingRunning, isStreamingRunning, isTransactionRecord, loggingCompletion, print, readLastCommittedOffset, readLastCommittedOffsets, setConsumeTimeout, skipAvroValidation, start, start, start, start, start, start, start, startAndConsumeTillEnd, startAndConsumeTillEnd, stopConnector, stopConnector, validate, waitForAvailableRecords, waitForConnectorShutdown, waitForSnapshotToBeCompleted, waitForSnapshotWithCustomMetricsToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitForStreamingWithCustomMetricsToStart, waitTimeForRecordsAfterNulls
-
Field Details
-
ROW_COUNT
protected static final int ROW_COUNT- See Also:
-
DATABASE_NAME
- See Also:
-
COLLECTION_NAME
- See Also:
-
COLLECTION2_NAME
- See Also:
-
SIGNAL_COLLECTION_NAME
- See Also:
-
FULL_COLLECTION_NAME
- See Also:
-
FULL_COLLECTION2_NAME
- See Also:
-
DOCUMENT_ID
- See Also:
-
-
Constructor Details
-
BlockingSnapshotIT
public BlockingSnapshotIT()
-
-
Method Details
-
before
public void before() -
after
public void after() -
executeBlockingSnapshot
- Throws:
Exception
-
executeBlockingSnapshotWhileStreaming
- Throws:
Exception
-
executeBlockingSnapshotWithAdditionalCondition
- Throws:
Exception
-
connectorClass
-
waitTimeForRecords
public static int waitTimeForRecords() -
config
-
dataCollectionName
-
dataCollectionNames
-
fullDataCollectionName
-
fullDataCollectionNames
-
topicName
-
topicNames
-
populateDataCollection
-
populateDataCollection
protected void populateDataCollection() -
insertMaxSleep
protected int insertMaxSleep() -
insertTask
-
getTotalSnapshotRecords
private Long getTotalSnapshotRecords(String table, String connector, String server, String task, String database) throws MalformedObjectNameException, ReflectionException, AttributeNotFoundException, InstanceNotFoundException, MBeanException -
getExpectedValues
-
waitForLogMessage
-
executeAsync
-
assertStreamingRecordsArePresent
- Throws:
InterruptedException
-
assertRecordsFromSnapshotAndStreamingArePresent
private void assertRecordsFromSnapshotAndStreamingArePresent(int expectedRecords) throws InterruptedException - Throws:
InterruptedException
-
assertRecordsWithValuesPresent
private void assertRecordsWithValuesPresent(int expectedRecords, List<Integer> expectedValues, String topicName) throws InterruptedException - Throws:
InterruptedException
-
extractFieldValue
-
insertRecords
private void insertRecords(int rowCount, int startingPkId) -
insertRecordsWithRandomSleep
private void insertRecordsWithRandomSleep(int rowCount, int startingPkId, int maxSleep, Runnable actionOnInsert) -
insertRecordsWithRandomSleep
private void insertRecordsWithRandomSleep(int rowCount, int startingPkId, int maxSleep) -
sendAdHocBlockingSnapshotSignal
-
sendAdHocSnapshotSignalWithAdditionalConditionsWithSurrogateKey
-
startConnector
-
startConnector
protected void startConnector(Function<Configuration.Builder, Configuration.Builder> custConfig, io.debezium.engine.DebeziumEngine.CompletionCallback callback) -
replicaSetFullDataCollectionName
-