Interface Partition

    • Method Detail

      • id

        int id()
        Returns the partition identifier.
        Returns:
        Partition identifier.
      • primaryNode

        ClusterNode primaryNode()
        Returns the primary node that is assigned to this partition.
        Returns:
        Primary node.
      • backupNodes

        List<ClusterNode> backupNodes()
        Returns the backup node set of this partition.
        Returns:
        Set of backup nodes or an empty set if there are no backup nodes.
      • nodes

        List<ClusterNode> nodes()
        Returns the set of all nodes that are mapped to this partition (including primary and backup).
        Returns:
        The set of all nodes that are mapped to this partition.
      • topology

        ClusterTopology topology()
        Returns the cluster topology that this partition is mapped to.
        Returns:
        Cluster topology that this partition is mapped to.
      • isPrimary

        default boolean isPrimary​(ClusterNodeId node)
        Returns true if the specified node is primary for this partition (see primaryNode()).
        Parameters:
        node - Node identifier.
        Returns:
        true if the specified node is primary for this partition (see primaryNode()).
      • isPrimary

        default boolean isPrimary​(ClusterNode node)
        Returns true if the specified node is primary for this partition (see primaryNode()).
        Parameters:
        node - Node.
        Returns:
        true if the specified node is primary for this partition (see primaryNode()).
      • hasBackupNodes

        default boolean hasBackupNodes()
        Returns true if this partition has backupNodes().
        Returns:
        true if this partition has backupNodes().
      • compareTo

        default int compareTo​(Partition o)
        Compares this partition with the specified one based on id() value.
        Specified by:
        compareTo in interface Comparable<Partition>
        Parameters:
        o - Other partition.
        Returns:
        Result of id() values comparison.