public void addNewReplicas(Partition partition, List<Disk> disks) {
    if (partition == null || disks == null || disks.size() == 0) {
      throw new IllegalArgumentException("Partition or disks is null or disks is of zero length");
    }
    for (Disk disk : disks) {
      partition.addReplica(new Replica(partition, disk, hardwareLayout.getClusterMapConfig()));
    }
    validate();
    partitionSelectionHelper.updatePartitions(partitionMap.values(), localDatacenterName);
  }
Adds Partition to and validates Partition is unique. A duplicate Partition results in an exception.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/PartitionLayout.java