private void startHighPriorityReplication(Set<PartitionId> highPriorityPartitions) {
    try {
      // Initialize the set of replicating partitions with the high-priority ones
      currentlyReplicatingPriorityPartitions.clear();
      currentlyReplicatingPriorityPartitions.addAll(highPriorityPartitions);

      replicationPrioritizationMetrics.updateCurrentlyReplicatingPriorityPartitions(currentlyReplicatingPriorityPartitions);
      replicationPrioritizationMetrics.recordPartitionsAddedToHighPriority(highPriorityPartitions);


      // Ensure we have at least the minimum batch size
      if (currentlyReplicatingPriorityPartitions.size() < minBatchSizeForHighPriorityPartitions) {
        addNewPartitions();
      }

      // Apply the replication priorities
      controlReplicationThreads();

      // Update state
      isHighPriorityReplicationRunning.set(true);
      lastReplicationActivityMs = time.milliseconds();

      logger.info("Started high-priority replication for {} partitions", currentlyReplicatingPriorityPartitions.size());
    } catch (Exception e) {
      logger.error("Error starting high-priority replication", e);
    }
  }
Starts high priority replication for the given partitions.
@param highPriorityPartitions The set of partitions that should be prioritized.
ambry-prioritization/src/main/java/com/github/ambry/replica/prioritization/ReplicationPrioritizationManager.java