@Override
  public Map<TConsensusGroupId, TRegionReplicaSet> generateOptimalRoutePriority(
      List<TRegionReplicaSet> replicaSets, Map<TConsensusGroupId, Integer> regionLeaderMap) {

    Map<TConsensusGroupId, TRegionReplicaSet> regionPriorityMap = new TreeMap<>();

    replicaSets.forEach(
        replicaSet -> {
          regionPriorityMap.put(replicaSet.getRegionId(), replicaSet);
        });

    return regionPriorityMap;
  }
The GreedyPriorityBalancer always pick the Replica with the lowest loadScore
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/router/priority/GreedyPriorityBalancer.java