Package org.apache.drill.exec.rpc
Class NamedThreadFactory
java.lang.Object
org.apache.drill.exec.rpc.NamedThreadFactory
- All Implemented Interfaces:
ThreadFactory
ThreadFactory
for ExecutorService
s that names threads sequentially.
Creates Threads named with the prefix specified at construction time. Created threads
have the daemon bit set and priority Thread.MAX_PRIORITY.
An instance creates names with an instance-specific prefix suffixed with sequential integers.
Concurrency: See newThread(java.lang.Runnable)
.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
NamedThreadFactory
Constructor.- Parameters:
prefix
- the string prefix that will be used to name threads created by this factory
-
-
Method Details
-
newThread
Creates a sequentially named thread running a given Runnable.The thread's name will be this instance's prefix concatenated with this instance's next* sequential integer.
Concurrency: Thread-safe.
(Concurrent calls get different numbers. Calls started after other calls complete get later/higher numbers than those other calls.
*However, for concurrent calls, the order of numbers is not defined.)
- Specified by:
newThread
in interfaceThreadFactory
-