ChenSammi commented on code in PR #3783:
URL: https://github.com/apache/ozone/pull/3783#discussion_r983604468


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/events/FixedThreadPoolWithAffinityExecutor.java:
##########
@@ -79,25 +90,39 @@
    * @param name Unique name used in monitoring and metrics.
    */
   public FixedThreadPoolWithAffinityExecutor(
-      String name,
-      List<ThreadPoolExecutor> executors) {
+      String name, EventHandler<P> eventHandler,
+      List<BlockingQueue<Q>> workQueues, EventPublisher eventPublisher,
+      Class<P> clazz, List<ThreadPoolExecutor> executors) {
     this.name = name;
+    this.eventHandler = eventHandler;
+    this.workQueues = workQueues;
+    this.eventPublisher = eventPublisher;
+    this.executors = executors;
+
+    EXECUTOR_MAP.put(clazz.getName(), this);
+
+    // Add runnable which will wait for task over another queue
+    // This needs terminate canceling each task in shutdown
+    int i = 0;
+    for (BlockingQueue<Q> queue : workQueues) {
+      ThreadPoolExecutor threadPoolExecutor = executors.get(i);
+      if (threadPoolExecutor.getQueue().size() == 0) {
+        threadPoolExecutor.submit(new ReportExecutor<>(queue, isRunning));
+      }
+      ++i;
+    }
+
     DefaultMetricsSystem.instance()

Review Comment:
   This metrics is not unregistered in close().  I know it's an existing code. 



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