public void waitForPriorityUpdate(List<TConsensusGroupId> regionGroupIds) {
    long startTime = System.currentTimeMillis();
    LOGGER.info(
        "[RegionPriority] Wait for Region priority update of RegionGroups: {}", regionGroupIds);
    while (System.currentTimeMillis() - startTime <= REGION_PRIORITY_WAITING_TIMEOUT) {
      AtomicBoolean allRegionPriorityCalculated = new AtomicBoolean(true);
      priorityMapLock.readLock().lock();
      try {
        regionGroupIds.forEach(
            regionGroupId -> {
              if (!regionPriorityMap.containsKey(regionGroupId)) {
                allRegionPriorityCalculated.set(false);
              }
            });
      } finally {
        priorityMapLock.readLock().unlock();
      }
      if (allRegionPriorityCalculated.get()) {
        LOGGER.info(
            "[RegionPriority] The routing priority of RegionGroups: {} is calculated.",
            regionGroupIds);
        return;
      }
      try {
        TimeUnit.MILLISECONDS.sleep(WAIT_PRIORITY_INTERVAL);
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        LOGGER.warn("Interrupt when wait for calculating Region priority", e);
        return;
      }
    }

    LOGGER.warn(
        "[RegionPriority] The routing priority of RegionGroups: {} is not determined after 10 heartbeat interval. Some function might fail.",
        regionGroupIds);
  }
Wait for the specified RegionGroups to finish routing priority calculation.

@param regionGroupIds Specified RegionGroupIds
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RouteBalancer.java