Package io.debezium.pipeline
Class AbstractBlockingSnapshotTest<T extends org.apache.kafka.connect.source.SourceConnector>
java.lang.Object
io.debezium.embedded.AbstractConnectorTest
io.debezium.embedded.async.AbstractAsyncEngineConnectorTest
io.debezium.pipeline.source.snapshot.incremental.AbstractSnapshotTest<T>
io.debezium.pipeline.AbstractBlockingSnapshotTest<T>
- All Implemented Interfaces:
Testing
public abstract class AbstractBlockingSnapshotTest<T extends org.apache.kafka.connect.source.SourceConnector>
extends AbstractSnapshotTest<T>
-
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 TypeFieldDescriptionprotected static final intprivate intFields inherited from class io.debezium.pipeline.source.snapshot.incremental.AbstractSnapshotTest
PARTITION_NO, SCHEMA_HISTORY_PATH, SERVER_NAME, signalsFileFields inherited from class io.debezium.embedded.AbstractConnectorTest
consumedLines, engine, isEngineRunning, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, requiresAssemblyProfileClassRule, requiresAssemblyProfileRule, skipTestRule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidprotected voidprotected voidassertRecordsFromSnapshotAndStreamingArePresent(int expectedRecords, AbstractConnectorTest.SourceRecords recordsByTopic) protected voidassertRecordsWithValuesPresent(int expectedRecords, List<Integer> expectedValues, String topicName, AbstractConnectorTest.SourceRecords recordsByTopic) protected voidassertStreamingRecordsArePresent(int expectedRecords, AbstractConnectorTest.SourceRecords recordsByTopic) private voidassertStreamingTotalNumberOfCreateEventsSeen(Long expectedStreamingEvents) protected abstract Stringprotected abstract JdbcConnectionprotected abstract Stringprivate Future<?> executeAsync(Runnable operation) voidvoidvoidvoidprotected intgetExpectedValues(Long totalSnapshotRecords) private LonggetTotalSnapshotRecords(String table, String connector, String server, String task, String database) private LonggetTotalStreamingCreateEventsSeen(String connector, String server, String task, String database) protected Configuration.BuilderhistorizedMutableConfig(boolean signalTableOnly, boolean storeOnlyCapturedDdl) protected intprotected 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 abstract Configuration.BuildermutableConfig(boolean signalTableOnly, boolean storeOnlyCapturedDdl) voidprotected abstract Stringserver()voidprotected abstract Stringprotected abstract Stringprotected static voidwaitForLogMessage(String message, Class<?> logEmitterClass) Methods inherited from class io.debezium.pipeline.source.snapshot.incremental.AbstractSnapshotTest
alterTableAddColumnStatement, alterTableDropColumnStatement, buildAdditionalConditions, config, connectorClass, consumeMixedWithIncrementalSnapshot, consumeMixedWithIncrementalSnapshot, consumeMixedWithIncrementalSnapshot, consumeMixedWithIncrementalSnapshot, consumeMixedWithIncrementalSnapshot, consumeMixedWithIncrementalSnapshot, consumeMixedWithIncrementalSnapshot, consumeRecordsMixedWithIncrementalSnapshot, consumeRecordsMixedWithIncrementalSnapshot, database, getMaximumEnqueuedRecordCount, getRecordValue, pkFieldName, populate4PkTable, populateTable, populateTable, populateTable, populateTable, populateTables, populateTables, populateTableWithSpecificValue, sendAdHocSnapshotSignal, sendAdHocSnapshotSignalWithAdditionalConditionsWithSurrogateKey, sendAdHocSnapshotSignalWithAdditionalConditionsWithSurrogateKey, sendAdHocSnapshotSignalWithAdditionalConditionWithSurrogateKey, sendAdHocSnapshotSignalWithAdditionalConditionWithSurrogateKey, sendExecuteSnapshotFileSignal, sendExecuteSnapshotFileSignal, signalTableName, signalTableNameSanitized, startConnector, startConnector, startConnector, startConnector, startConnectorWithSnapshot, tableDataCollectionId, tableDataCollectionIds, tableNames, task, topicNames, valueFieldName, waitForCdcTransactionPropagation, waitForConnectorToStartMethods inherited from class io.debezium.embedded.async.AbstractAsyncEngineConnectorTest
createEngine, createEngineBuilder, getSignalerMethods 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, cleanupTestFwkState, configValue, consumeAvailableRecords, consumeAvailableRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeRecord, consumeRecords, consumeRecords, consumeRecords, consumeRecordsButSkipUntil, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopicUntil, consumeRecordsUntil, debug, getConsumer, getSnapshotMetricsObjectName, getSnapshotMetricsObjectName, getSnapshotMetricsObjectName, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, 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, storeOffsets, validate, waitForAvailableRecords, waitForAvailableRecords, waitForConnectorShutdown, waitForEngineShutdown, waitForSnapshotToBeCompleted, waitForSnapshotToBeCompleted, waitForSnapshotWithCustomMetricsToBeCompleted, waitForSnapshotWithCustomMetricsToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitForStreamingRunning, waitForStreamingWithCustomMetricsToStart, waitForStreamingWithCustomMetricsToStart, waitTimeForEngine, waitTimeForRecords, waitTimeForRecordsAfterNulls
-
Field Details
-
signalingRecords
private int signalingRecords -
ROW_COUNT
protected static final int ROW_COUNT- See Also:
-
-
Constructor Details
-
AbstractBlockingSnapshotTest
public AbstractBlockingSnapshotTest()
-
-
Method Details
-
mutableConfig
protected abstract Configuration.Builder mutableConfig(boolean signalTableOnly, boolean storeOnlyCapturedDdl) - Specified by:
mutableConfigin classAbstractSnapshotTest<T extends org.apache.kafka.connect.source.SourceConnector>
-
databaseConnection
- Specified by:
databaseConnectionin classAbstractSnapshotTest<T extends org.apache.kafka.connect.source.SourceConnector>
-
topicName
- Specified by:
topicNamein classAbstractSnapshotTest<T extends org.apache.kafka.connect.source.SourceConnector>
-
tableName
- Specified by:
tableNamein classAbstractSnapshotTest<T extends org.apache.kafka.connect.source.SourceConnector>
-
escapedTableDataCollectionId
-
connector
- Specified by:
connectorin classAbstractSnapshotTest<T extends org.apache.kafka.connect.source.SourceConnector>
-
server
- Specified by:
serverin classAbstractSnapshotTest<T extends org.apache.kafka.connect.source.SourceConnector>
-
historizedMutableConfig
protected Configuration.Builder historizedMutableConfig(boolean signalTableOnly, boolean storeOnlyCapturedDdl) -
executeBlockingSnapshot
- Throws:
Exception
-
executeBlockingSnapshotWhileStreaming
- Throws:
Exception
-
executeBlockingSnapshotWithAdditionalCondition
- Throws:
Exception
-
streamingMetricsResumeAfterBlockingSnapshot
- Throws:
Exception
-
readsSchemaOnlyForSignaledTables
- Throws:
Exception
-
executeBlockingSnapshotWithEscapedCollectionName
- Throws:
Exception
-
anErrorDuringBlockingSnapshotShouldLeaveTheConnectorInAGoodState
@FixFor("DBZ-8244") public void anErrorDuringBlockingSnapshotShouldLeaveTheConnectorInAGoodState() throws Exception- Throws:
Exception
-
aFailedBlockingSnapshotShouldNotCauseInitialSnapshotOnRestart
@FixFor("DBZ-7903") public void aFailedBlockingSnapshotShouldNotCauseInitialSnapshotOnRestart() throws Exception- Throws:
Exception
-
expectedDdlsCount
protected int expectedDdlsCount() -
assertDdl
-
insertMaxSleep
protected int insertMaxSleep() -
insertTask
-
getTotalStreamingCreateEventsSeen
private Long getTotalStreamingCreateEventsSeen(String connector, String server, String task, String database) throws MalformedObjectNameException, ReflectionException, AttributeNotFoundException, InstanceNotFoundException, MBeanException -
getTotalSnapshotRecords
private Long getTotalSnapshotRecords(String table, String connector, String server, String task, String database) throws MalformedObjectNameException, ReflectionException, AttributeNotFoundException, InstanceNotFoundException, MBeanException -
getExpectedValues
-
waitForLogMessage
-
assertStreamingTotalNumberOfCreateEventsSeen
private void assertStreamingTotalNumberOfCreateEventsSeen(Long expectedStreamingEvents) throws ReflectionException, MalformedObjectNameException, AttributeNotFoundException, InstanceNotFoundException, MBeanException -
executeAsync
-
assertStreamingRecordsArePresent
protected void assertStreamingRecordsArePresent(int expectedRecords, AbstractConnectorTest.SourceRecords recordsByTopic) -
assertRecordsFromSnapshotAndStreamingArePresent
protected void assertRecordsFromSnapshotAndStreamingArePresent(int expectedRecords, AbstractConnectorTest.SourceRecords recordsByTopic) throws InterruptedException - Throws:
InterruptedException
-
assertRecordsWithValuesPresent
protected void assertRecordsWithValuesPresent(int expectedRecords, List<Integer> expectedValues, String topicName, AbstractConnectorTest.SourceRecords recordsByTopic) -
insertRecords
- Throws:
SQLException
-
insertRecordsWithRandomSleep
private void insertRecordsWithRandomSleep(int rowCount, int startingPkId, int maxSleep, Runnable actionOnInsert) throws SQLException - Throws:
SQLException
-
insertRecordsWithRandomSleep
private void insertRecordsWithRandomSleep(int rowCount, int startingPkId, int maxSleep) throws SQLException - Throws:
SQLException
-