private void loadRegions(List<RegionInfo> regionsToMove) throws Exception {
    ServerName server = getTargetServer();
    List<RegionInfo> movedRegions = Collections.synchronizedList(new ArrayList<>());
    LOG.info("Moving " + regionsToMove.size() + " regions to " + server + " using "
      + this.maxthreads + " threads.Ack mode:" + this.ack);

    final ExecutorService moveRegionsPool = Executors.newFixedThreadPool(this.maxthreads);
    List<Future<Boolean>> taskList = new ArrayList<>();
    int counter = 0;
    while (counter < regionsToMove.size()) {
      RegionInfo region = regionsToMove.get(counter);
      ServerName currentServer = MoveWithAck.getServerNameForRegion(region, admin, conn);
      if (currentServer == null) {
        LOG
          .warn("Could not get server for Region:" + region.getRegionNameAsString() + " moving on");
        counter++;
        continue;
      } else if (server.equals(currentServer)) {
        LOG.info(
          "Region " + region.getRegionNameAsString() + " is already on target server=" + server);
        counter++;
        continue;
      }
      if (ack) {
        Future<Boolean> task = moveRegionsPool
          .submit(new MoveWithAck(conn, region, currentServer, server, movedRegions));
        taskList.add(task);
      } else {
        Future<Boolean> task = moveRegionsPool
          .submit(new MoveWithoutAck(admin, region, currentServer, server, movedRegions));
        taskList.add(task);
      }
      counter++;
    }

    moveRegionsPool.shutdown();
    long timeoutInSeconds = regionsToMove.size()
      * admin.getConfiguration().getLong(MOVE_WAIT_MAX_KEY, DEFAULT_MOVE_WAIT_MAX);
    waitMoveTasksToFinish(moveRegionsPool, taskList, timeoutInSeconds);
  }
Loads the specified {@link #hostname} with regions listed in the {@link #filename} RegionMover
Object has to be created using {@link #RegionMover(RegionMoverBuilder)}
@return true if loading succeeded, false otherwise
hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionMover.java