@Override
            public Thread newThread(Runnable r) {
                String threadName;
                if (pattern.contains("%d")) {
                    threadName = String.format(pattern, threadEpoch.addAndGet(1));
                } else {
                    threadName = pattern;
                }
                FastThreadLocalThread thread = new FastThreadLocalThread(r, threadName);
                thread.setDaemon(daemon);
                return thread;
            }
Create a new ThreadFactory.

@param pattern The pattern to use.  If this contains %d, it will be
               replaced with a thread number.  It should not contain more
               than one %d.
@param daemon  True if we want daemon threads.
@return The new ThreadFactory.
s3stream/src/main/java/com/automq/stream/utils/ThreadUtils.java