Class BinlogFieldReader

java.lang.Object
io.debezium.connector.binlog.jdbc.BinlogFieldReader

public abstract class BinlogFieldReader extends Object
Decodes a binlog connector's JDBC result set return value based on configured protocols.
Author:
yangjie, Chris Cranford
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • TEXT_DATA_TYPES

      private static final Set<String> TEXT_DATA_TYPES
    • connectorConfig

      private final BinlogConnectorConfig connectorConfig
  • Constructor Details

  • Method Details

    • readField

      public Object readField(ResultSet rs, int columnIndex, Column column, Table table) throws SQLException
      Read the field from the provided JDBC ResultSet.
      Parameters:
      rs - the result set to be read, should not be null
      columnIndex - the column index or position to read
      column - the relational model column being read, never null
      table - the relational table being read, never null
      Returns:
      the field's value
      Throws:
      SQLException - if there is a database exception or failure reading the column's value
    • readTimeField

      protected abstract Object readTimeField(ResultSet rs, int columnIndex, Column column, Table table) throws SQLException
      Reads the time field based on the requirements of the concrete field reader.*
      Throws:
      SQLException
    • readDateField

      protected abstract Object readDateField(ResultSet rs, int columnIndex, Column column, Table table) throws SQLException
      Reads the date field based on the requirements of the concrete field reader.*
      Throws:
      SQLException
    • readTimestampField

      protected abstract Object readTimestampField(ResultSet rs, int columnIndex, Column column, Table table) throws SQLException
      Reads the timestamp field based on the requirements of the concrete field reader.*
      Throws:
      SQLException
    • getCharacterSet

      protected abstract String getCharacterSet(Column column) throws UnsupportedEncodingException
      Read the column's character set.
      Throws:
      UnsupportedEncodingException
    • logInvalidValue

      protected void logInvalidValue(ResultSet rs, int columnIndex, Object value) throws SQLException
      Common handler for logging invalid values.
      Parameters:
      rs - the result set, should not be null
      columnIndex - the column index or position read
      value - the value that was read
      Throws:
      SQLException - if there is a database exception trying to get column metadata information
    • hasValueConverter

      protected boolean hasValueConverter(Column column, TableId tableId)