Class AbstractChunkQueryBuilder<T extends DataCollectionId>
java.lang.Object
io.debezium.pipeline.source.snapshot.incremental.AbstractChunkQueryBuilder<T>
- All Implemented Interfaces:
ChunkQueryBuilder<T>
- Direct Known Subclasses:
DefaultChunkQueryBuilder,RowValueConstructorChunkQueryBuilder
public abstract class AbstractChunkQueryBuilder<T extends 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.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.
-
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 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 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 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 DataCollectionId>
-
getKeyMapper
-
getQueryColumns
Description copied from interface:ChunkQueryBuilderReturns the columns that are used for paginating the incremental snapshot chunks.- Specified by:
getQueryColumnsin interfaceChunkQueryBuilder<T extends DataCollectionId>
-