You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/11/24 02:25:00 UTC

[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #12980: [Improvement-12907]adjust log level and refactor private methods.

caishunfeng commented on code in PR #12980:
URL: https://github.com/apache/dolphinscheduler/pull/12980#discussion_r1031001423


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java:
##########
@@ -382,10 +366,8 @@ public synchronized void addWorkerInfoChangeListener(WorkerInfoChangeListener li
     }
 
     private void notifyWorkerInfoChangeListeners() {
-        Map<String, Set<String>> workerGroupNodes = getWorkerGroupNodes();
-        Map<String, WorkerHeartBeat> workerNodeInfo = getWorkerNodeInfo();
         for (WorkerInfoChangeListener listener : workerInfoChangeListeners) {
-            listener.notify(workerGroupNodes, workerNodeInfo);
+            listener.notify(getWorkerGroupNodes(), getWorkerNodeInfo());

Review Comment:
   > I don't think this will make the code clean.
   
   +1,  I think we should not call `getWorkerGroupNodes` and `getWorkerNodeInfo` in the loop, although they just operate in memory.



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org