drcrallen commented on a change in pull request #5913: Move Caching Cluster 
Client to java streams and allow parallel intermediate merges
URL: https://github.com/apache/incubator-druid/pull/5913#discussion_r207963015
 
 

 ##########
 File path: 
java-util/src/main/java/io/druid/java/util/common/concurrent/Execs.java
 ##########
 @@ -147,4 +151,32 @@ public void rejectedExecution(Runnable r, 
ThreadPoolExecutor executor)
         }
     );
   }
+
+  private static final AtomicLong fjpWorkerThreadCount = new AtomicLong(0L);
+
+  public static ForkJoinWorkerThread makeWorkerThread(String name, 
ForkJoinPool pool)
+  {
+    final ForkJoinWorkerThread t = new ForkJoinWorkerThread(pool)
+    {
+      // No special handling in subclass
+    };
+    t.setDaemon(true);
+    final long threadNumber = fjpWorkerThreadCount.incrementAndGet();
+    t.setName(StringUtils.nonStrictFormat(name, threadNumber));
 
 Review comment:
   There is no guarantees that `checkThreadNameFormat` must be called first.
   
   Since the thread factories are called from some potentially asynchronous 
mechanism, I figure having the safest possible naming enforcement here is the 
most defensive

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to