gaojun2048 commented on a change in pull request #5113:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/5113#discussion_r598396844



##########
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:
       Need to call a database query for every command scheduling? This will 
cause the database to be very stressful, and you need to think about other ways.




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


Reply via email to