@Internal public class KafkaTopicPartitionAssigner extends Object
| 构造器和说明 |
|---|
KafkaTopicPartitionAssigner() |
public static int assign(KafkaTopicPartition partition, int numParallelSubtasks)
The resulting distribution of partitions of a single topic has the following contract:
The above contract is crucial and cannot be broken. Consumer subtasks rely on this contract to locally filter out partitions that it should not subscribe to, guaranteeing that all partitions of a single topic will always be assigned to some subtask in a uniformly distributed manner.
partition - the Kafka partitionnumParallelSubtasks - total number of parallel subtaskspublic static int assign(String topic, int partition, int numParallelSubtasks)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.