|
|
@ -17,6 +17,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.api.service.impl; |
|
|
|
package org.apache.dolphinscheduler.api.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKER_GROUP_CREATE; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKER_GROUP_DELETE; |
|
|
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.api.enums.Status; |
|
|
|
import org.apache.dolphinscheduler.api.enums.Status; |
|
|
|
import org.apache.dolphinscheduler.api.service.WorkerGroupService; |
|
|
|
import org.apache.dolphinscheduler.api.service.WorkerGroupService; |
|
|
|
import org.apache.dolphinscheduler.api.utils.PageInfo; |
|
|
|
import org.apache.dolphinscheduler.api.utils.PageInfo; |
|
|
@ -25,6 +28,7 @@ import org.apache.dolphinscheduler.common.Constants; |
|
|
|
import org.apache.dolphinscheduler.common.enums.AuthorizationType; |
|
|
|
import org.apache.dolphinscheduler.common.enums.AuthorizationType; |
|
|
|
import org.apache.dolphinscheduler.common.enums.NodeType; |
|
|
|
import org.apache.dolphinscheduler.common.enums.NodeType; |
|
|
|
import org.apache.dolphinscheduler.common.enums.UserType; |
|
|
|
import org.apache.dolphinscheduler.common.enums.UserType; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.utils.HeartBeat; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.ProcessInstance; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.ProcessInstance; |
|
|
|
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; |
|
|
@ -53,8 +57,6 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import com.facebook.presto.jdbc.internal.guava.base.Strings; |
|
|
|
import com.facebook.presto.jdbc.internal.guava.base.Strings; |
|
|
|
|
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.*; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* worker group service impl |
|
|
|
* worker group service impl |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -296,9 +298,9 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGro |
|
|
|
if (isPaging) { |
|
|
|
if (isPaging) { |
|
|
|
wg.setAddrList(String.join(Constants.COMMA, childrenNodes)); |
|
|
|
wg.setAddrList(String.join(Constants.COMMA, childrenNodes)); |
|
|
|
String registeredValue = registryClient.get(workerGroupPath + Constants.SINGLE_SLASH + childrenNodes.iterator().next()); |
|
|
|
String registeredValue = registryClient.get(workerGroupPath + Constants.SINGLE_SLASH + childrenNodes.iterator().next()); |
|
|
|
String[] rv = registeredValue.split(Constants.COMMA); |
|
|
|
HeartBeat heartBeat = HeartBeat.decodeHeartBeat(registeredValue); |
|
|
|
wg.setCreateTime(new Date(Long.parseLong(rv[6]))); |
|
|
|
wg.setCreateTime(new Date(heartBeat.getStartupTime())); |
|
|
|
wg.setUpdateTime(new Date(Long.parseLong(rv[7]))); |
|
|
|
wg.setUpdateTime(new Date(heartBeat.getReportTime())); |
|
|
|
wg.setSystemDefault(true); |
|
|
|
wg.setSystemDefault(true); |
|
|
|
} |
|
|
|
} |
|
|
|
workerGroups.add(wg); |
|
|
|
workerGroups.add(wg); |
|
|
|