DataNode getDataNodeWithMostUnallocatedRawCapacity(Datacenter dc, Set nodesToExclude) {
    DataNode maxCapacityNode = null;
    List<DataNode> dataNodes = dc.getDataNodes();
    for (DataNode dataNode : dataNodes) {
      if (!nodesToExclude.contains(dataNode) && (maxCapacityNode == null
          || getUnallocatedRawCapacityInBytes(dataNode) > getUnallocatedRawCapacityInBytes(maxCapacityNode))) {
        maxCapacityNode = dataNode;
      }
    }
    return maxCapacityNode;
  }
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