Class PartialKeyGrouping

java.lang.Object
org.apache.storm.grouping.PartialKeyGrouping
All Implemented Interfaces:
Serializable, CustomStreamGrouping

public class PartialKeyGrouping extends Object implements CustomStreamGrouping, Serializable
A variation on FieldGrouping. This grouping operates on a partitioning of the incoming tuples (like a FieldGrouping), but it can send Tuples from a given partition to multiple downstream tasks.

Given a total pool of target tasks, this grouping will always send Tuples with a given key to one member of a subset of those tasks. Each key is assigned a subset of tasks. Each tuple is then sent to one task from that subset.

Notes: - the default TaskSelector ensures each task gets as close to a balanced number of Tuples as possible - the default AssignmentCreator hashes the key and produces an assignment of two tasks

See Also: