|
|
@ -25,13 +25,19 @@ import org.apache.dolphinscheduler.common.utils.StringUtils; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.User; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.User; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.WorkerGroup; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.WorkerGroup; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.remote.utils.Host; |
|
|
|
import org.apache.dolphinscheduler.service.zk.ZookeeperCachedOperator; |
|
|
|
import org.apache.dolphinscheduler.service.zk.ZookeeperCachedOperator; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.Set; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* work group service |
|
|
|
* work group service |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -133,7 +139,6 @@ public class WorkerGroupService extends BaseService { |
|
|
|
|
|
|
|
|
|
|
|
// available workerGroup list
|
|
|
|
// available workerGroup list
|
|
|
|
List<String> availableWorkerGroupList = new ArrayList<>(); |
|
|
|
List<String> availableWorkerGroupList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
List<WorkerGroup> workerGroups = new ArrayList<>(); |
|
|
|
List<WorkerGroup> workerGroups = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
for (String workerGroup : workerGroupList){ |
|
|
|
for (String workerGroup : workerGroupList){ |
|
|
@ -144,10 +149,10 @@ public class WorkerGroupService extends BaseService { |
|
|
|
WorkerGroup wg = new WorkerGroup(); |
|
|
|
WorkerGroup wg = new WorkerGroup(); |
|
|
|
wg.setName(workerGroup); |
|
|
|
wg.setName(workerGroup); |
|
|
|
if (isPaging){ |
|
|
|
if (isPaging){ |
|
|
|
wg.setIpList(childrenNodes); |
|
|
|
wg.setIpList(childrenNodes.stream().map(node -> Host.of(node).getIp()).collect(Collectors.toList())); |
|
|
|
String registeredIpValue = zookeeperCachedOperator.get(workerGroupPath + "/" + childrenNodes.get(0)); |
|
|
|
String registeredValue = zookeeperCachedOperator.get(workerGroupPath + "/" + childrenNodes.get(0)); |
|
|
|
wg.setCreateTime(DateUtils.stringToDate(registeredIpValue.split(",")[6])); |
|
|
|
wg.setCreateTime(DateUtils.stringToDate(registeredValue.split(",")[6])); |
|
|
|
wg.setUpdateTime(DateUtils.stringToDate(registeredIpValue.split(",")[7])); |
|
|
|
wg.setUpdateTime(DateUtils.stringToDate(registeredValue.split(",")[7])); |
|
|
|
} |
|
|
|
} |
|
|
|
workerGroups.add(wg); |
|
|
|
workerGroups.add(wg); |
|
|
|
} |
|
|
|
} |
|
|
|