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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]