public enum SourceTimestampMode extends Enum<SourceTimestampMode> implements EnumeratedValue
| Enum Constant and Description |
|---|
COMMIT
This mode (default) will set the source timestamp field (ts_ms) of when the record was committed in the database.
|
PROCESSING
Deprecated.
Use
COMMIT instead. |
| Modifier and Type | Method and Description |
|---|---|
(package private) static SourceTimestampMode |
fromMode(String mode) |
static SourceTimestampMode |
getDefaultMode() |
protected List<String> |
getResultColumnNames(ResultSetMetaData rsmd,
int columnDataOffset)
Returns the names of the data columns returned by the
GET_ALL_CHANGES_FOR_TABLE query. |
protected abstract Instant |
getTimestamp(SqlServerConnection connection,
Clock clock,
ResultSet resultSet)
Returns the timestamp to be put in the source metadata of the event depending on the mode.
|
String |
getValue() |
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. |
static SourceTimestampMode |
valueOf(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.
|
public static final SourceTimestampMode COMMIT
@Deprecated public static final SourceTimestampMode PROCESSING
COMMIT instead.private final String value
public static SourceTimestampMode[] values()
for (SourceTimestampMode c : SourceTimestampMode.values()) System.out.println(c);
public static SourceTimestampMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getValue()
getValue in interface EnumeratedValueprotected abstract Instant getTimestamp(SqlServerConnection connection, Clock clock, ResultSet resultSet) throws SQLException
connection - Server connection used to fetch the result setclock - System clock to source processing time fromresultSet - Result set representing the CDC event and its commit timestamp, if required by the modeSQLExceptionprotected abstract String lsnTimestampSelectStatement(boolean supportsAtTimeZone)
GET_ALL_CHANGES_FOR_TABLE query depending on the mode.supportsAtTimeZone - Whether the server supports the AT TIME ZONE clauseprotected List<String> getResultColumnNames(ResultSetMetaData rsmd, int columnDataOffset) throws SQLException
GET_ALL_CHANGES_FOR_TABLE query.rsmd - Result set metadatacolumnDataOffset - Offset of the first data column in the result setSQLExceptionpublic static SourceTimestampMode getDefaultMode()
static SourceTimestampMode fromMode(String mode)
Copyright © 2021 JBoss by Red Hat. All rights reserved.