Package io.debezium.connector.sqlserver
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 Summary
Enum Constants Enum Constant Description COMMITThis mode (default) will set the source timestamp field (ts_ms) of when the record was committed in the database.PROCESSINGDeprecated.UseCOMMITinstead.
-
Constructor Summary
Constructors Modifier Constructor Description privateSourceTimestampMode(String value)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) static SourceTimestampModefromMode(String mode)static SourceTimestampModegetDefaultMode()protected List<String>getResultColumnNames(ResultSetMetaData rsmd, int columnDataOffset)Returns the names of the data columns returned by theGET_ALL_CHANGES_FOR_TABLEquery.protected abstract InstantgetTimestamp(Clock clock, ResultSet resultSet)Returns the timestamp to be put in the source metadata of the event depending on the mode.StringgetValue()protected abstract StringlsnTimestampSelectStatement()Returns the SQL fragment to be embedded into theGET_ALL_CHANGES_FOR_TABLEquery depending on the mode.static SourceTimestampModevalueOf(String name)Returns the enum constant of this type with the specified name.static SourceTimestampMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
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.UseCOMMITinstead.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 nameNullPointerException- if the argument is null
-
getValue
public String getValue()
- Specified by:
getValuein interfaceEnumeratedValue
-
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 fromresultSet- 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 theGET_ALL_CHANGES_FOR_TABLEquery depending on the mode.
-
getResultColumnNames
protected List<String> getResultColumnNames(ResultSetMetaData rsmd, int columnDataOffset) throws SQLException
Returns the names of the data columns returned by theGET_ALL_CHANGES_FOR_TABLEquery.- Parameters:
rsmd- Result set metadatacolumnDataOffset- Offset of the first data column in the result set- Throws:
SQLException
-
getDefaultMode
public static SourceTimestampMode getDefaultMode()
-
fromMode
static SourceTimestampMode fromMode(String mode)
-
-