private void addReplicasToPartition(AmbryPartition partition, List<AmbryReplica> replicas) {
    AmbryPartition currentPartition = addPartitionIfAbsent(partition, replicas.get(0).getCapacityInBytes());
    ambryPartitionToAmbryReplicas.compute(currentPartition, (k, v) -> {
      // calling addPartitionIfAbsent guarantees that v is not null
      v.addAll(replicas);
      return v;
    });
    clusterWideAllocatedRawCapacityBytes.getAndAdd(replicas.get(0).getCapacityInBytes() * replicas.size());
  }
Add a list of {@link AmbryReplica} to given {@link AmbryPartition} and update cluster-wide capacity stats
@param partition the {@link AmbryPartition} which replicas should be added to.
@param replicas list of {@link AmbryReplica} to be added.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixClusterManager.java