Package io.debezium.pipeline
Class AbstractMetricsTest<T extends org.apache.kafka.connect.source.SourceConnector>
java.lang.Object
io.debezium.embedded.AbstractConnectorTest
io.debezium.embedded.async.AbstractAsyncEngineConnectorTest
io.debezium.pipeline.AbstractMetricsTest<T>
- All Implemented Interfaces:
Testing
public abstract class AbstractMetricsTest<T extends org.apache.kafka.connect.source.SourceConnector>
extends AbstractAsyncEngineConnectorTest
-
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
Fields 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 TypeMethodDescriptionvoidassertAdvancedMetrics(long expectedInsert) protected voidprivate voidprotected voidassertSnapshotWithCustomMetrics(Map<String, String> customMetricTags) protected voidassertStreamingMetrics(boolean checkAdvancedMetrics, long expectedEvents) protected voidassertStreamingWithCustomMetrics(Map<String, String> customMetricTags, long expectedEvents) protected abstract Configuration.Builderconfig()protected abstract Stringprotected Stringdatabase()protected abstract voidprotected abstract longprotected ObjectNameprotected ObjectNameprotected ObjectNameprotected ObjectNameprivate voidprivate voidinvokeOperation(ObjectName objectName, String operation) protected abstract Configuration.BuildernoSnapshot(Configuration.Builder config) protected abstract Stringserver()protected abstract booleanprotected voidstart()protected voidstart(Function<Configuration.Builder, Configuration.Builder> custConfig) protected abstract Stringprotected Stringtask()voidvoidvoidvoidvoidvoidvoidMethods 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, getMaximumEnqueuedRecordCount, 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
-
Constructor Details
-
AbstractMetricsTest
public AbstractMetricsTest()
-
-
Method Details
-
getConnectorClass
-
connector
-
server
-
config
-
noSnapshot
-
executeInsertStatements
- Throws:
Exception
-
tableName
-
expectedEvents
protected abstract long expectedEvents() -
snapshotCompleted
protected abstract boolean snapshotCompleted() -
task
-
database
-
start
protected void start() -
start
-
testLifecycle
- Throws:
Exception
-
testSnapshotOnlyMetrics
- Throws:
Exception
-
testSnapshotAndStreamingMetrics
- Throws:
Exception
-
testSnapshotAndStreamingWithCustomMetrics
- Throws:
Exception
-
testStreamingOnlyMetrics
- Throws:
Exception
-
testAdvancedStreamingMetrics
- Throws:
Exception
-
testPauseAndResumeAdvancedStreamingMetrics
- Throws:
Exception
-
insertRecords
- Throws:
Exception
-
assertSnapshotMetrics
- Throws:
Exception
-
assertSnapshotWithCustomMetrics
protected void assertSnapshotWithCustomMetrics(Map<String, String> customMetricTags) throws Exception- Throws:
Exception
-
assertSnapshotNotExecutedMetrics
- Throws:
Exception
-
assertStreamingMetrics
protected void assertStreamingMetrics(boolean checkAdvancedMetrics, long expectedEvents) throws Exception - Throws:
Exception
-
assertAdvancedMetrics
- Throws:
Exception
-
invokeOperation
private void invokeOperation(ObjectName objectName, String operation) throws ReflectionException, InstanceNotFoundException, MBeanException -
assertStreamingWithCustomMetrics
protected void assertStreamingWithCustomMetrics(Map<String, String> customMetricTags, long expectedEvents) throws Exception- Throws:
Exception
-
getSnapshotMetricsObjectName
- Throws:
MalformedObjectNameException
-
getStreamingMetricsObjectName
- Throws:
MalformedObjectNameException
-
getMultiplePartitionStreamingMetricsObjectName
protected ObjectName getMultiplePartitionStreamingMetricsObjectName() throws MalformedObjectNameException- Throws:
MalformedObjectNameException
-
getMultiplePartitionStreamingMetricsObjectNameCustomTags
protected ObjectName getMultiplePartitionStreamingMetricsObjectNameCustomTags(Map<String, String> customTags) throws MalformedObjectNameException- Throws:
MalformedObjectNameException
-