Class SqlServerUtils


  • public class SqlServerUtils
    extends Object
    The utils for SqlServer data source.
    • Constructor Detail

      • SqlServerUtils

        public SqlServerUtils()
    • Method Detail

      • queryApproximateRowCnt

        public static long queryApproximateRowCnt​(io.debezium.jdbc.JdbcConnection jdbc,
                                                  io.debezium.relational.TableId tableId)
                                           throws SQLException
        Throws:
        SQLException
      • queryNextChunkMax

        public static Object queryNextChunkMax​(io.debezium.jdbc.JdbcConnection jdbc,
                                               io.debezium.relational.TableId tableId,
                                               String splitColumnName,
                                               int chunkSize,
                                               Object includedLowerBound)
                                        throws SQLException
        Returns the next LSN to be read from the database. This is the LSN of the last record that was read from the database.
        Throws:
        SQLException
      • getSplitColumn

        public static io.debezium.relational.Column getSplitColumn​(io.debezium.relational.Table table,
                                                                   @Nullable
                                                                   String chunkKeyColumn)
      • getSplitType

        public static org.apache.flink.table.types.logical.RowType getSplitType​(io.debezium.relational.Column splitColumn)
      • getLsn

        public static Offset getLsn​(org.apache.kafka.connect.source.SourceRecord record)
      • currentLsn

        public static LsnOffset currentLsn​(io.debezium.connector.sqlserver.SqlServerConnection connection)
        Fetch current largest log sequence number (LSN) of the database.
      • buildSplitScanQuery

        public static String buildSplitScanQuery​(io.debezium.relational.TableId tableId,
                                                 org.apache.flink.table.types.logical.RowType pkRowType,
                                                 boolean isFirstSplit,
                                                 boolean isLastSplit)
        Get split scan query for the given table.
      • readTableSplitDataStatement

        public static PreparedStatement readTableSplitDataStatement​(io.debezium.jdbc.JdbcConnection jdbc,
                                                                    String sql,
                                                                    boolean isFirstSplit,
                                                                    boolean isLastSplit,
                                                                    Object[] splitStart,
                                                                    Object[] splitEnd,
                                                                    int primaryKeyNum,
                                                                    int fetchSize)
        Get table split data PreparedStatement.
      • createSqlServerDatabaseSchema

        public static io.debezium.connector.sqlserver.SqlServerDatabaseSchema createSqlServerDatabaseSchema​(io.debezium.connector.sqlserver.SqlServerConnectorConfig connectorConfig,
                                                                                                            io.debezium.connector.sqlserver.SqlServerConnection connection)
      • quote

        public static String quote​(io.debezium.relational.TableId tableId)
      • compare

        public static int compare​(Object obj1,
                                  Object obj2,
                                  io.debezium.relational.Column splitColumn)