private static void shutdownAndCleanup(ExecutorService pool,
      List<Future<Void>> futures) throws HiveException {
    if (pool == null) {
      return;
    }
    pool.shutdown();

    futures = (futures != null) ? futures : Collections.emptyList();
    for (Future<Void> future : futures) {
      try {
        future.get();
      } catch (InterruptedException | ExecutionException e) {
        LOG.error("Error in moving files to destination", e);
        cancelTasks(futures);
        throw new HiveException(e);
      }
    }
  }
Moves files from src to dst if it is within the specified set of paths
@param fs
@param src
@param dst
@param filesToMove
@param futures List of futures
@param pool thread pool
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java