Package alluxio.concurrent.jsr
Class ForkJoinPool.AlluxioForkJoinWorkerThreadFactory
- java.lang.Object
-
- alluxio.concurrent.jsr.ForkJoinPool.AlluxioForkJoinWorkerThreadFactory
-
- All Implemented Interfaces:
ForkJoinPool.ForkJoinWorkerThreadFactory
- Enclosing class:
- ForkJoinPool
public static final class ForkJoinPool.AlluxioForkJoinWorkerThreadFactory extends java.lang.Object implements ForkJoinPool.ForkJoinWorkerThreadFactory
Default ForkJoinWorkerThreadFactory implementation; creates a new ForkJoinWorkerThread using the system class loader as the thread context class loader.
-
-
Constructor Summary
Constructors Constructor Description AlluxioForkJoinWorkerThreadFactory(java.lang.String threadNameFormat, boolean isDaemon)
Creates a new thread-factory forForkJoinPool
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ForkJoinWorkerThread
newThread(ForkJoinPool pool)
Returns a new worker thread operating in the given pool.
-
-
-
Constructor Detail
-
AlluxioForkJoinWorkerThreadFactory
public AlluxioForkJoinWorkerThreadFactory(java.lang.String threadNameFormat, boolean isDaemon)
Creates a new thread-factory forForkJoinPool
.- Parameters:
threadNameFormat
- thread name formatisDaemon
- is daemon
-
-
Method Detail
-
newThread
public final ForkJoinWorkerThread newThread(ForkJoinPool pool)
Description copied from interface:ForkJoinPool.ForkJoinWorkerThreadFactory
Returns a new worker thread operating in the given pool. Returning null or throwing an exception may result in tasks never being executed. If this method throws an exception, it is relayed to the caller of the method (for exampleexecute
) causing attempted thread creation. If this method returns null or throws an exception, it is not retried until the next attempted creation (for example another call toexecute
).- Specified by:
newThread
in interfaceForkJoinPool.ForkJoinWorkerThreadFactory
- Parameters:
pool
- the pool this thread works in- Returns:
- the new worker thread, or
null
if the request to create a thread is rejected
-
-