org.apache.storm.kafka.spout.subscription

## Interface ManualPartitioner

- All Superinterfaces:
    Serializable
  All Known Implementing Classes:
    RoundRobinManualPartitioner

      @FunctionalInterface
      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.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<org.apache.kafka.common.TopicPartition>` | `getPartitionsForThisTask(List<org.apache.kafka.common.TopicPartition> allPartitionsSorted, TopologyContext context)` Filter the list of all partitions handled by this set of spouts to get only the partitions assigned to this task.

- - ### Method Detail

    - #### getPartitionsForThisTask

          Set<org.apache.kafka.common.TopicPartition> getPartitionsForThisTask(List<org.apache.kafka.common.TopicPartition> allPartitionsSorted,
                                                                               TopologyContext context)

      Filter the list of all partitions handled by this set of spouts to get only the partitions assigned to this task.

      Parameters:
        `allPartitionsSorted` - all of the partitions that the set of spouts want to subscribe to in a strict ordering that is consistent across tasks
        `context` - the context of the topology
      Returns:
        the subset of the partitions that this spout task should handle.

Copyright © 2021 The Apache Software Foundation. All rights reserved.