Class ModuloPartitionFunction

    • Constructor Detail

      • ModuloPartitionFunction

        public ModuloPartitionFunction​(int numPartitions)
        Constructor for the class.
        Parameters:
        numPartitions - Number of partitions.
    • Method Detail

      • getPartition

        public int getPartition​(Object value)
        Returns partition id for a given value. Assumes that the passed in object is either an Integer, or a string representation of an Integer.
        Specified by:
        getPartition in interface PartitionFunction
        Parameters:
        value - Value for which to determine the partition id.
        Returns:
        Partition id for the given value.
      • getNumPartitions

        public int getNumPartitions()
        Description copied from interface: PartitionFunction
        Returns the total number of possible partitions.
        Specified by:
        getNumPartitions in interface PartitionFunction
        Returns:
        Number of possible partitions.