Package io.debezium.connector.mongodb
Class IncrementalSnapshotIT
java.lang.Object
io.debezium.embedded.AbstractConnectorTest
io.debezium.connector.mongodb.AbstractMongoConnectorIT
io.debezium.connector.mongodb.IncrementalSnapshotIT
- All Implemented Interfaces:
Testing
- Direct Known Subclasses:
MultiThreadIncrementalSnapshotIT
Test to verify incremental snapshotting for MongoDB.
- Author:
- Jiri Pechanec
-
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 Stringprivate static final intprotected 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 voidassertCloseEventCount(Consumer<Long> consumer) voidbefore()protected Configuration.Builderconfig()protected Class<io.debezium.connector.mongodb.MongoDbConnector>protected booleanconsumeAnyRemainingIncrementalSnapshotEventsAndCheckForStopMessage(LogInterceptor interceptor, String stopMessage) consumeMixedWithIncrementalSnapshot(int recordCount) consumeMixedWithIncrementalSnapshot(int recordCount, String topicName) consumeMixedWithIncrementalSnapshot(int recordCount, Function<org.apache.kafka.connect.source.SourceRecord, V> valueConverter, Predicate<Map.Entry<Integer, V>> dataCompleted, Consumer<List<org.apache.kafka.connect.source.SourceRecord>> recordConsumer, String topicName) consumeMixedWithIncrementalSnapshot(int recordCount, Predicate<Map.Entry<Integer, Integer>> dataCompleted, Consumer<List<org.apache.kafka.connect.source.SourceRecord>> recordConsumer) protected <V,K> Map<K, V> consumeMixedWithIncrementalSnapshot(int recordCount, Predicate<Map.Entry<K, V>> dataCompleted, Function<org.apache.kafka.connect.data.Struct, K> idCalculator, Function<org.apache.kafka.connect.source.SourceRecord, V> valueConverter, String topicName, Consumer<List<org.apache.kafka.connect.source.SourceRecord>> recordConsumer) consumeRecordsMixedWithIncrementalSnapshot(int recordCount) consumeRecordsMixedWithIncrementalSnapshot(int recordCount, Predicate<Map.Entry<Integer, org.apache.kafka.connect.source.SourceRecord>> dataCompleted, Consumer<List<org.apache.kafka.connect.source.SourceRecord>> recordConsumer) protected Stringprotected IntegerextractFieldValue(org.apache.kafka.connect.source.SourceRecord record) protected Stringprotected intprotected voidprotected voidinsertAdditionalData(String collectionName) voidvoidvoidinserts()voidvoidprotected Stringprotected voidprotected voidpopulateDataCollection(String dataCollectionName) protected voidvoidvoidprotected voidprotected voidsendAdHocSnapshotSignal(String... dataCollectionIds) protected voidsendAdHocSnapshotSignalAndWait(String... collectionIds) protected voidsendAdHocSnapshotStopSignal(String... dataCollectionIds) protected voidsendAdHocSnapshotStopSignalAndWait(String... collectionIds) protected voidprotected voidvoidprivate <K> voidsnapshotOnly(K initialId, Function<K, K> idGenerator) voidvoidvoidvoidvoidvoidvoidprotected voidprotected voidstartConnector(Function<Configuration.Builder, Configuration.Builder> custConfig) protected voidstartConnector(Function<Configuration.Builder, Configuration.Builder> custConfig, io.debezium.engine.DebeziumEngine.CompletionCallback callback) voidvoidprotected Stringprotected voidupdateData(int batchSize) voidupdates()voidvoidprotected Stringprotected voidMethods 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, 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, waitTimeForRecords, waitTimeForRecordsAfterNulls
-
Field Details
-
ROW_COUNT
protected static final int ROW_COUNT- See Also:
-
MAXIMUM_NO_RECORDS_CONSUMES
private static final int MAXIMUM_NO_RECORDS_CONSUMES- 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
-
IncrementalSnapshotIT
public IncrementalSnapshotIT()
-
-
Method Details
-
before
public void before() -
after
public void after() -
connectorClass
-
config
-
dataCollectionName
-
dataCollectionNames
-
fullDataCollectionName
-
fullDataCollectionNames
-
topicName
-
topicNames
-
populateDataCollection
-
populateDataCollection
protected void populateDataCollection() -
populateDataCollections
protected void populateDataCollections() -
insertAdditionalData
protected void insertAdditionalData() -
insertAdditionalData
-
updateData
protected void updateData(int batchSize) -
startConnector
-
startConnector
protected void startConnector(Function<Configuration.Builder, Configuration.Builder> custConfig, io.debezium.engine.DebeziumEngine.CompletionCallback callback) -
startConnector
protected void startConnector() -
waitForConnectorToStart
protected void waitForConnectorToStart() -
sendAdHocSnapshotSignal
- Throws:
SQLException
-
sendAdHocSnapshotStopSignal
- Throws:
SQLException
-
sendAdHocSnapshotSignal
- Throws:
SQLException
-
sendPauseSignal
- Throws:
SQLException
-
sendResumeSignal
- Throws:
SQLException
-
consumeMixedWithIncrementalSnapshot
protected Map<Integer,Integer> consumeMixedWithIncrementalSnapshot(int recordCount) throws InterruptedException - Throws:
InterruptedException
-
consumeMixedWithIncrementalSnapshot
protected Map<Integer,Integer> consumeMixedWithIncrementalSnapshot(int recordCount, String topicName) throws InterruptedException - Throws:
InterruptedException
-
extractFieldValue
-
consumeMixedWithIncrementalSnapshot
protected <V> Map<Integer,V> consumeMixedWithIncrementalSnapshot(int recordCount, Function<org.apache.kafka.connect.source.SourceRecord, V> valueConverter, Predicate<Map.Entry<Integer, throws InterruptedExceptionV>> dataCompleted, Consumer<List<org.apache.kafka.connect.source.SourceRecord>> recordConsumer, String topicName) - Throws:
InterruptedException
-
consumeMixedWithIncrementalSnapshot
protected <V,K> Map<K,V> consumeMixedWithIncrementalSnapshot(int recordCount, Predicate<Map.Entry<K, V>> dataCompleted, Function<org.apache.kafka.connect.data.Struct, throws InterruptedExceptionK> idCalculator, Function<org.apache.kafka.connect.source.SourceRecord, V> valueConverter, String topicName, Consumer<List<org.apache.kafka.connect.source.SourceRecord>> recordConsumer) - Throws:
InterruptedException
-
consumeRecordsMixedWithIncrementalSnapshot
protected Map<Integer,org.apache.kafka.connect.source.SourceRecord> consumeRecordsMixedWithIncrementalSnapshot(int recordCount) throws InterruptedException - Throws:
InterruptedException
-
consumeMixedWithIncrementalSnapshot
protected Map<Integer,Integer> consumeMixedWithIncrementalSnapshot(int recordCount, Predicate<Map.Entry<Integer, Integer>> dataCompleted, Consumer<List<org.apache.kafka.connect.source.SourceRecord>> recordConsumer) throws InterruptedException- Throws:
InterruptedException
-
consumeRecordsMixedWithIncrementalSnapshot
protected Map<Integer,org.apache.kafka.connect.source.SourceRecord> consumeRecordsMixedWithIncrementalSnapshot(int recordCount, Predicate<Map.Entry<Integer, org.apache.kafka.connect.source.SourceRecord>> dataCompleted, Consumer<List<org.apache.kafka.connect.source.SourceRecord>> recordConsumer) throws InterruptedException- Throws:
InterruptedException
-
valueFieldName
-
pkFieldName
-
snapshotOnly
- Throws:
Exception
-
shouldStreamWithDatabaseIncludeList
- Throws:
InterruptedException
-
snapshotOnlyInt32
- Throws:
Exception
-
snapshotOnlyWithInt64
- Throws:
Exception
-
snapshotOnlyDouble
- Throws:
Exception
-
snapshotOnlyDecimal128
- Throws:
Exception
-
snapshotOnlyObjectId
- Throws:
Exception
-
snapshotOnlyString
- Throws:
Exception
-
invalidTablesInTheList
- Throws:
Exception
-
snapshotOnlyWithRestart
- Throws:
Exception
-
inserts
- Throws:
Exception
-
updates
- Throws:
Exception
-
updatesWithRestart
- Throws:
Exception
-
updatesLargeChunk
- Throws:
Exception
-
stopCurrentIncrementalSnapshotWithoutCollectionsAndTakeNewNewIncrementalSnapshotAfterRestart
@FixFor("DBZ-4271") public void stopCurrentIncrementalSnapshotWithoutCollectionsAndTakeNewNewIncrementalSnapshotAfterRestart() throws Exception- Throws:
Exception
-
stopCurrentIncrementalSnapshotWithAllCollectionsAndTakeNewNewIncrementalSnapshotAfterRestart
@FixFor("DBZ-4271") public void stopCurrentIncrementalSnapshotWithAllCollectionsAndTakeNewNewIncrementalSnapshotAfterRestart() throws Exception- Throws:
Exception
-
removeNotYetCapturedCollectionFromInProgressIncrementalSnapshot
@FixFor("DBZ-4271") public void removeNotYetCapturedCollectionFromInProgressIncrementalSnapshot() throws Exception- Throws:
Exception
-
removeStartedCapturedCollectionFromInProgressIncrementalSnapshot
@FixFor("DBZ-4271") public void removeStartedCapturedCollectionFromInProgressIncrementalSnapshot() throws Exception- Throws:
Exception
-
pauseDuringSnapshot
- Throws:
Exception
-
insertInsertWatermarkingStrategy
- Throws:
Exception
-
insertDeleteWatermarkingStrategy
- Throws:
Exception
-
assertCloseEventCount
-
sendAdHocSnapshotSignalAndWait
- Throws:
Exception
-
sendAdHocSnapshotStopSignalAndWait
- Throws:
Exception
-
consumeAnyRemainingIncrementalSnapshotEventsAndCheckForStopMessage
protected boolean consumeAnyRemainingIncrementalSnapshotEventsAndCheckForStopMessage(LogInterceptor interceptor, String stopMessage) throws Exception - Throws:
Exception
-
getMaximumEnqueuedRecordCount
protected int getMaximumEnqueuedRecordCount()- Overrides:
getMaximumEnqueuedRecordCountin classAbstractConnectorTest
-