shoothzj commented on code in PR #4393:
URL: https://github.com/apache/bookkeeper/pull/4393#discussion_r1615473653


##########
bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedExecutor.java:
##########
@@ -391,9 +391,9 @@ protected OrderedExecutor(String baseName, int numThreads, 
ThreadFactory threadF
             ExecutorService thread = createSingleThreadExecutor(
                     new ThreadFactoryBuilder().setNameFormat(name + "-" + 
getClass().getSimpleName() + "-" + i + "-%d")
                     .setThreadFactory(threadFactory).build());
-            SingleThreadExecutor ste = null;
             if (thread instanceof SingleThreadExecutor) {
-                ste = (SingleThreadExecutor) thread;
+                SingleThreadExecutor ste = (SingleThreadExecutor) thread;
+                ste.registerMetrics(statsLogger, name, i);

Review Comment:
   Did you change this like @hangc0276 commented? 
https://github.com/apache/bookkeeper/pull/4374#discussion_r1614973418
   
   If  we can move registry in here, I think we can change 
`createSingleThreadExecutor ` to return SingleThreadExecutor directly. Like I 
saiy in 
https://github.com/apache/bookkeeper/pull/4374#pullrequestreview-2069989221



-- 
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]

Reply via email to