Class PartitionMetadata

java.lang.Object
io.atomix.primitive.partition.PartitionMetadata

public class PartitionMetadata extends Object
Contains metadata about a partition. The metadata can be used to query for members of the partition and to get member priorities.
  • Constructor Details

  • Method Details

    • id

      public PartitionId id()
      Returns the partition identifier.
      Returns:
      partition identifier
    • members

      public Collection<MemberId> members()
      Returns the controller nodes that are members of this partition.
      Returns:
      collection of controller node identifiers
    • getPriority

      public int getPriority(MemberId member)
      Return the priority of the node if the node is a member of the replication group for this partition. Otherwise return -1.
      Returns:
      the priority of the member
    • getPrimary

      public Optional<MemberId> getPrimary()
      Returns the primary member of the partition or null if there is no primary
      Returns:
      member id or null
    • getTargetPriority

      public int getTargetPriority()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object