public static void processPathsForMmRead(List<Path> dirs, Configuration conf,
      ValidWriteIdList validWriteIdList, List<Path> finalPaths,
      List<Path> pathsWithFileOriginals) throws IOException {
    if (validWriteIdList == null) {
      finalPaths.addAll(dirs);
      return;
    }
    boolean allowOriginals = HiveConf.getBoolVar(conf, ConfVars.HIVE_MM_ALLOW_ORIGINALS);

    int numThreads = min(HiveConf.getIntVar(conf, ConfVars.HIVE_COMPUTE_SPLITS_NUM_THREADS), dirs.size());
    List<Future<Void>> pathFutures = new ArrayList<>();
    ExecutorService pool = null;
    if (numThreads > 1) {
      pool = Executors.newFixedThreadPool(numThreads,
              new ThreadFactoryBuilder().setDaemon(true).setNameFormat("MM-Split-Paths-%d").build());
    }

    try {
      for (Path dir : dirs) {
        if (pool != null) {
          Future<Void> pathFuture = pool.submit(() -> {
            processForWriteIdsForMmRead(dir, conf, validWriteIdList, allowOriginals, finalPaths, pathsWithFileOriginals);
            return null;
          });
          pathFutures.add(pathFuture);
        } else {
          processForWriteIdsForMmRead(dir, conf, validWriteIdList, allowOriginals, finalPaths, pathsWithFileOriginals);
        }
      }
      try {
        for (Future<Void> pathFuture : pathFutures) {
          pathFuture.get();
        }
      } catch (InterruptedException | ExecutionException e) {
        for (Future<Void> future : pathFutures) {
          future.cancel(true);
        }
        throw new IOException(e);
      }
    } finally {
      if (pool != null) {
        pool.shutdown();
      }
    }
  }
NOTE: this no longer wraps the IF for LLAP. Call wrapForLlap manually if needed.
ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java