int calculateLocalReplicaCount(PartitionId partition) {
    Set<ReplicaState> states = new HashSet<>(Arrays.asList(ReplicaState.LEADER, ReplicaState.STANDBY));
    Map<ReplicaState, List<AmbryReplica>> localDCReplicas =
        (Map<ReplicaState, List<AmbryReplica>>) partition.getReplicaIdsByStates(states, datacenterName);
    return localDCReplicas.values().stream().mapToInt(List::size).sum();
  }
Removes the replicas from in progress and pending queue
@param diskId the {@link DiskId} that the replicas are on.
@param replicaId the {@link ReplicaId} to remove.
@return true if replica was removed, false otherwise
ambry-prioritization/src/main/java/com/github/ambry/replica/prioritization/FileCopyDisruptionBasedPrioritizationManager.java