@PublicEvolving public abstract class FlinkKafkaPartitioner<T> extends Object implements Serializable
FlinkKafkaPartitioner wraps logic on how to partition records across partitions of
multiple Kafka topics.| 构造器和说明 |
|---|
FlinkKafkaPartitioner() |
public void open(int parallelInstanceId,
int parallelInstances)
parallelInstanceId - 0-indexed id of the parallel sink instance in FlinkparallelInstances - the total number of parallel instancespublic abstract int partition(T record, byte[] key, byte[] value, String targetTopic, int[] partitions)
record - the record valuekey - serialized key of the recordvalue - serialized value of the recordtargetTopic - target topic for the recordpartitions - found partitions for the target topicCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.