@Override
  public JSONObject getSnapshot() {
    JSONObject snapshot = new JSONObject();
    DataNodeId dataNodeId = getDataNodeId();
    snapshot.put(REPLICA_NODE, dataNodeId.getHostname() + ":" + dataNodeId.getPort());
    snapshot.put(REPLICA_PARTITION, getPartitionId().toPathString());
    snapshot.put(REPLICA_DISK, getDiskId().getMountPath());
    snapshot.put(REPLICA_PATH, getReplicaPath());
    snapshot.put(CAPACITY_BYTES, getCapacityInBytes());
    snapshot.put(REPLICA_WRITE_STATE,
        ClusterMapUtils.convertPartitionStateToReplicaSealSatus(partition.partitionState));
    String replicaLiveness = UP;
    if (dataNodeId.getState() == HardwareState.UNAVAILABLE) {
      replicaLiveness = NODE_DOWN;
    } else if (disk.getState() == HardwareState.UNAVAILABLE) {
      replicaLiveness = DISK_DOWN;
    } else if (resourceStatePolicy.isDown()) {
      replicaLiveness = SOFT_DOWN;
    } else if (isStopped) {
      replicaLiveness = REPLICA_STOPPED;
    }
    snapshot.put(LIVENESS, replicaLiveness);
    return snapshot;
  }
An implementation of {@link ReplicaId} to be used within the {@link StaticClusterManager}.

A Replica is one constituent piece of a {@link Partition}. A Replica is uniquely identifiable by its Partition and
its {@link Disk}. Note that this induces a constraint that a Partition can never have more than one Replica on a
given Disk. This ensures that a Partition does not have Replicas that share fates.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/Replica.java