@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());
    snapshot.put(PARTITION_RESOURCE_NAMES, getResourceNames());
    JSONArray replicas = new JSONArray();
    getReplicaIds().forEach(replica -> replicas.put(replica.getSnapshot()));
    snapshot.put(PARTITION_REPLICAS, replicas);
    return snapshot;
  }
Construct name based on the id that is appropriate for use as a file or directory name.
@return string representation of the id for use as part of file system path.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/AmbryPartition.java