public JSONObject toJSONObject() throws JSONException {
    JSONObject jsonObject = new JSONObject().put("clusterName", hardwareLayout.getClusterName())
        .put("version", version)
        .put("partitions", new JSONArray());
    for (Partition partition : partitionMap.values()) {
      jsonObject.accumulate("partitions", partition.toJSONObject());
    }
    return jsonObject;
  }
Gets Partition with specified byte-serialized ID.

@param stream byte-serialized partition ID
@return requested Partition else null.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/PartitionLayout.java