@Override
  public JSONObject getSnapshot() {
    JSONObject snapshot = new JSONObject();
    snapshot.put(REPLICA_NODE, dataNodeId.getHostname() + ":" + dataNodeId.getPort());
    snapshot.put(REPLICA_PARTITION, partitionId.toPathString());
    if (diskId != null) {
      snapshot.put(REPLICA_DISK, diskId.getMountPath());
    }
    snapshot.put(REPLICA_PATH, replicaPath);
    snapshot.put(REPLICA_WRITE_STATE, ClusterMapUtils.convertReplicaSealStatusToPartitionState(replicaSealStatus));
    String liveness = UP;
    if (isMarkedDown) {
      liveness = DOWN;
    } else if (getDataNodeId().getState() == HardwareState.UNAVAILABLE) {
      liveness = NODE_DOWN;
    } else if (getDiskId() != null && getDiskId().getState() == HardwareState.UNAVAILABLE) {
      liveness = DISK_DOWN;
    }
    snapshot.put(LIVENESS, liveness);
    return snapshot;
  }
@return true if the replica is down; false otherwise.
ambry-test-utils/src/main/java/com/github/ambry/clustermap/MockReplicaId.java