public static ExecutorService newThreadPool(Object owner, int coreThreads, int maxThreads, int maxRequests,
            long keepAliveTimeoutMs, boolean allowCoreThreadTimeout) {
        final BlockingQueue<Runnable> queue;
        if (coreThreads < MIN_CORE_THREADS) {
            coreThreads = MIN_CORE_THREADS;
        }
        if (maxRequests > 0) {
            queue = new ArrayBlockingQueue<>(maxRequests);
            if (maxThreads <= coreThreads) {
                maxThreads = coreThreads * 2;
            }
        } else {
            queue = new LinkedBlockingQueue<>();
            if (maxThreads != coreThreads) {
                maxThreads = coreThreads;
            }
        }
        if (keepAliveTimeoutMs <= 0L) {
            keepAliveTimeoutMs = allowCoreThreadTimeout ? 1000L : 0L;
        }

        ThreadPoolExecutor pool = new ThreadPoolExecutor(coreThreads, maxThreads, keepAliveTimeoutMs,
                TimeUnit.MILLISECONDS, queue, new ClickHouseThreadFactory(owner), new ThreadPoolExecutor.AbortPolicy());
        if (allowCoreThreadTimeout) {
            pool.allowCoreThreadTimeOut(true);
        }
        return pool;
    }
Finds files according to the given pattern and path.

@param pattern non-empty pattern may or may have syntax prefix as in
               {@link java.nio.file.FileSystem#getPathMatcher(String)},
               defaults to {@code glob} syntax
@param paths   path to search, defaults to current work directory
@return non-null list of normalized absolute paths matching the pattern
@throws IOException when failed to find files
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseUtils.java