Package com.github.ambry.clustermap
Interface ReplicaId
-
- All Superinterfaces:
Resource
public interface ReplicaId extends Resource
A ReplicaId is part of somePartitionId
. The durable state of a ReplicaId is stored in a specific path ("replica path") on a specific device (identified by its "mount path") on aDataNodeId
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getCapacityInBytes()
Gets the capacity in bytes for this ReplicaId.DataNodeId
getDataNodeId()
Gets the DataNodeId that stores this ReplicaId.DiskId
getDiskId()
Gets the DiskId that stores this ReplicaIdjava.lang.String
getMountPath()
Gets the absolute path to the mounted device that stores this ReplicaId.PartitionId
getPartitionId()
Gets the PartitionId of which this ReplicaId is a member.java.util.List<? extends ReplicaId>
getPeerReplicaIds()
Gets list of this ReplicaId's peers.java.lang.String
getReplicaPath()
Gets the absolute path to the directory in which this ReplicaId's files are stored on this DataNodeId.ReplicaType
getReplicaType()
boolean
isDown()
Returns true if the replica is downboolean
isSealed()
void
markDiskDown()
Marks the disk as down if all stores on disk are unavailable.void
markDiskUp()
Marks the disk as up if at least one store on disk is available.-
Methods inherited from interface com.github.ambry.clustermap.Resource
getSnapshot
-
-
-
-
Method Detail
-
getPartitionId
PartitionId getPartitionId()
Gets the PartitionId of which this ReplicaId is a member.- Returns:
- PartitionId of which this ReplicaId is a member.
-
getDataNodeId
DataNodeId getDataNodeId()
Gets the DataNodeId that stores this ReplicaId.- Returns:
- DataNodeId that stores this ReplicaId.
-
getMountPath
java.lang.String getMountPath()
Gets the absolute path to the mounted device that stores this ReplicaId.- Returns:
- absolute mount path.
-
getReplicaPath
java.lang.String getReplicaPath()
Gets the absolute path to the directory in which this ReplicaId's files are stored on this DataNodeId. The replica path is the mount path followed by a unique path for this ReplicaId.- Returns:
- absolute replica path.
-
getPeerReplicaIds
java.util.List<? extends ReplicaId> getPeerReplicaIds()
Gets list of this ReplicaId's peers. The peers of a ReplicaId are the other Replicas with which this replica forms a PartitionId.- Returns:
- list of the peers of this ReplicaId.
-
getCapacityInBytes
long getCapacityInBytes()
Gets the capacity in bytes for this ReplicaId.- Returns:
- the capacity in bytes
-
getDiskId
DiskId getDiskId()
Gets the DiskId that stores this ReplicaId- Returns:
- DiskId that stores this ReplicaId
-
markDiskDown
void markDiskDown()
Marks the disk as down if all stores on disk are unavailable.
-
markDiskUp
void markDiskUp()
Marks the disk as up if at least one store on disk is available.
-
isDown
boolean isDown()
Returns true if the replica is down
-
isSealed
boolean isSealed()
- Returns:
- true if this replica is in sealed state.
-
getReplicaType
ReplicaType getReplicaType()
- Returns:
- the
ReplicaType
for this replica.
-
-