adoroszlai commented on code in PR #5407:
URL: https://github.com/apache/ozone/pull/5407#discussion_r1361626237


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashPolicyOzone.java:
##########
@@ -284,13 +285,14 @@ protected class Emptier implements Runnable {
           + " minutes, Emptier interval = "
           + (this.emptierInterval / MSECS_PER_MINUTE) + " minutes.");
       executor = new ThreadPoolExecutor(trashEmptierCorePoolSize,
-          trashEmptierCorePoolSize, 1,
-          TimeUnit.SECONDS, new ArrayBlockingQueue<>(1024),
+          trashEmptierCorePoolSize, 1, TimeUnit.SECONDS,
+          new ArrayBlockingQueue<>(1024), new ThreadFactory() {
+            @Override
+            public Thread newThread(Runnable r) {
+              return new Thread(r, threadNamePrefix + "TrashEmptier");
+            }
+          },

Review Comment:
   Let's use `ThreadFactoryBuilder` to simplify the code:
   
   `new ThreadFactoryBuilder().setNameFormat(...).build()`
   
   Also, please append `-%d` to the end of the thread name format, since this 
is a pool with multiple threads.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to