Class MysqlDebeziumTimeConverter
- java.lang.Object
-
- io.debezium.connector.mysql.converters.MysqlDebeziumTimeConverter
-
- All Implemented Interfaces:
io.debezium.spi.converter.CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,io.debezium.spi.converter.RelationalColumn>
public class MysqlDebeziumTimeConverter extends Object implements io.debezium.spi.converter.CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,io.debezium.spi.converter.RelationalColumn>
Debezium converts the datetime type in MySQL into a UTC timestamp by default (Timestamp), The time zone is hard-coded and cannot be changed. causing conversion errors part of the time Enable this converter to convert the four times "DATE", "DATETIME", "TIME", and "TIMESTAMP" into the format corresponding to the configured time zone (for example, yyyy-MM-dd)- See Also:
TinyIntOneToBooleanConverter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.debezium.spi.converter.CustomConverter
io.debezium.spi.converter.CustomConverter.Converter, io.debezium.spi.converter.CustomConverter.ConverterRegistration<S extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringDATE_FORMATprotected java.time.format.DateTimeFormatterdateFormatterprotected static StringDATETIME_FORMATprotected java.time.format.DateTimeFormatterdatetimeFormatterprotected static StringDEFAULT_DATE_FORMAT_PATTERNprotected static java.time.format.DateTimeFormatteroriginalFormatprotected BooleanparseNullDefaultValueprotected StringschemaNamePrefixprotected static StringTIME_FORMATprotected java.time.format.DateTimeFormattertimeFormatterprotected java.time.format.DateTimeFormattertimestampFormatterprotected java.time.ZoneIdzoneId
-
Constructor Summary
Constructors Constructor Description MysqlDebeziumTimeConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Properties properties)ObjectconvertDateDefaultValue(io.debezium.spi.converter.RelationalColumn field)voidconverterFor(io.debezium.spi.converter.RelationalColumn field, io.debezium.spi.converter.CustomConverter.ConverterRegistration<org.apache.kafka.connect.data.SchemaBuilder> registration)
-
-
-
Field Detail
-
DATE_FORMAT
protected static final String DATE_FORMAT
- See Also:
- Constant Field Values
-
TIME_FORMAT
protected static final String TIME_FORMAT
- See Also:
- Constant Field Values
-
DATETIME_FORMAT
protected static final String DATETIME_FORMAT
- See Also:
- Constant Field Values
-
zoneId
protected java.time.ZoneId zoneId
-
DEFAULT_DATE_FORMAT_PATTERN
protected static final String DEFAULT_DATE_FORMAT_PATTERN
- See Also:
- Constant Field Values
-
dateFormatter
protected java.time.format.DateTimeFormatter dateFormatter
-
timeFormatter
protected java.time.format.DateTimeFormatter timeFormatter
-
datetimeFormatter
protected java.time.format.DateTimeFormatter datetimeFormatter
-
timestampFormatter
protected java.time.format.DateTimeFormatter timestampFormatter
-
schemaNamePrefix
protected String schemaNamePrefix
-
originalFormat
protected static java.time.format.DateTimeFormatter originalFormat
-
parseNullDefaultValue
protected Boolean parseNullDefaultValue
-
-
Method Detail
-
configure
public void configure(Properties properties)
- Specified by:
configurein interfaceio.debezium.spi.converter.CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,io.debezium.spi.converter.RelationalColumn>
-
converterFor
public void converterFor(io.debezium.spi.converter.RelationalColumn field, io.debezium.spi.converter.CustomConverter.ConverterRegistration<org.apache.kafka.connect.data.SchemaBuilder> registration)- Specified by:
converterForin interfaceio.debezium.spi.converter.CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,io.debezium.spi.converter.RelationalColumn>
-
convertDateDefaultValue
public Object convertDateDefaultValue(io.debezium.spi.converter.RelationalColumn field)
-
-