Class IncrementalSnapshotIT

All Implemented Interfaces:
Testing

public class IncrementalSnapshotIT extends AbstractMongoConnectorIT
Test to verify incremental snapshotting for MongoDB.
Author:
Jiri Pechanec
  • Field Details

  • Constructor Details

    • IncrementalSnapshotIT

      public IncrementalSnapshotIT()
  • Method Details

    • before

      public void before()
    • after

      public void after()
    • connectorClass

      protected Class<io.debezium.connector.mongodb.MongoDbConnector> connectorClass()
    • config

      protected Configuration.Builder config()
    • dataCollectionName

      protected String dataCollectionName()
    • dataCollectionNames

      protected List<String> dataCollectionNames()
    • fullDataCollectionName

      protected String fullDataCollectionName()
    • fullDataCollectionNames

      protected List<String> fullDataCollectionNames()
    • topicName

      protected String topicName()
    • topicNames

      protected List<String> topicNames()
    • populateDataCollection

      protected void populateDataCollection(io.debezium.connector.mongodb.ConnectionContext.MongoPrimary connection, String dataCollectionName)
    • populateDataCollection

      protected void populateDataCollection(io.debezium.connector.mongodb.ConnectionContext.MongoPrimary connection)
    • populateDataCollections

      protected void populateDataCollections(io.debezium.connector.mongodb.ConnectionContext.MongoPrimary connection)
    • populateDataCollection

      protected void populateDataCollection()
    • populateDataCollections

      protected void populateDataCollections()
    • insertAdditionalData

      protected void insertAdditionalData()
    • insertAdditionalData

      protected void insertAdditionalData(String collectionName)
    • updateData

      protected void updateData(int batchSize)
    • startConnector

      protected void startConnector(io.debezium.engine.DebeziumEngine.CompletionCallback callback)
    • startConnector

      protected void startConnector(Function<Configuration.Builder,Configuration.Builder> custConfig)
    • 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

      protected void sendAdHocSnapshotSignal(String... dataCollectionIds) throws SQLException
      Throws:
      SQLException
    • sendAdHocSnapshotStopSignal

      protected void sendAdHocSnapshotStopSignal(String... dataCollectionIds) throws SQLException
      Throws:
      SQLException
    • sendAdHocSnapshotSignal

      protected void sendAdHocSnapshotSignal() throws SQLException
      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

      protected Integer extractFieldValue(org.apache.kafka.connect.source.SourceRecord record)
    • consumeMixedWithIncrementalSnapshot

      protected <V> Map<Integer,V> 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) throws InterruptedException
      Throws:
      InterruptedException
    • consumeMixedWithIncrementalSnapshot

      protected <V> Map<Integer,V> consumeMixedWithIncrementalSnapshot(int recordCount, Predicate<Map.Entry<Integer,V>> dataCompleted, Function<org.apache.kafka.connect.data.Struct,Integer> idCalculator, Function<org.apache.kafka.connect.source.SourceRecord,V> valueConverter, String topicName, 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) 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

      protected String valueFieldName()
    • pkFieldName

      protected String pkFieldName()
    • snapshotOnly

      public void snapshotOnly() throws Exception
      Throws:
      Exception
    • invalidTablesInTheList

      public void invalidTablesInTheList() throws Exception
      Throws:
      Exception
    • snapshotOnlyWithRestart

      public void snapshotOnlyWithRestart() throws Exception
      Throws:
      Exception
    • inserts

      public void inserts() throws Exception
      Throws:
      Exception
    • updates

      public void updates() throws Exception
      Throws:
      Exception
    • updatesWithRestart

      public void updatesWithRestart() throws Exception
      Throws:
      Exception
    • updatesLargeChunk

      public void updatesLargeChunk() throws Exception
      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
    • sendAdHocSnapshotSignalAndWait

      protected void sendAdHocSnapshotSignalAndWait(String... collectionIds) throws Exception
      Throws:
      Exception
    • sendAdHocSnapshotStopSignalAndWait

      protected void sendAdHocSnapshotStopSignalAndWait(String... collectionIds) throws Exception
      Throws:
      Exception
    • consumeAnyRemainingIncrementalSnapshotEventsAndCheckForStopMessage

      protected boolean consumeAnyRemainingIncrementalSnapshotEventsAndCheckForStopMessage(LogInterceptor interceptor, String stopMessage) throws Exception
      Throws:
      Exception
    • getMaximumEnqueuedRecordCount

      protected int getMaximumEnqueuedRecordCount()
      Overrides:
      getMaximumEnqueuedRecordCount in class AbstractConnectorTest