Package com.github.ambry.clustermap
Class AmbryPartition
- java.lang.Object
-
- com.github.ambry.clustermap.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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(com.github.ambry.clustermap.PartitionId o)
boolean
equals(java.lang.Object o)
byte[]
getBytes()
java.lang.String
getPartitionClass()
com.github.ambry.clustermap.PartitionState
getPartitionState()
java.util.List<AmbryReplica>
getReplicaIds()
java.util.List<AmbryReplica>
getReplicaIdsByState(com.github.ambry.clustermap.ReplicaState state, java.lang.String dcName)
java.lang.String
getResourceName()
org.json.JSONObject
getSnapshot()
int
hashCode()
boolean
isEqual(java.lang.String other)
java.lang.String
toPathString()
Construct name based on the id that is appropriate for use as a file or directory name.java.lang.String
toString()
-
-
-
Method Detail
-
getBytes
public byte[] getBytes()
- Specified by:
getBytes
in interfacecom.github.ambry.clustermap.PartitionId
-
getReplicaIds
public java.util.List<AmbryReplica> getReplicaIds()
- Specified by:
getReplicaIds
in interfacecom.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 interfacecom.github.ambry.clustermap.PartitionId
-
getPartitionState
public com.github.ambry.clustermap.PartitionState getPartitionState()
- Specified by:
getPartitionState
in interfacecom.github.ambry.clustermap.PartitionId
-
isEqual
public boolean isEqual(java.lang.String other)
- Specified by:
isEqual
in interfacecom.github.ambry.clustermap.PartitionId
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfacecom.github.ambry.clustermap.PartitionId
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(com.github.ambry.clustermap.PartitionId o)
- Specified by:
compareTo
in interfacejava.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 interfacecom.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 interfacecom.github.ambry.clustermap.PartitionId
-
getResourceName
public java.lang.String getResourceName()
- Specified by:
getResourceName
in interfacecom.github.ambry.clustermap.PartitionId
-
getSnapshot
public org.json.JSONObject getSnapshot()
- Specified by:
getSnapshot
in interfacecom.github.ambry.clustermap.Resource
-
-