This is an automated email from the ASF dual-hosted git repository.
caishunfeng pushed a commit to branch 2.0.6-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/2.0.6-prepare by this push:
new 1f7a328669 [Improvement] heartbeat info improvement (#10699) (#10705)
1f7a328669 is described below
commit 1f7a32866912c939c4b741936096aabd3527b618
Author: caishunfeng <[email protected]>
AuthorDate: Fri Jul 1 09:48:33 2022 +0800
[Improvement] heartbeat info improvement (#10699) (#10705)
* heartbeat info improvement
* import order
---
.../dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
index 05adaa577e..d7df710e34 100644
---
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
+++
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
@@ -23,7 +23,7 @@ import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.NodeType;
-import org.apache.dolphinscheduler.common.utils.DateUtils;
+import org.apache.dolphinscheduler.common.utils.HeartBeat;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.entity.WorkerGroup;
@@ -287,9 +287,9 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl
implements WorkerGro
if (isPaging) {
wg.setAddrList(String.join(Constants.COMMA, childrenNodes));
String registeredValue = registryClient.get(workerGroupPath +
Constants.SINGLE_SLASH + childrenNodes.iterator().next());
- String[] rv = registeredValue.split(Constants.COMMA);
- wg.setCreateTime(new Date(Long.parseLong(rv[6])));
- wg.setUpdateTime(new Date(Long.parseLong(rv[7])));
+ HeartBeat heartBeat =
HeartBeat.decodeHeartBeat(registeredValue);
+ wg.setCreateTime(new Date(heartBeat.getStartupTime()));
+ wg.setUpdateTime(new Date(heartBeat.getReportTime()));
wg.setSystemDefault(true);
}
workerGroups.add(wg);