private void waitMoveTasksToFinish(ExecutorService moveRegionsPool,
    List<Future<Boolean>> taskList, long timeoutInSeconds) throws Exception {
    try {
      if (!moveRegionsPool.awaitTermination(timeoutInSeconds, TimeUnit.SECONDS)) {
        moveRegionsPool.shutdownNow();
      }
    } catch (InterruptedException e) {
      moveRegionsPool.shutdownNow();
      Thread.currentThread().interrupt();
    }
    for (Future<Boolean> future : taskList) {
      try {
        // if even after shutdownNow threads are stuck we wait for 5 secs max
        if (!future.get(5, TimeUnit.SECONDS)) {
          LOG.error("Was Not able to move region....Exiting Now");
          throw new Exception("Could not move region Exception");
        }
      } catch (InterruptedException e) {
        LOG.error("Interrupted while waiting for Thread to Complete " + e.getMessage(), e);
        throw e;
      } catch (ExecutionException e) {
        boolean ignoreFailure = ignoreRegionMoveFailure(e);
        if (ignoreFailure) {
          LOG.debug("Ignore region move failure, it might have been split/merged.", e);
        } else {
          LOG.error("Got Exception From Thread While moving region {}", e.getMessage(), e);
          throw e;
        }
      } catch (CancellationException e) {
        LOG.error("Thread for moving region cancelled. Timeout for cancellation:" + timeoutInSeconds
          + "secs", e);
        throw e;
      }
    }
  }
Isolated regions specified in {@link #isolateRegionIdArray} on {@link #hostname} in ack Mode
and Unload regions from given {@link #hostname} using ack/noAck mode and {@link #maxthreads}.
In noAck mode we do not make sure that region is successfully online on the target region
server,hence it is the best effort. We do not unload regions to hostnames given in
{@link #excludeFile}. If designatedFile is present with some contents, we will unload regions
to hostnames provided in {@link #designatedFile}
@return true if region isolation succeeded, false otherwise
hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionMover.java