ruanwenjun commented on code in PR #14887:
URL:
https://github.com/apache/dolphinscheduler/pull/14887#discussion_r1320787152
##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/MasterHeartBeat.java:
##########
@@ -36,6 +36,7 @@ public class MasterHeartBeat implements HeartBeat {
private double reservedMemory;
private double diskAvailable;
private int processId;
+ private boolean overload;
Review Comment:
Add Master status rather than overload flag, master may have other status in
the future.
##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java:
##########
@@ -210,40 +213,59 @@ class MasterDataListener implements SubscribeListener {
public void notify(Event event) {
final String path = event.path();
final Type type = event.type();
+ final String data = event.data();
if (registryClient.isMasterPath(path)) {
try {
+ String[] parts = path.split("/");
+ final String masterAddress = parts[parts.length - 1];
if (type.equals(Type.ADD)) {
log.info("master node : {} added.", path);
updateMasterNodes();
- }
- if (type.equals(Type.REMOVE)) {
+ } else if (type.equals(Type.REMOVE)) {
log.info("master node : {} down.", path);
updateMasterNodes();
alertDao.sendServerStoppedAlert(1, path, "MASTER");
+ } else if (type == Type.UPDATE) {
Review Comment:
It's better don't change this listener, we need to cache all master
heartbeat info, but only need to filter the overload master when calculate
slot, so it's better to split this class to ServerNodeManager and
MasterSlotManager. ServerNodeManager only need to synchronize the data from the
registry.
--
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]