Class PartitionRouting<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
java.lang.Object
io.debezium.transforms.partitions.PartitionRouting<R>
- Type Parameters:
R- the subtype ofConnectRecordon which this transformation will operate
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.kafka.common.Configurable,org.apache.kafka.connect.components.Versioned,org.apache.kafka.connect.transforms.Transformation<R>
public class PartitionRouting<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
extends Object
implements org.apache.kafka.connect.transforms.Transformation<R>, org.apache.kafka.connect.components.Versioned
This SMT allow to use payload fields to calculate the destination partition.
- Author:
- Mario Fiore Vitale
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final String(package private) static final Fieldprivate PartitionRouting.HashFunctionprivate static final org.slf4j.Loggerprivate static final MurmurHash3static final String(package private) static final Fieldprivate intprivate SmtManager<R>(package private) static final Field -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate RbuildNewRecord(R originalRecord, org.apache.kafka.connect.data.Struct envelope, int partition) voidclose()protected intcomputePartition(Integer partitionNumber, List<Object> values) org.apache.kafka.common.config.ConfigDefconfig()voidprivate static StringgetFieldName(org.apache.kafka.connect.data.Struct envelope, String[] subFields, int i) private static org.apache.kafka.connect.data.StructgetLastStruct(org.apache.kafka.connect.data.Struct envelope, String[] subFields) version()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MURMUR_HASH_3
-
NESTING_SEPARATOR
- See Also:
-
CHANGE_SPECIAL_FIELD
- See Also:
-
FIELD_PAYLOAD_FIELD_CONF
- See Also:
-
FIELD_TOPIC_PARTITION_NUM_CONF
- See Also:
-
FIELD_HASH_FUNCTION
- See Also:
-
PARTITION_PAYLOAD_FIELDS_FIELD
-
TOPIC_PARTITION_NUM_FIELD
-
HASH_FUNCTION_FIELD
-
smtManager
-
payloadFields
-
partitionNumber
private int partitionNumber -
hashFc
-
-
Constructor Details
-
PartitionRouting
public PartitionRouting()
-
-
Method Details
-
config
public org.apache.kafka.common.config.ConfigDef config() -
configure
- Specified by:
configurein interfaceorg.apache.kafka.common.Configurable
-
apply
-
toValue
-
getLastStruct
private static org.apache.kafka.connect.data.Struct getLastStruct(org.apache.kafka.connect.data.Struct envelope, String[] subFields) -
getFieldName
-
buildNewRecord
-
computePartition
-
close
public void close() -
version
- Specified by:
versionin interfaceorg.apache.kafka.connect.components.Versioned
-