Class AmbryPartition

  • All Implemented Interfaces:
    com.github.ambry.clustermap.PartitionId, com.github.ambry.clustermap.Resource, java.lang.Comparable<com.github.ambry.clustermap.PartitionId>

    public class AmbryPartition
    extends java.lang.Object
    implements com.github.ambry.clustermap.PartitionId
    PartitionId implementation to use within dynamic cluster managers.
    • Method Detail

      • getBytes

        public byte[] getBytes()
        Specified by:
        getBytes in interface com.github.ambry.clustermap.PartitionId
      • getReplicaIds

        public java.util.List<AmbryReplica> getReplicaIds()
        Specified by:
        getReplicaIds in interface com.github.ambry.clustermap.PartitionId
      • getReplicaIdsByState

        public java.util.List<AmbryReplica> getReplicaIdsByState​(com.github.ambry.clustermap.ReplicaState state,
                                                                 java.lang.String dcName)
        Specified by:
        getReplicaIdsByState in interface com.github.ambry.clustermap.PartitionId
      • getPartitionState

        public com.github.ambry.clustermap.PartitionState getPartitionState()
        Specified by:
        getPartitionState in interface com.github.ambry.clustermap.PartitionId
      • isEqual

        public boolean isEqual​(java.lang.String other)
        Specified by:
        isEqual in interface com.github.ambry.clustermap.PartitionId
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface com.github.ambry.clustermap.PartitionId
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(com.github.ambry.clustermap.PartitionId o)
        Specified by:
        compareTo in interface java.lang.Comparable<com.github.ambry.clustermap.PartitionId>
      • toPathString

        public java.lang.String toPathString()
        Construct name based on the id that is appropriate for use as a file or directory name.
        Specified by:
        toPathString in interface com.github.ambry.clustermap.PartitionId
        Returns:
        string representation of the id for use as part of file system path.
      • getPartitionClass

        public java.lang.String getPartitionClass()
        Specified by:
        getPartitionClass in interface com.github.ambry.clustermap.PartitionId
      • getResourceName

        public java.lang.String getResourceName()
        Specified by:
        getResourceName in interface com.github.ambry.clustermap.PartitionId
      • getSnapshot

        public org.json.JSONObject getSnapshot()
        Specified by:
        getSnapshot in interface com.github.ambry.clustermap.Resource