Class Db2SnapshotChangeEventSource

  • All Implemented Interfaces:
    io.debezium.pipeline.source.spi.ChangeEventSource, io.debezium.pipeline.source.spi.SnapshotChangeEventSource<Db2OffsetContext>

    public class Db2SnapshotChangeEventSource
    extends io.debezium.relational.RelationalSnapshotChangeEventSource<Db2OffsetContext>
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  Db2SnapshotChangeEventSource.Db2SnapshotContext
      Mutable context which is populated in the course of snapshotting.
      • Nested classes/interfaces inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource

        io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<O extends io.debezium.pipeline.spi.OffsetContext>
      • Nested classes/interfaces inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource

        io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<O extends io.debezium.pipeline.spi.OffsetContext>, io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshottingTask
      • Nested classes/interfaces inherited from interface io.debezium.pipeline.source.spi.ChangeEventSource

        io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext
    • Constructor Summary

      Constructors 
      Constructor Description
      Db2SnapshotChangeEventSource​(Db2ConnectorConfig connectorConfig, Db2Connection jdbcConnection, Db2DatabaseSchema schema, io.debezium.pipeline.EventDispatcher<io.debezium.relational.TableId> dispatcher, io.debezium.util.Clock clock, io.debezium.pipeline.source.spi.SnapshotProgressListener snapshotProgressListener)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void complete​(io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2OffsetContext> snapshotContext)  
      protected void connectionCreated​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext)  
      protected void determineSnapshotOffset​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> ctx, Db2OffsetContext previousOffset)  
      protected Set<io.debezium.relational.TableId> getAllTableIds​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> ctx)  
      protected io.debezium.schema.SchemaChangeEvent getCreateTableEvent​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext, io.debezium.relational.Table table)  
      protected Optional<String> getSnapshotSelect​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext, io.debezium.relational.TableId tableId)
      Generate a valid db2 query string for the specified table
      protected io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshottingTask getSnapshottingTask​(Db2OffsetContext previousOffset)  
      protected void lockTablesForSchemaSnapshot​(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext sourceContext, io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext)  
      protected io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2OffsetContext> prepare​(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext context)  
      protected void readTableStructure​(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext sourceContext, io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext, Db2OffsetContext previousOffset)  
      protected void releaseSchemaSnapshotLocks​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext)  
      • Methods inherited from class io.debezium.relational.RelationalSnapshotChangeEventSource

        createSchemaChangeEventsForTables, createSnapshotConnection, doExecute, enhanceOverriddenSelect, getChangeRecordEmitter, getClock, getColumnValue, lastSnapshotRecord, postSnapshot, readTableStatement, releaseDataSnapshotLocks, rowCountForTable, schema, tryStartingSnapshot
      • Methods inherited from class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource

        delaySnapshotIfNeeded, determineDataCollectionsToBeSnapshotted, execute
    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
    • Constructor Detail

      • Db2SnapshotChangeEventSource

        public Db2SnapshotChangeEventSource​(Db2ConnectorConfig connectorConfig,
                                            Db2Connection jdbcConnection,
                                            Db2DatabaseSchema schema,
                                            io.debezium.pipeline.EventDispatcher<io.debezium.relational.TableId> dispatcher,
                                            io.debezium.util.Clock clock,
                                            io.debezium.pipeline.source.spi.SnapshotProgressListener snapshotProgressListener)
    • Method Detail

      • getSnapshottingTask

        protected io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshottingTask getSnapshottingTask​(Db2OffsetContext previousOffset)
        Specified by:
        getSnapshottingTask in class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource<Db2OffsetContext>
      • prepare

        protected io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2OffsetContext> prepare​(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext context)
                                                                                                                   throws Exception
        Specified by:
        prepare in class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource<Db2OffsetContext>
        Throws:
        Exception
      • connectionCreated

        protected void connectionCreated​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext)
                                  throws Exception
        Overrides:
        connectionCreated in class io.debezium.relational.RelationalSnapshotChangeEventSource<Db2OffsetContext>
        Throws:
        Exception
      • getAllTableIds

        protected Set<io.debezium.relational.TableId> getAllTableIds​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> ctx)
                                                              throws Exception
        Specified by:
        getAllTableIds in class io.debezium.relational.RelationalSnapshotChangeEventSource<Db2OffsetContext>
        Throws:
        Exception
      • lockTablesForSchemaSnapshot

        protected void lockTablesForSchemaSnapshot​(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext sourceContext,
                                                   io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext)
                                            throws SQLException,
                                                   InterruptedException
        Specified by:
        lockTablesForSchemaSnapshot in class io.debezium.relational.RelationalSnapshotChangeEventSource<Db2OffsetContext>
        Throws:
        SQLException
        InterruptedException
      • releaseSchemaSnapshotLocks

        protected void releaseSchemaSnapshotLocks​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext)
                                           throws SQLException
        Specified by:
        releaseSchemaSnapshotLocks in class io.debezium.relational.RelationalSnapshotChangeEventSource<Db2OffsetContext>
        Throws:
        SQLException
      • determineSnapshotOffset

        protected void determineSnapshotOffset​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> ctx,
                                               Db2OffsetContext previousOffset)
                                        throws Exception
        Specified by:
        determineSnapshotOffset in class io.debezium.relational.RelationalSnapshotChangeEventSource<Db2OffsetContext>
        Throws:
        Exception
      • getCreateTableEvent

        protected io.debezium.schema.SchemaChangeEvent getCreateTableEvent​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext,
                                                                           io.debezium.relational.Table table)
                                                                    throws SQLException
        Specified by:
        getCreateTableEvent in class io.debezium.relational.RelationalSnapshotChangeEventSource<Db2OffsetContext>
        Throws:
        SQLException
      • complete

        protected void complete​(io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.SnapshotContext<Db2OffsetContext> snapshotContext)
        Overrides:
        complete in class io.debezium.pipeline.source.AbstractSnapshotChangeEventSource<Db2OffsetContext>
      • getSnapshotSelect

        protected Optional<String> getSnapshotSelect​(io.debezium.relational.RelationalSnapshotChangeEventSource.RelationalSnapshotContext<Db2OffsetContext> snapshotContext,
                                                     io.debezium.relational.TableId tableId)
        Generate a valid db2 query string for the specified table
        Specified by:
        getSnapshotSelect in class io.debezium.relational.RelationalSnapshotChangeEventSource<Db2OffsetContext>
        Parameters:
        tableId - the table to generate a query for
        Returns:
        a valid query string