Package io.debezium.relational
Class CustomConverterRegistry
- java.lang.Object
-
- io.debezium.relational.CustomConverterRegistry
-
@ThreadSafe public class CustomConverterRegistry extends Object
The registry of all converters that were provided by the connector configuration.- Author:
- Jiri Pechanec
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CustomConverterRegistry.ConverterDefinition<S>
Class binding together the schema of the conversion result and the converter code.
-
Field Summary
Fields Modifier and Type Field Description private Map<String,CustomConverterRegistry.ConverterDefinition<org.apache.kafka.connect.data.SchemaBuilder>>
conversionFunctionMap
private List<CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,ConvertedField>>
converters
-
Constructor Summary
Constructors Constructor Description CustomConverterRegistry(List<CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,ConvertedField>> converters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String
fullColumnName(TableId table, Column column)
Optional<ValueConverter>
getValueConverter(TableId table, Column column)
Obtain a pre-registered converter for a given column.Optional<org.apache.kafka.connect.data.SchemaBuilder>
registerConverterFor(TableId table, Column column)
Create and register a converter for a given database column.
-
-
-
Field Detail
-
converters
@Immutable private final List<CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,ConvertedField>> converters
-
conversionFunctionMap
private final Map<String,CustomConverterRegistry.ConverterDefinition<org.apache.kafka.connect.data.SchemaBuilder>> conversionFunctionMap
-
-
Constructor Detail
-
CustomConverterRegistry
public CustomConverterRegistry(List<CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,ConvertedField>> converters)
-
-
Method Detail
-
registerConverterFor
public Optional<org.apache.kafka.connect.data.SchemaBuilder> registerConverterFor(TableId table, Column column)
Create and register a converter for a given database column.- Parameters:
table
- the table that contains the columncolumn
- the column metadata- Returns:
- the schema of the value generated by the converter or empty if converter does not support the column
-
getValueConverter
public Optional<ValueConverter> getValueConverter(TableId table, Column column)
Obtain a pre-registered converter for a given column.- Parameters:
table
- the table that contains the columncolumn
- the column metadata- Returns:
- the the value converter or empty if converter does not support the column
-
-