Package io.debezium.connector.db2
Class Db2SnapshotChangeEventSource
java.lang.Object
io.debezium.pipeline.source.AbstractSnapshotChangeEventSource<P,O>
io.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext>
io.debezium.connector.db2.Db2SnapshotChangeEventSource
- All Implemented Interfaces:
io.debezium.pipeline.source.spi.ChangeEventSource,io.debezium.pipeline.source.spi.SnapshotChangeEventSource<Db2Partition,,Db2OffsetContext> AutoCloseable
public class Db2SnapshotChangeEventSource
extends io.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classMutable context which is populated in the course of snapshotting.Nested classes/interfaces inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource
io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<P extends io.debezium.pipeline.spi.Partition,O extends io.debezium.pipeline.spi.OffsetContext> Nested classes/interfaces inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<P extends io.debezium.pipeline.spi.Partition,O extends io.debezium.pipeline.spi.OffsetContext> Nested classes/interfaces inherited from interface io.debezium.pipeline.source.spi.ChangeEventSource
io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Db2ConnectorConfigprivate final Db2Connectionprivate static final org.slf4j.LoggerFields inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource
clock, connectionPool, dispatcher, MATCH_ALL_PATTERN, SELECT_ALL_PATTERN, snapshotterServiceFields inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
LOG_INTERVAL, notificationService -
Constructor Summary
ConstructorsConstructorDescriptionDb2SnapshotChangeEventSource(Db2ConnectorConfig connectorConfig, io.debezium.jdbc.MainConnectionProvidingConnectionFactory<Db2Connection> connectionFactory, Db2DatabaseSchema schema, io.debezium.pipeline.EventDispatcher<Db2Partition, io.debezium.relational.TableId> dispatcher, io.debezium.util.Clock clock, io.debezium.pipeline.source.spi.SnapshotProgressListener<Db2Partition> snapshotProgressListener, io.debezium.pipeline.notification.NotificationService<Db2Partition, Db2OffsetContext> notificationService, io.debezium.snapshot.SnapshotterService snapshotterService) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaborted(io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) private voidclose(io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) protected voidcompleted(io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) protected voidconnectionCreated(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) protected Db2OffsetContextcopyOffset(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) protected voiddetermineSnapshotOffset(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> ctx, Db2OffsetContext previousOffset) protected Set<io.debezium.relational.TableId>getAllTableIds(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> ctx) protected io.debezium.schema.SchemaChangeEventgetCreateTableEvent(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext, io.debezium.relational.Table table) getSnapshotSelect(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext, io.debezium.relational.TableId tableId, List<String> columns) Generate a valid db2 query string for the specified tableprotected voidlockTablesForSchemaSnapshot(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext sourceContext, io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) protected io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2Partition,Db2OffsetContext> prepare(Db2Partition partition, boolean onDemand) private StringquoteTableName(io.debezium.relational.TableId tableId) protected voidreadTableStructure(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext sourceContext, io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext, Db2OffsetContext previousOffset, io.debezium.pipeline.source.SnapshottingTask snapshottingTask) protected voidreleaseSchemaSnapshotLocks(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) Methods inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource
additionalColumnFilter, connectionPoolConnectionCreated, createDataEventsForTableCallable, createSchemaChangeEventsForTables, createSnapshotConnection, doCreateDataEventsForTable, doExecute, enhanceOverriddenSelect, getBlockingSnapshottingTask, getChangeRecordEmitter, getClock, getPreparedColumnNames, getSignalDataCollectionPattern, getSnapshotConnectionFirstSelect, getSnapshotSelectOverridesByTable, getSnapshotSourceTimestamp, getSnapshottingTask, getTablesForSchemaChange, lastSnapshotRecord, postSnapshot, preSnapshot, readTableStatement, releaseDataSnapshotLocks, resultSetForDataEvents, rowCountForTable, tryStartingSnapshotMethods inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource
close, delaySnapshotIfNeeded, determineDataCollectionsToBeSnapshotted, execute, getDataCollectionPattern, getOffsets
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
connectorConfig
-
jdbcConnection
-
-
Constructor Details
-
Db2SnapshotChangeEventSource
public Db2SnapshotChangeEventSource(Db2ConnectorConfig connectorConfig, io.debezium.jdbc.MainConnectionProvidingConnectionFactory<Db2Connection> connectionFactory, Db2DatabaseSchema schema, io.debezium.pipeline.EventDispatcher<Db2Partition, io.debezium.relational.TableId> dispatcher, io.debezium.util.Clock clock, io.debezium.pipeline.source.spi.SnapshotProgressListener<Db2Partition> snapshotProgressListener, io.debezium.pipeline.notification.NotificationService<Db2Partition, Db2OffsetContext> notificationService, io.debezium.snapshot.SnapshotterService snapshotterService)
-
-
Method Details
-
prepare
protected io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2Partition,Db2OffsetContext> prepare(Db2Partition partition, boolean onDemand) - Specified by:
preparein classio.debezium.pipeline.source.AbstractSnapshotChangeEventSource<Db2Partition,Db2OffsetContext>
-
connectionCreated
protected void connectionCreated(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) throws Exception- Overrides:
connectionCreatedin classio.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext> - Throws:
Exception
-
getAllTableIds
protected Set<io.debezium.relational.TableId> getAllTableIds(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> ctx) throws Exception- Specified by:
getAllTableIdsin classio.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext> - Throws:
Exception
-
lockTablesForSchemaSnapshot
protected void lockTablesForSchemaSnapshot(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext sourceContext, io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) throws SQLException, InterruptedException- Specified by:
lockTablesForSchemaSnapshotin classio.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext> - Throws:
SQLExceptionInterruptedException
-
quoteTableName
-
releaseSchemaSnapshotLocks
protected void releaseSchemaSnapshotLocks(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) throws SQLException- Specified by:
releaseSchemaSnapshotLocksin classio.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext> - Throws:
SQLException
-
determineSnapshotOffset
protected void determineSnapshotOffset(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> ctx, Db2OffsetContext previousOffset) throws Exception- Specified by:
determineSnapshotOffsetin classio.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext> - Throws:
Exception
-
readTableStructure
protected void readTableStructure(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext sourceContext, io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext, Db2OffsetContext previousOffset, io.debezium.pipeline.source.SnapshottingTask snapshottingTask) throws SQLException, InterruptedException- Specified by:
readTableStructurein classio.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext> - Throws:
SQLExceptionInterruptedException
-
getCreateTableEvent
protected io.debezium.schema.SchemaChangeEvent getCreateTableEvent(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext, io.debezium.relational.Table table) - Specified by:
getCreateTableEventin classio.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext>
-
completed
protected void completed(io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) - Overrides:
completedin classio.debezium.pipeline.source.AbstractSnapshotChangeEventSource<Db2Partition,Db2OffsetContext>
-
aborted
protected void aborted(io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) - Overrides:
abortedin classio.debezium.pipeline.source.AbstractSnapshotChangeEventSource<Db2Partition,Db2OffsetContext>
-
close
private void close(io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) -
getSnapshotSelect
protected Optional<String> getSnapshotSelect(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext, io.debezium.relational.TableId tableId, List<String> columns) Generate a valid db2 query string for the specified table- Specified by:
getSnapshotSelectin classio.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext> - Parameters:
tableId- the table to generate a query for- Returns:
- a valid query string
-
copyOffset
protected Db2OffsetContext copyOffset(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2Partition, Db2OffsetContext> snapshotContext) - Specified by:
copyOffsetin classio.debezium.relational.RelationalSnapshotChangeEventSource<Db2Partition,Db2OffsetContext>
-