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()
    • fullDataCollectionName

      protected String fullDataCollectionName()
    • topicName

      protected String topicName()
    • populateDataCollection

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

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

      protected void populateDataCollection()
    • insertAdditionalData

      protected void insertAdditionalData()
    • 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
    • sendAdHocSnapshotSignal

      protected void sendAdHocSnapshotSignal() throws SQLException
      Throws:
      SQLException
    • consumeMixedWithIncrementalSnapshot

      protected Map<Integer,Integer> consumeMixedWithIncrementalSnapshot(int recordCount) 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) 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
    • getMaximumEnqueuedRecordCount

      protected int getMaximumEnqueuedRecordCount()
      Overrides:
      getMaximumEnqueuedRecordCount in class AbstractConnectorTest