[improve-10506] [server] add MasterHeartBeat and WorkerHeartBeat to extend HeartBeat#10563
[improve-10506] [server] add MasterHeartBeat and WorkerHeartBeat to extend HeartBeat#10563guoshupei wants to merge 12 commits intoapache:devfrom
Conversation
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HeartBeat.java
Outdated
Show resolved
Hide resolved
| 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); |
There was a problem hiding this comment.
You can make HeartBeatUtil.decodeHeartBeat return AbstractHeartBeat , then the HeartBeatModel can be removed.
There was a problem hiding this comment.
Worker fields are needed in some places. like host manager, Of course, it can also be obtained by split string of heartbeat ,but it is not graceful.
There was a problem hiding this comment.
You can make
HeartBeatUtil.decodeHeartBeatreturnAbstractHeartBeat, then theHeartBeatModelcan 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.
There was a problem hiding this comment.
Is there any problem if you remove the HeartBeatModel and only keep AbstractHeart/MasterHeartBeat/WorkHeartBeat ?
There was a problem hiding this comment.
When we get a HeartBeatInfo, we need to know this HeartBeatInfo is represent to worker or master, rather than use a big pojo to contains all fields. If we use a big pojo to represent the HeartBeatInfo, it's hard to know which field is available.
There was a problem hiding this comment.
WorkHeartBeat is just a pojo, it should not depend anything, if I have any misunderstand, please let me know.
There was a problem hiding this comment.
The worker needs to update workWaitingTaskCount to report the heartbeat information.
There was a problem hiding this comment.
Yes, the worker will schedule a WorkerHeartbeatTask to update the info in WorkHeartBeat, there seems no problem.
There was a problem hiding this comment.
I have some questions to confirm.
-
- Do we need to define a
WorkerHeartbeatTask?
- Do we need to define a
-
- What do you mean
WorkerHeartbeatTaskautowaredWorkerManagerThread?
- What do you mean
-
- Which module is
WorkerHeartbeatTaskin ?
- Which module is
|
Worker fields are needed in some places. like host manager, Of course, it can also be obtained by split string of heartbeat ,but it is not graceful.
发自我的iPhone
… 在 2022年6月23日,21:48,Wenjun Ruan ***@***.***> 写道:
@ruanwenjun commented on this pull request.
In 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);
You can make HeartBeatUtil.decodeHeartBeat return AbstractHeartBeat , then the HeartBeatModel can be removed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were assigned.
|
Codecov Report
@@ Coverage Diff @@
## dev #10563 +/- ##
============================================
+ Coverage 40.92% 41.08% +0.15%
- Complexity 4874 4896 +22
============================================
Files 895 899 +4
Lines 36201 36242 +41
Branches 3986 3986
============================================
+ Hits 14817 14889 +72
+ Misses 19919 19890 -29
+ Partials 1465 1463 -2
Continue to review full report at Codecov.
|
|
Kudos, SonarCloud Quality Gate passed! |
|
I close this pr because it had been implemented by #11702 |









MasterHeartBeatto module ofdolphinscheduler-masterWorkerHeartBeatto module ofdolphinscheduler-workerthis closes #10506