Class DefaultPartition

    • Method Detail

      • empty

        public static DefaultPartition empty​(int id)
        Returns a new instance that represents an empty partition.
        Parameters:
        id - Partition identifier.
        Returns:
        Empty partition.
      • id

        public int id()
        Description copied from interface: Partition
        Returns the partition identifier.
        Specified by:
        id in interface Partition
        Returns:
        Partition identifier.
      • primaryNode

        public ClusterNode primaryNode()
        Description copied from interface: Partition
        Returns the primary node that is assigned to this partition.
        Specified by:
        primaryNode in interface Partition
        Returns:
        Primary node.
      • backupNodes

        public List<ClusterNode> backupNodes()
        Description copied from interface: Partition
        Returns the backup node set of this partition.
        Specified by:
        backupNodes in interface Partition
        Returns:
        Set of backup nodes or an empty set if there are no backup nodes.
      • nodes

        public List<ClusterNode> nodes()
        Description copied from interface: Partition
        Returns the set of all nodes that are mapped to this partition (including primary and backup).
        Specified by:
        nodes in interface Partition
        Returns:
        The set of all nodes that are mapped to this partition.
      • topology

        public ClusterTopology topology()
        Description copied from interface: Partition
        Returns the cluster topology that this partition is mapped to.
        Specified by:
        topology in interface Partition
        Returns:
        Cluster topology that this partition is mapped to.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object