Class AbstractChunkQueryBuilder<T extends io.debezium.spi.schema.DataCollectionId>
java.lang.Object
io.debezium.pipeline.source.snapshot.incremental.AbstractChunkQueryBuilder<T>
- All Implemented Interfaces:
ChunkQueryBuilder<T>
- Direct Known Subclasses:
DefaultChunkQueryBuilder,PhysicalRowIdentifierChunkQueryBuilder,RowValueConstructorChunkQueryBuilder
public abstract class AbstractChunkQueryBuilder<T extends io.debezium.spi.schema.DataCollectionId>
extends Object
implements ChunkQueryBuilder<T>
Base class for building queries for reading incremental snapshot chunks from a table.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Tables.ColumnNameFilterprotected final RelationalDatabaseConnectorConfigprotected final JdbcConnectionprivate static final org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionAbstractChunkQueryBuilder(RelationalDatabaseConnectorConfig config, JdbcConnection jdbcConnection) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddLowerBound(IncrementalSnapshotContext<T> context, Table table, Object[] boundaryKey, StringBuilder sql) protected voidaddUpperBound(IncrementalSnapshotContext<T> context, Table table, Object[] boundaryKey, StringBuilder sql) buildChunkQuery(IncrementalSnapshotContext<T> context, Table table, int limit, Optional<String> additionalCondition) Builds a query for reading the next incremental snapshot chunk from a table using the specified limit.buildChunkQuery(IncrementalSnapshotContext<T> context, Table table, Optional<String> additionalCondition) Builds a query for reading the next incremental snapshot chunk from a table using the chunk size configured by the connector.buildMaxPrimaryKeyQuery(IncrementalSnapshotContext<T> context, Table table, Optional<String> additionalCondition) Builds a query for reading the maximum primary key value from a table.protected StringbuildProjection(Table table) private Key.KeyMappergetQueryColumns(IncrementalSnapshotContext<T> context, Table table) Returns the columns that are used for paginating the incremental snapshot chunks.getTableAlias(Table table) readTableChunkStatement(IncrementalSnapshotContext<T> context, Table table, String sql) Prepares a statement for reading the next incremental snapshot chunk from a table using the SQL statement returned by buildChunkQuery.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.pipeline.source.snapshot.incremental.ChunkQueryBuilder
prepareTable
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
connectorConfig
-
jdbcConnection
-
columnFilter
-
-
Constructor Details
-
AbstractChunkQueryBuilder
public AbstractChunkQueryBuilder(RelationalDatabaseConnectorConfig config, JdbcConnection jdbcConnection)
-
-
Method Details
-
buildChunkQuery
public String buildChunkQuery(IncrementalSnapshotContext<T> context, Table table, Optional<String> additionalCondition) Description copied from interface:ChunkQueryBuilderBuilds a query for reading the next incremental snapshot chunk from a table using the chunk size configured by the connector.- Specified by:
buildChunkQueryin interfaceChunkQueryBuilder<T extends io.debezium.spi.schema.DataCollectionId>
-
buildChunkQuery
public String buildChunkQuery(IncrementalSnapshotContext<T> context, Table table, int limit, Optional<String> additionalCondition) Description copied from interface:ChunkQueryBuilderBuilds a query for reading the next incremental snapshot chunk from a table using the specified limit.- Specified by:
buildChunkQueryin interfaceChunkQueryBuilder<T extends io.debezium.spi.schema.DataCollectionId>
-
buildProjection
-
addLowerBound
protected void addLowerBound(IncrementalSnapshotContext<T> context, Table table, Object[] boundaryKey, StringBuilder sql) -
addUpperBound
protected void addUpperBound(IncrementalSnapshotContext<T> context, Table table, Object[] boundaryKey, StringBuilder sql) -
readTableChunkStatement
public PreparedStatement readTableChunkStatement(IncrementalSnapshotContext<T> context, Table table, String sql) throws SQLException Description copied from interface:ChunkQueryBuilderPrepares a statement for reading the next incremental snapshot chunk from a table using the SQL statement returned by buildChunkQuery.- Specified by:
readTableChunkStatementin interfaceChunkQueryBuilder<T extends io.debezium.spi.schema.DataCollectionId>- Throws:
SQLException
-
buildMaxPrimaryKeyQuery
public String buildMaxPrimaryKeyQuery(IncrementalSnapshotContext<T> context, Table table, Optional<String> additionalCondition) Description copied from interface:ChunkQueryBuilderBuilds a query for reading the maximum primary key value from a table.- Specified by:
buildMaxPrimaryKeyQueryin interfaceChunkQueryBuilder<T extends io.debezium.spi.schema.DataCollectionId>
-
getTableAlias
-
getKeyMapper
-
getQueryColumns
Description copied from interface:ChunkQueryBuilderReturns the columns that are used for paginating the incremental snapshot chunks.- Specified by:
getQueryColumnsin interfaceChunkQueryBuilder<T extends io.debezium.spi.schema.DataCollectionId>
-