protected List<ReplicaId> getEligibleReplicas(String dcName, EnumSet<ReplicaState> states) {
    Map<ReplicaState, List<ReplicaId>> replicasByState = getReplicasByState(dcName, states);
    List<ReplicaId> eligibleReplicas = new ArrayList<>();
    for (List<ReplicaId> replicas : replicasByState.values()) {
      eligibleReplicas.addAll(replicas);
    }
    return eligibleReplicas;
  }
Get eligible replicas by states for the specified data center. If dcName is null, it gets all eligible
replicas from all data centers.
@param dcName the name of data center from which the replicas should come from. This can be {@code null}.
@param states a set of {@link ReplicaState}(s) that replicas should match.
@return a list of eligible replicas that are in specified states.
ambry-router/src/main/java/com/github/ambry/router/SimpleOperationTracker.java