Enum SourceTimestampMode

java.lang.Object
java.lang.Enum<SourceTimestampMode>
io.debezium.connector.sqlserver.SourceTimestampMode
All Implemented Interfaces:
EnumeratedValue, Serializable, Comparable<SourceTimestampMode>

public enum SourceTimestampMode extends Enum<SourceTimestampMode> implements EnumeratedValue
Strategy for populating the source.ts_ms field in change events.
  • Enum Constant Details

    • COMMIT

      public static final SourceTimestampMode COMMIT
      This mode (default) will set the source timestamp field (ts_ms) of when the record was committed in the database.
    • PROCESSING

      @Deprecated public static final SourceTimestampMode PROCESSING
      Deprecated.
      Use COMMIT instead.
      This mode will set the source timestamp field (ts_ms) of when the record was processed by Debezium.
  • Field Details

    • value

      private final String value
  • Constructor Details

    • SourceTimestampMode

      private SourceTimestampMode(String value)
  • Method Details

    • values

      public static SourceTimestampMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static SourceTimestampMode valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Specified by:
      getValue in interface EnumeratedValue
    • getTimestamp

      protected abstract Instant getTimestamp(Clock clock, ResultSet resultSet) throws SQLException
      Returns the timestamp to be put in the source metadata of the event depending on the mode.
      Parameters:
      clock - System clock to source processing time from
      resultSet - Result set representing the CDC event and its commit timestamp, if required by the mode
      Throws:
      SQLException
    • lsnTimestampSelectStatement

      protected abstract String lsnTimestampSelectStatement()
      Returns the SQL fragment to be embedded into the GET_ALL_CHANGES_FOR_TABLE query depending on the mode.
    • getResultColumnNames

      protected List<String> getResultColumnNames(ResultSetMetaData rsmd, int columnDataOffset) throws SQLException
      Returns the names of the data columns returned by the GET_ALL_CHANGES_FOR_TABLE query.
      Parameters:
      rsmd - Result set metadata
      columnDataOffset - Offset of the first data column in the result set
      Throws:
      SQLException
    • getDefaultMode

      public static SourceTimestampMode getDefaultMode()
    • fromMode

      static SourceTimestampMode fromMode(String mode)