Package io.debezium.connector.mysql.jdbc
Class MySqlValueConverters
java.lang.Object
io.debezium.jdbc.JdbcValueConverters
io.debezium.connector.binlog.jdbc.BinlogValueConverters
io.debezium.connector.mysql.jdbc.MySqlValueConverters
- All Implemented Interfaces:
ValueConverterProvider
MySQL-specific customization of the conversions from JDBC values obtained from the MySQL binlog client library.
This class always uses UTC for the default time zone when converting values without timezone information to values that require
timezones. This is because MySQL TIMESTAMP
values are always
stored in UTC (unlike DATETIME
values) and
are replicated in this form. Meanwhile, the MySQL Binlog Client library will deserialize
these as Timestamp
values that have no timezone and, therefore, are presumed to be in UTC.
When the column is properly marked with a Types.TIMESTAMP_WITH_TIMEZONE
type, the converters will need to convert
that Timestamp
value into an OffsetDateTime
using the default time zone, which always is UTC.
- Author:
- Randall Hauch
-
Nested Class Summary
Nested classes/interfaces inherited from class io.debezium.jdbc.JdbcValueConverters
JdbcValueConverters.BigIntUnsignedMode, JdbcValueConverters.DecimalMode
-
Field Summary
Fields inherited from class io.debezium.jdbc.JdbcValueConverters
adaptiveTimeMicrosecondsPrecisionMode, adaptiveTimePrecisionMode, adjuster, bigIntUnsignedMode, binaryMode, decimalMode, defaultOffset, fallbackTimestampWithTimeZone, logger
-
Constructor Summary
ConstructorsConstructorDescriptionMySqlValueConverters
(JdbcValueConverters.DecimalMode decimalMode, TemporalPrecisionMode temporalPrecisionMode, JdbcValueConverters.BigIntUnsignedMode bigIntUnsignedMode, CommonConnectorConfig.BinaryHandlingMode binaryMode, TemporalAdjuster adjuster, CommonConnectorConfig.EventConvertingFailureHandlingMode eventConvertingFailureHandlingMode, ServiceRegistry serviceRegistry) Create a new instance that always uses UTC for the default time zone when converting values without timezone information to values that require timezones. -
Method Summary
Methods inherited from class io.debezium.connector.binlog.jdbc.BinlogValueConverters
adjustTemporal, byteOrderOfBitType, charsetFor, containsZeroValuesInDatePart, convertBigInt, convertBinary, convertDurationToMicroseconds, convertEnumToString, converter, convertFloat, convertGeometry, convertInteger, convertJson, convertPoint, convertSetToString, convertSetValue, convertSmallInt, convertString, convertTimestampToLocalDateTime, convertUnsignedBigint, convertUnsignedInt, convertUnsignedMediumint, convertUnsignedSmallint, convertUnsignedTinyint, convertYearToInt, extractEnumAndSetOptionsAsString, getJavaEncodingForCharSet, handleUnknownData, isGeometryCollection, matches, normalizeBinaryData, schemaBuilder, stringToDuration, stringToLocalDate
Methods inherited from class io.debezium.jdbc.JdbcValueConverters
convertBinaryToBase64, convertBinaryToBase64UrlSafe, convertBinaryToBytes, convertBinaryToHex, convertBit, convertBits, convertBits, convertBoolean, convertDateToEpochDays, convertDateToEpochDaysAsDate, convertDecimal, convertDouble, convertNumeric, convertReal, convertRowId, convertString, convertTime, convertTimestampToEpochMicros, convertTimestampToEpochMillis, convertTimestampToEpochMillisAsDate, convertTimestampToEpochNanos, convertTimestampWithZone, convertTimeToMicrosPastMidnight, convertTimeToMillisPastMidnight, convertTimeToMillisPastMidnightAsDate, convertTimeToNanosPastMidnight, convertTimeWithZone, convertTinyInt, convertValue, getTimePrecision, padLittleEndian, toBigDecimal, toByteBuffer, unexpectedBinary, withScaleAdjustedIfNeeded
-
Constructor Details
-
MySqlValueConverters
public MySqlValueConverters(JdbcValueConverters.DecimalMode decimalMode, TemporalPrecisionMode temporalPrecisionMode, JdbcValueConverters.BigIntUnsignedMode bigIntUnsignedMode, CommonConnectorConfig.BinaryHandlingMode binaryMode, TemporalAdjuster adjuster, CommonConnectorConfig.EventConvertingFailureHandlingMode eventConvertingFailureHandlingMode, ServiceRegistry serviceRegistry) Create a new instance that always uses UTC for the default time zone when converting values without timezone information to values that require timezones.- Parameters:
decimalMode
- howDECIMAL
andNUMERIC
values should be treated; may be null ifJdbcValueConverters.DecimalMode.PRECISE
is to be usedtemporalPrecisionMode
- temporal precision mode based onTemporalPrecisionMode
bigIntUnsignedMode
- howBIGINT UNSIGNED
values should be treated; may be null ifJdbcValueConverters.BigIntUnsignedMode.PRECISE
is to be usedbinaryMode
- how binary columns should be representedadjuster
- a temporal adjuster to make a database specific time modification before conversioneventConvertingFailureHandlingMode
- how handle when converting failureserviceRegistry
- the service registry, should not benull
-
-
Method Details
-
extractEnumAndSetOptions
- Specified by:
extractEnumAndSetOptions
in classBinlogValueConverters
-