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.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>
This SMT allow to use payload fields to calculate the destination partition.
- Author:
- Mario Fiore Vitale
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate RbuildNewRecord(R originalRecord, org.apache.kafka.connect.data.Struct envelope, int partition) voidclose()private 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)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
NESTING_SEPARATOR
- See Also:
-
CHANGE_SPECIAL_FIELD
- See Also:
-
FIELD_PAYLOAD_FIELD_CONF
- See Also:
-
FIELD_TOPIC_PARTITION_NUM_CONF
- See Also:
-
PARTITION_PAYLOAD_FIELDS_FIELD
-
TOPIC_PARTITION_NUM_FIELD
-
smtManager
-
payloadFields
-
partitionNumber
private int partitionNumber
-
-
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()
-