Class PartitionInstanceInfo

  • All Implemented Interfaces:
    Serializable

    public final class PartitionInstanceInfo
    extends Object
    implements Serializable
    Information pertaining to an instance of a partitioning operation. Captures the total partition count and the identifier of the current partition (holder of and object of this class). The partition identifier is a zero-based, one-up number used to uniquely identify each partition within a partition set.
    See Also:
    Serialized Form
    • Field Detail

      • MASTER

        public static final PartitionInstanceInfo MASTER
        Partition info for a master node. Partition id is always zero and partitionCount is always one because only workers are parallelizable.
    • Constructor Detail

      • PartitionInstanceInfo

        public PartitionInstanceInfo​(NodeAllocationState.AssignmentState assignment,
                                     int partitionCount)
        Construct with given count and ID.
        Parameters:
        partitionCount - total partition count
        partitionID - current partition ID
    • Method Detail

      • getPartitionCount

        public int getPartitionCount()
        Get the partition count.
        Returns:
        partition count
      • getPartitionID

        public int getPartitionID()
        Get the partition ID.
        Returns:
        partition ID
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object