@Override
  public JSONObject getSnapshot() {
    JSONObject snapshot = new JSONObject();
    snapshot.put(IMPLEMENTATION, StaticClusterManager.class.getName());
    snapshot.put(CLUSTER_NAME, partitionLayout.getClusterName());
    snapshot.put(TIMESTAMP_MS, SystemTime.getInstance().milliseconds());
    JSONArray datacentersJsonArray = new JSONArray();
    hardwareLayout.getDatacenters().forEach(dc -> {
      JSONObject data = new JSONObject();
      data.put(DATACENTER_NAME, dc.getName());
      data.put(DATACENTER_ID, dc.getId());
      JSONArray datanodesInDc = new JSONArray();
      dc.getDataNodes().forEach(node -> datanodesInDc.put(node.getSnapshot()));
      data.put(DATACENTER_NODES, datanodesInDc);
      datacentersJsonArray.put(data);
    });
    snapshot.put(DATACENTERS, datacentersJsonArray);
    JSONArray partitionsJsonArray = new JSONArray();
    getAllPartitionIds(null).forEach(partitionId -> partitionsJsonArray.put(partitionId.getSnapshot()));
    snapshot.put(PARTITIONS, partitionsJsonArray);
    return snapshot;
  }
Add a set of replicas on a new datacenter for an existing partition.

@param partitionId The partition to add to the new datacenter
@param dataCenterName The name of the new datacenter
@param attemptNonRackAwareOnFailure {@code true} if a non rack-aware allocation should be attempted if a rack-aware one
                           is not possible.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/StaticClusterManager.java