Class PartitionedGroupDeterminer

  • All Implemented Interfaces:
    OutputGroupDeterminer

    public class PartitionedGroupDeterminer
    extends Object
    implements OutputGroupDeterminer
    This implementation of OutputGroupDeterminer groups events into 'n' number of partitions. The events will be divided into predefined number partitions based on the value of a given field in the event. Events which are having the same value for the partitioning field will belong the to the same partition.
    • Constructor Detail

      • PartitionedGroupDeterminer

        public PartitionedGroupDeterminer​(int partitionFieldIndex,
                                          int partitionCount)
    • Method Detail

      • decideGroup

        public String decideGroup​(Event event)
        Deciding the group of a given event and returning a unique identifier to identify a group. A correct implementation of this method should be returning the same group identifier for all events belongs a single group.
        Specified by:
        decideGroup in interface OutputGroupDeterminer
        Parameters:
        event - Event that needs to be decided to which group it belongs to
        Returns:
        Unique Identifier to identify the group of the event