public void removePartition(Partition partition) {
    if (partitionMap.remove(ByteBuffer.wrap(partition.getBytes())) != null) {
      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