@Override
  public JSONObject getSnapshot() {
    JSONObject snapshot = new JSONObject();
    snapshot.put(PARTITION_ID, toPathString());
    snapshot.put(PARTITION_WRITE_STATE, getPartitionState().name());
    snapshot.put(PARTITION_CLASS, getPartitionClass());
    JSONArray replicasJsonArray = new JSONArray();
    getReplicaIds().forEach(replica -> replicasJsonArray.put(replica.getSnapshot()));
    snapshot.put(PARTITION_REPLICAS, replicasJsonArray);
    return snapshot;
  }
Construct name based on Partition ID appropriate for use as a file or directory name.

@return string representation of the Partition's ID for use as part of file system path.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/Partition.java