JSONObject toJSONObject() throws JSONException {
    JSONObject jsonObject = new JSONObject().put("id", id)
        .put("partitionClass", partitionClass)
        .put("partitionState", partitionState.name())
        .put("replicaCapacityInBytes", replicaCapacityInBytes)
        .put("replicas", new JSONArray());
    for (ReplicaId replica : replicas) {
      jsonObject.accumulate("replicas", ((Replica) replica).toJSONObject());
    }
    return jsonObject;
  }
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