Interface PartitionId

  • All Superinterfaces:
    java.lang.Comparable<PartitionId>, Resource

    public interface PartitionId
    extends Resource, java.lang.Comparable<PartitionId>
    A PartitionId consists of one or more ReplicaIds. A PartitionId is uniquely identified by an ID.
    • Method Detail

      • getBytes

        byte[] getBytes()
        Serializes the ID of this PartitionId to bytes.
        Returns:
        byte-serialized ID of this PartitionId.
      • getReplicaIds

        java.util.List<? extends ReplicaId> getReplicaIds()
        Gets Replicas that comprise this PartitionId.
        Returns:
        list of the Replicas that comprise this PartitionId.
      • getReplicaIdsByState

        java.util.List<? extends ReplicaId> getReplicaIdsByState​(ReplicaState state,
                                                                 java.lang.String dcName)
        Gets Replicas from specified datacenter that are in required state.
        Parameters:
        state - the ReplicaState
        dcName - the name of datacenter from which the replica should come. If null, choose replicas from all datacenters.
        Returns:
        list of Replicas that satisfy requirement.
      • getPartitionState

        PartitionState getPartitionState()
        Gets the state of this PartitionId.
        Returns:
        state of this PartitionId.
      • isEqual

        boolean isEqual​(java.lang.String partitionId)
        Compares the PartitionId to a string representation of another PartitionId
        Parameters:
        partitionId - The string form of the partition that needs to be compared against
        Returns:
        True, if the partitions match, false otherwise
      • toString

        java.lang.String toString()
        Returns a String that uniquely represents the PartitionId.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of the PartitionId.
      • toPathString

        java.lang.String toPathString()
        Returns a strictly numerical String that uniquely represents the PartitionId.
        Returns:
        Strictly numerical string representation of the PartitionId.
      • getPartitionClass

        java.lang.String getPartitionClass()
        Returns:
        the partition class that this partition belongs to
      • getResourceName

        default java.lang.String getResourceName()
        Returns:
        the resource name which this partition belongs to. Can be null if resource is not defined or applicable.