long getAllocatedRawCapacityInBytes(Datacenter datacenter) {
    long allocatedRawCapacityInBytes = 0;
    for (PartitionId partition : partitionLayout.getPartitions(null)) {
      for (ReplicaId replica : partition.getReplicaIds()) {
        Disk disk = (Disk) replica.getDiskId();
        if (disk.getDataNode().getDatacenter().equals(datacenter)) {
          allocatedRawCapacityInBytes += replica.getCapacityInBytes();
        }
      }
    }
    return allocatedRawCapacityInBytes;
  }
How many data nodes to put in a random sample for partition allocation. 2 node samples provided the best balance
of speed and allocation quality in testing. Larger samples (ie 3 nodes) took longer to generate but did not
improve the quality of the allocated partitions.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/StaticClusterManager.java