@Override
    public void onReplicaAddedOrRemoved(List<ReplicaId> addedReplicas, List<ReplicaId> removedReplicas) {
      // For now, the simplest and safest way is to re-populate "partitionIdsByClassAndLocalReplicaCount" and
      // "partitionIdToLocalReplicas" maps. Since cluster expansion and replica movement should be infrequent, we should
      // be fine with the overhead of re-populating these two maps.
      // No matter whether this method is called by local dc's or remote dcs' cluster change handler, we need to populate
      // "allPartitions" again because there may be some new partitions with special class added to remote dc only.
      generatePartitionMapsAndSwitch(addedReplicas, removedReplicas);
    }
Returns the partitions belonging to the {@code partitionClass}. Returns all partitions if {@code partitionClass}
is {@code null}.
@param partitionClass the class of the partitions desired.
@param minimumReplicaCountRequired if {@code true}, returns only the partitions with the number of replicas in
                                   local datacenter that is larger than or equal to minimum required count.
@return the partitions belonging to the {@code partitionClass}. Returns all partitions if {@code partitionClass}
is {@code null}.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/ClusterMapUtils.java