chengshiwen commented on a change in pull request #5113:
URL:
https://github.com/apache/incubator-dolphinscheduler/pull/5113#discussion_r598398589
##########
File path:
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/CommonHostManager.java
##########
@@ -45,53 +51,96 @@
protected ZookeeperRegistryCenter registryCenter;
/**
- * zookeeperNodeManager
+ * zookeeper node manager
*/
@Autowired
protected ZookeeperNodeManager zookeeperNodeManager;
+ /**
+ * zk master client
+ */
+ @Autowired
+ protected ZKMasterClient zkMasterClient;
+
+ /**
+ * worker group mapper
+ */
+ @Autowired
+ protected WorkerGroupMapper workerGroupMapper;
+
/**
* select host
* @param context context
* @return host
*/
@Override
public Host select(ExecutionContext context) {
- Host host = new Host();
- Collection<String> nodes = null;
+ List<HostWorker> candidates = null;
String workerGroup = context.getWorkerGroup();
- // executor type
ExecutorType executorType = context.getExecutorType();
switch (executorType) {
case WORKER:
- nodes = zookeeperNodeManager.getWorkerGroupNodes(workerGroup);
+ candidates = getHostWorkersFromDatabase(workerGroup);
Review comment:
Isn’t it stressful to access zk every time? The performance of mysql is
enough, don't worry at all
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]