Enum SourceTimestampMode

    • Enum Constant Detail

      • 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 Detail

      • value

        private final String value
    • Constructor Detail

      • SourceTimestampMode

        private SourceTimestampMode​(String value)
    • Method Detail

      • values

        public static SourceTimestampMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SourceTimestampMode c : SourceTimestampMode.values())
            System.out.println(c);
        
        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
      • getTimestamp

        protected abstract Instant getTimestamp​(SqlServerConnection connection,
                                                Clock clock,
                                                ResultSet resultSet)
                                         throws SQLException
        Returns the timestamp to be put in the source metadata of the event depending on the mode.
        Parameters:
        connection - Server connection used to fetch the result set
        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​(boolean supportsAtTimeZone)
        Returns the SQL fragment to be embedded into the GET_ALL_CHANGES_FOR_TABLE query depending on the mode.
        Parameters:
        supportsAtTimeZone - Whether the server supports the AT TIME ZONE clause
      • 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