public static void dirCheck() {

    List<Future<Void>> futureList = new ArrayList<>();
    ExecutorService executorService = Executors.newFixedThreadPool(CONCURRENCY);
    File dir = new File(DIR);
    for (File file : Objects.requireNonNull(dir.listFiles())) {
      if (file.getName().startsWith("dump") && file.getName().endsWith(".csv")) {
        Future<Void> future = executorService.submit(new CheckThread(file));
        futureList.add(future);
      }
    }
    try {
      for (Future<Void> future : futureList) {
        future.get();
      }
    } catch (InterruptedException | ExecutionException e) {
      LOGGER.error("Error when checking paths.");
      Thread.currentThread().interrupt();
    }
    executorService.shutdown();
  }
Using multiple threads to check the paths in the files of the directory. the files are created
by export-csv.sh/export-csv.bat.
example/schema/src/main/java/org/apache/iotdb/schema/PathCheckExample.java