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) 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
Modifier and TypeMethodDescriptionextractEnumAndSetOptions(Column column) protected StringgetJavaEncodingForCharSet(String charSetName) Methods inherited from class io.debezium.connector.binlog.jdbc.BinlogValueConverters
adjustTemporal, byteOrderOfBitType, charsetFor, containsZeroValuesInDatePart, convertBigInt, convertDurationToMicroseconds, convertEnumToString, converter, convertFloat, convertGeometry, convertInteger, convertJson, convertPoint, convertSetToString, convertSetValue, convertSmallInt, convertString, convertTimestampToLocalDateTime, convertUnsignedBigint, convertUnsignedInt, convertUnsignedMediumint, convertUnsignedSmallint, convertUnsignedTinyint, convertYearToInt, extractEnumAndSetOptionsAsString, handleUnknownData, isGeometryCollection, matches, normalizeBinaryData, schemaBuilder, stringToDuration, stringToLocalDateMethods inherited from class io.debezium.jdbc.JdbcValueConverters
convertBinary, 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) 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- howDECIMALandNUMERICvalues should be treated; may be null ifJdbcValueConverters.DecimalMode.PRECISEis to be usedtemporalPrecisionMode- temporal precision mode based onTemporalPrecisionModebigIntUnsignedMode- howBIGINT UNSIGNEDvalues should be treated; may be null ifJdbcValueConverters.BigIntUnsignedMode.PRECISEis 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 failure
-
-
Method Details
-
getJavaEncodingForCharSet
- Specified by:
getJavaEncodingForCharSetin classBinlogValueConverters
-
extractEnumAndSetOptions
- Specified by:
extractEnumAndSetOptionsin classBinlogValueConverters
-