private ForkJoinPool.ForkJoinWorkerThreadFactory createNamedFactory(String name) {
    return pool -> {
      ForkJoinWorkerThread worker = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool);
      worker.setName(name + "-" + worker.getPoolIndex());
      return worker;
    };
  }
Determines the need of waiting for all tasks to be processed:
true - next task would be processed
false - next task would be cancelled
@param <T>
ambari-server/src/main/java/org/apache/ambari/server/utils/ThreadPools.java