@Experimental public interface JdbcSourceChunkSplitter extends ChunkSplitter<io.debezium.relational.TableId>
ChunkSplitter used to split table into a set of chunks for JDBC data source.| 限定符和类型 | 方法和说明 |
|---|---|
String |
buildSplitScanQuery(io.debezium.relational.TableId tableId,
org.apache.flink.table.types.logical.RowType splitKeyType,
boolean isFirstSplit,
boolean isLastSplit)
Build the scan query sql of the
SnapshotSplit. |
org.apache.flink.table.types.DataType |
fromDbzColumn(io.debezium.relational.Column splitColumn)
Get a corresponding Flink data type from a debezium
Column. |
Collection<SnapshotSplit> |
generateSplits(io.debezium.relational.TableId tableId)
Generates all snapshot splits (chunks) for the give table path.
|
default org.apache.flink.table.types.logical.RowType |
getSplitType(io.debezium.relational.Column splitColumn)
convert dbz column to Flink row type.
|
default boolean |
isEvenlySplitColumn(io.debezium.relational.Column splitColumn)
Checks whether split column is evenly distributed across its range.
|
Long |
queryApproximateRowCnt(io.debezium.jdbc.JdbcConnection jdbc,
io.debezium.relational.TableId tableId)
Approximate total number of entries in the lookup table.
|
Object |
queryMin(io.debezium.jdbc.JdbcConnection jdbc,
io.debezium.relational.TableId tableId,
String columnName,
Object excludedLowerBound)
Query the minimum value of the column in the table, and the minimum value must greater than
the excludedLowerBound value. e.g. prepare query string
SELECT MIN(%s) FROM %s WHERE %s > ? |
Object[] |
queryMinMax(io.debezium.jdbc.JdbcConnection jdbc,
io.debezium.relational.TableId tableId,
String columnName)
Query the maximum and minimum value of the column in the table. e.g. query string
SELECT MIN(%s) FROM %s WHERE %s > ? |
Object |
queryNextChunkMax(io.debezium.jdbc.JdbcConnection jdbc,
io.debezium.relational.TableId tableId,
String columnName,
int chunkSize,
Object includedLowerBound)
Query the maximum value of the next chunk, and the next chunk must be greater than or equal
to
includedLowerBound value [min_1, max_1), [min_2, max_2),... |
Collection<SnapshotSplit> generateSplits(io.debezium.relational.TableId tableId)
generateSplits 在接口中 ChunkSplitter<io.debezium.relational.TableId>Object[] queryMinMax(io.debezium.jdbc.JdbcConnection jdbc, io.debezium.relational.TableId tableId, String columnName) throws SQLException
SELECT MIN(%s) FROM %s WHERE %s > ?jdbc - JDBC connection.tableId - table identity.columnName - column name.SQLExceptionObject queryMin(io.debezium.jdbc.JdbcConnection jdbc, io.debezium.relational.TableId tableId, String columnName, Object excludedLowerBound) throws SQLException
SELECT MIN(%s) FROM %s WHERE %s > ?jdbc - JDBC connection.tableId - table identity.columnName - column name.excludedLowerBound - the minimum value should be greater than this value.SQLExceptionObject queryNextChunkMax(io.debezium.jdbc.JdbcConnection jdbc, io.debezium.relational.TableId tableId, String columnName, int chunkSize, Object includedLowerBound) throws SQLException
includedLowerBound value [min_1, max_1), [min_2, max_2),... [min_n, null).
Each time this method is called it will return max1, max2...jdbc - JDBC connection.tableId - table identity.columnName - column name.chunkSize - chunk size.includedLowerBound - the previous chunk end value.SQLExceptionLong queryApproximateRowCnt(io.debezium.jdbc.JdbcConnection jdbc, io.debezium.relational.TableId tableId) throws SQLException
jdbc - JDBC connection.tableId - table identity.SQLExceptionString buildSplitScanQuery(io.debezium.relational.TableId tableId, org.apache.flink.table.types.logical.RowType splitKeyType, boolean isFirstSplit, boolean isLastSplit)
SnapshotSplit.tableId - table identity.splitKeyType - primary key type.isFirstSplit - whether the first split.isLastSplit - whether the last split.default boolean isEvenlySplitColumn(io.debezium.relational.Column splitColumn)
splitColumn - split column.org.apache.flink.table.types.DataType fromDbzColumn(io.debezium.relational.Column splitColumn)
Column.splitColumn - dbz split column.default org.apache.flink.table.types.logical.RowType getSplitType(io.debezium.relational.Column splitColumn)
splitColumn - split column.Copyright © 2022 10MG. All rights reserved.