Package alluxio.util
Class ThreadFactoryUtils
- java.lang.Object
-
- alluxio.util.ThreadFactoryUtils
-
@ThreadSafe public final class ThreadFactoryUtils extends java.lang.Object
Utility methods for theThreadFactory
class.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.concurrent.ThreadFactory
build(java.lang.String nameFormat, boolean isDaemon)
Creates aThreadFactory
that spawns off threads.static ForkJoinPool.ForkJoinWorkerThreadFactory
buildFjp(java.lang.String nameFormat, boolean isDaemon)
Creates aForkJoinPool.ForkJoinWorkerThreadFactory
that spawns off threads forForkJoinPool
.
-
-
-
Method Detail
-
build
public static java.util.concurrent.ThreadFactory build(java.lang.String nameFormat, boolean isDaemon)
Creates aThreadFactory
that spawns off threads.- Parameters:
nameFormat
- name pattern for each thread. should contain '%d' to distinguish between threads.isDaemon
- if true, theThreadFactory
will create daemon threads.- Returns:
- the created factory
-
buildFjp
public static ForkJoinPool.ForkJoinWorkerThreadFactory buildFjp(java.lang.String nameFormat, boolean isDaemon)
Creates aForkJoinPool.ForkJoinWorkerThreadFactory
that spawns off threads forForkJoinPool
.- Parameters:
nameFormat
- name pattern for each thread. should contain '%d' to distinguish between threads.isDaemon
- if true, theThreadFactory
will create daemon threads.- Returns:
- the created factory
-
-