public class RoundRobinManualPartitioner extends Object implements ManualPartitioner
Assign partitions in a round robin fashion for all spouts, not just the ones that are alive. Because the parallelism of the spouts does not typically change while running this makes the assignments more stable in the face of crashing spouts.
Round Robin means that first spout of N spouts will get the first partition, and the N+1th partition… The second spout will get the second partition and N+2th partition etc.
Constructor and Description |
---|
RoundRobinManualPartitioner() |
Modifier and Type | Method and Description |
---|---|
List<org.apache.kafka.common.TopicPartition> |
partition(List<org.apache.kafka.common.TopicPartition> allPartitions,
TopologyContext context)
Get the partitions for this assignment
|
public List<org.apache.kafka.common.TopicPartition> partition(List<org.apache.kafka.common.TopicPartition> allPartitions, TopologyContext context)
ManualPartitioner
Get the partitions for this assignment
partition
in interface ManualPartitioner
allPartitions
- all of the partitions that the set of spouts want to subscribe to, in a strict orderingcontext
- the context of the topologyCopyright © 2022 The Apache Software Foundation. All Rights Reserved.