caishunfeng commented on code in PR #12050:
URL: https://github.com/apache/dolphinscheduler/pull/12050#discussion_r978691330
##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java:
##########
@@ -140,48 +151,42 @@ public static int getMasterSize() {
return MASTER_SIZE;
}
+
/**
* init listener
*
* @throws Exception if error throws Exception
*/
@Override
public void afterPropertiesSet() throws Exception {
- /**
- * load nodes from zookeeper
- */
+
+ // load nodes from zookeeper
load();
- /**
- * init executor service
- */
+
+ // init executor service
executorService =
- Executors.newSingleThreadScheduledExecutor(new
NamedThreadFactory("ServerNodeManagerExecutor"));
+ Executors.newSingleThreadScheduledExecutor(new
NamedThreadFactory("ServerNodeManagerExecutor"));
executorService.scheduleWithFixedDelay(new
WorkerNodeInfoAndGroupDbSyncTask(), 0, 10, TimeUnit.SECONDS);
- /*
- * init MasterNodeListener listener
- */
+
+ // init MasterNodeListener listener
registryClient.subscribe(REGISTRY_DOLPHINSCHEDULER_MASTERS, new
MasterDataListener());
- /*
- * init WorkerNodeListener listener
- */
+
+ // init WorkerNodeListener listener
registryClient.subscribe(REGISTRY_DOLPHINSCHEDULER_WORKERS, new
WorkerDataListener());
}
/**
* load nodes from zookeeper
*/
public void load() {
- /*
- * master nodes from zookeeper
- */
+ // master nodes from zookeeper
updateMasterNodes();
- /*
- * worker group nodes from zookeeper
- */
+ // worker group nodes from zookeeper
Collection<String> workerGroups =
registryClient.getWorkerGroupDirectly();
for (String workerGroup : workerGroups) {
- syncWorkerGroupNodes(workerGroup,
registryClient.getWorkerGroupNodesDirectly(workerGroup));
+ syncWorkerGroupNodesFromRegistry(workerGroup,
+ registryClient.getWorkerGroupNodesDirectly(workerGroup), null);
Review Comment:
The null type seems a little weird.
```suggestion
registryClient.getWorkerGroupNodesDirectly(workerGroup),
Type.ADD);
```
--
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]