guoshupei commented on code in PR #10563:
URL: https://github.com/apache/dolphinscheduler/pull/10563#discussion_r907302796


##########
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryClient.java:
##########
@@ -97,7 +98,7 @@ public List<Server> getServerList(NodeType nodeType) {
 
         List<Server> serverList = new ArrayList<>();
         for (Map.Entry<String, String> entry : serverMaps.entrySet()) {
-            HeartBeat heartBeat = HeartBeat.decodeHeartBeat(entry.getValue());
+            HeartBeatModel heartBeat = 
HeartBeatUtils.decodeHeartBeat(entry.getValue(), nodeType);

Review Comment:
   > You can make `HeartBeatUtil.decodeHeartBeat` return `AbstractHeartBeat` , 
then the `HeartBeatModel` can be removed.
   
   When I designed `WorkerHeartBeat` and `MasterHeartBeat`, I have a dependency 
cycle problem, so I defined `HeartBeatModel` in module 
`dolphinscheduler-common` that contains all heartbeatInfo, which also avoids 
the need to hard code the worker's Heartbeat in the master, For example, the 
workWaitingTaskCount attribute is used in HostManager.
   
   current design: 
   `MasterHeartBeat` in `dolphinscheduler-master`
   `WorkerHeartBeat `in `dolphinscheduler-worker`
   `AbstractHeartBeat `in `dolphinscheduler-server` (move into 
`dolphinscheduler-common` is also ok)
   `HeartBeatModel `in `dolphinscheduler-common`
   
   ps:
   `WorkerHeartBeat `dependency injection `WorkerManagerThread `of 
dolphinscheduler-worker
   `HostWeight `of dolphinscheduler-master use `workWaitingTaskCount `of 
WorkerHeartBeat 
   
   I don't have any good ideas right now. I need your help.
   



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