public interface ManualPartitioner extends Serializable
A function used to assign partitions to this spout. WARNING if this is not done correctly you can really mess things up, like not reading data in some partitions. The complete TopologyContext is passed in, but it is suggested that you use the index of the spout and the total number of spouts to avoid missing partitions or double assigning partitions.
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
|
List<org.apache.kafka.common.TopicPartition> partition(List<org.apache.kafka.common.TopicPartition> allPartitions, TopologyContext context)
Get the partitions for this assignment
allPartitions
- all of the partitions that the set of spouts want to subscribe to, in a strict orderingcontext
- the context of the topologyCopyright © 2019 The Apache Software Foundation. All Rights Reserved.