public void runPrioritizationCycle() {
    try {
      //TODO - Take lock on disk level for improved add/remove performance and add notify based timer to shutdown
      lock.lock();
      diskIdToReplicaQueue.keySet().forEach(diskId -> {
        LinkedHashSet<ReplicaId> replicaIds = diskIdToReplicaQueue.get(diskId);
        if (replicaIds.isEmpty()) {
          return;
        }
        logger.trace("current queue at starting cycle disk {} is {}", diskId, replicaIds);
        Map<PartitionId, ReplicaId> partitionIdReplicaIdMap = new HashMap<>();
        replicaIds.forEach(replicaId -> {
          partitionIdReplicaIdMap.put(replicaId.getPartitionId(), replicaId);
        });
        List<PartitionId> partitionIds =
            replicaIds.stream().map(ReplicaId::getPartitionId).collect(Collectors.toList());
        logger.trace("at starting partition ids are for disk {} are {}", diskId, partitionIds);

        Set<PartitionId> belowMinActivePartitionIds =
            new HashSet<>(filterBelowMinActiveReplicas(new ArrayList<>(partitionIds)));
        Set<PartitionId> equalsMinActivePartitionIds =
            new HashSet<>(filterEqualsMinActiveReplicas(new ArrayList<>(partitionIds)));
        List<PartitionId> partitionIdsByDisruption = disruptionService.sortByDisruptions(new ArrayList<>(partitionIds));

        logger.trace("below min active partition ids disk {} partition {}", diskId, belowMinActivePartitionIds);
        logger.trace("below equals active partition ids disk {} partition {}", diskId, equalsMinActivePartitionIds);
        logger.trace("partition ids by disruption for disk {} partition {}", diskId, partitionIdsByDisruption);

        LinkedHashSet<PartitionId> belowMinActivePartitionIdsByDisruption = new LinkedHashSet<>();
        LinkedHashSet<PartitionId> equalsMinActivePartitionIdsByDisruption = new LinkedHashSet<>();

        partitionIdsByDisruption.forEach(partitionId -> {
          if (belowMinActivePartitionIds.contains(partitionId)) {
            belowMinActivePartitionIdsByDisruption.add(partitionId);
          }
          if (equalsMinActivePartitionIds.contains(partitionId)) {
            equalsMinActivePartitionIdsByDisruption.add(partitionId);
          }
        });

        LinkedHashSet<PartitionId> partitionIdSet = new LinkedHashSet<>();
        partitionIdSet.addAll(belowMinActivePartitionIdsByDisruption);
        partitionIdSet.addAll(equalsMinActivePartitionIdsByDisruption);
        partitionIdSet.addAll(partitionIdsByDisruption);
        partitionIdSet.addAll(partitionIds);

        logger.trace("all partition ids at end are for disk {} partition {}", diskId, partitionIds);
        logger.trace("below min partition sorted are for disk {} partition {}", diskId,
            belowMinActivePartitionIdsByDisruption);
        logger.trace("equals min partition sorted are for disk {} partiton {}", diskId, equalsMinActivePartitionIds);
        logger.trace("all partition ids sorted are for disk {} partition {}", diskId, partitionIdSet);

        LinkedHashSet<ReplicaId> sortedReplicas = new LinkedHashSet<>();
        partitionIdSet.forEach(partitionId -> {
          sortedReplicas.add(partitionIdReplicaIdMap.get(partitionId));
        });
        logger.trace("current queue for disk {} is {}", diskId, sortedReplicas);

        LinkedHashSet<ReplicaId> prevReplicas = diskIdToReplicaQueue.get(diskId);
        logIfQueueChanged(diskId, prevReplicas, sortedReplicas);
        diskIdToReplicaQueue.put(diskId, sortedReplicas);
      });
    } finally {
      lock.unlock();
    }
  }
This always keeps running
For each disk's pending queue, it calculates belowMinActiveReplicas
then sorts these by disruption priority and adds to the result, and then it calculates equalMinActiveReplicas
then sorts these by disruption priority, and adds these to result next, and it then
sorts remaining replicas by disruption priority and adds these result
Then the current pending queue is replaced by the result
ambry-prioritization/src/main/java/com/github/ambry/replica/prioritization/FileCopyDisruptionBasedPrioritizationManager.java