code: private static ThreadPoolExecutor createChunkDownloaderExecutorService(
        final String threadNamePrefix, final int parallel)
    {
      ThreadFactory threadFactory = new ThreadFactory()
      {
        private int threadCount = 1;
  
        public Thread newThread(final Runnable r)
        {
          final Thread thread = new Thread(r);
          thread.setName(threadNamePrefix + threadCount++);
  
          thread.setUncaughtExceptionHandler(
              new Thread.UncaughtExceptionHandler()
              {
                public void uncaughtException(Thread t, Throwable e)
                {
                  logger.error(
                      "uncaughtException in thread: " + t + " {}",
                      e);
                }
              });
  
          thread.setDaemon(true);
  
          return thread;
        }
      };
      return (ThreadPoolExecutor) Executors.newFixedThreadPool(parallel,
                                                               threadFactory);
    }
docs: Create a pool of downloader threads.
  
  @param threadNamePrefix name of threads in pool
  @param parallel         number of thread in pool
  @return new thread pool