@Override
  public synchronized List<ReplicaId> getPartitionListForDisk(@Nonnull DiskId diskId, @Nonnegative int numberOfReplicasPerDisk) {
    if(!isRunning){
      logger.error("Failed to get partition list for disk {}", diskId);
      throw new StateTransitionException("Failed to get partition list for disk " + diskId, PrioritizationManagerRunningFailure);
    }

    List<ReplicaId> replicaListForDisk = diskToReplicaMap.get(diskId);

    if(replicaListForDisk == null){
      logger.info("No replicas found for disk {}", diskId);
      return null;
    }

    int numberOfReplicasToBeRemoved = Math.min(numberOfReplicasPerDisk, replicaListForDisk.size());
    logger.info("Getting {} replicas for disk {}", numberOfReplicasToBeRemoved, diskId.getMountPath());

    List<ReplicaId> replicasToReturn = new LinkedList<>(replicaListForDisk.subList(0, numberOfReplicasToBeRemoved));

    inProgressReplicas.putIfAbsent(diskId, new ArrayList<>());
    inProgressReplicas.get(diskId).addAll(replicasToReturn);
    replicaListForDisk.subList(0, numberOfReplicasToBeRemoved).clear();

    logger.info("Returning {} replicas for disk {}", numberOfReplicasToBeRemoved, diskId.getMountPath());
    logger.info("Remaining replicas for disk {} are {}", diskId.getMountPath(), replicaListForDisk);

    return replicasToReturn;
  }
The FCFSPrioritizationManager is a First-Come-First-Serve implementation of the PrioritizationManager.
ambry-prioritization/src/main/java/com/github/ambry/replica/prioritization/FCFSPrioritizationManager.java