You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by le...@apache.org on 2021/11/30 06:10:26 UTC
[dolphinscheduler] branch 2.0.1-prepare updated: [Fix-7019][MasterServer] Fix the issue with failing to save and run the process that contains the switch task. (#7046) (#7059)
This is an automated email from the ASF dual-hosted git repository.
leonbao pushed a commit to branch 2.0.1-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/2.0.1-prepare by this push:
new 36fd0c8 [Fix-7019][MasterServer] Fix the issue with failing to save and run the process that contains the switch task. (#7046) (#7059)
36fd0c8 is described below
commit 36fd0c83f50435ba0b6db609d60c29951837daed
Author: wind <ca...@users.noreply.github.com>
AuthorDate: Tue Nov 30 14:10:22 2021 +0800
[Fix-7019][MasterServer] Fix the issue with failing to save and run the process that contains the switch task. (#7046) (#7059)
Co-authored-by: Hua Jiang <ji...@163.com>
---
.../dolphinscheduler/common/task/switchtask/SwitchResultVo.java | 4 ++++
.../main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | 2 +-
.../server/master/runner/task/SwitchTaskProcessor.java | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/switchtask/SwitchResultVo.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/switchtask/SwitchResultVo.java
index 558a6f1..07f0f94 100644
--- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/switchtask/SwitchResultVo.java
+++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/switchtask/SwitchResultVo.java
@@ -42,6 +42,10 @@ public class SwitchResultVo {
List<String> nextNodeList = new ArrayList<>();
nextNodeList.add(String.valueOf(nextNode));
this.nextNode = nextNodeList;
+ } else if (nextNode instanceof Number) {
+ List<String> nextNodeList = new ArrayList<>();
+ nextNodeList.add(nextNode.toString());
+ this.nextNode = nextNodeList;
} else {
this.nextNode = (ArrayList) nextNode;
}
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
index 3501291..d419505 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
@@ -406,7 +406,7 @@ public class DagHelper {
Map<String, TaskInstance> completeTaskList,
DAG<String, TaskNode, TaskNodeRelation> dag) {
- SwitchParameters switchParameters = completeTaskList.get(taskNode.getName()).getSwitchDependency();
+ SwitchParameters switchParameters = completeTaskList.get(Long.toString(taskNode.getCode())).getSwitchDependency();
int resultConditionLocation = switchParameters.getResultConditionLocation();
List<SwitchResultVo> conditionResultVoList = switchParameters.getDependTaskList();
List<String> switchTaskList = conditionResultVoList.get(resultConditionLocation).getNextNode();
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java
index 68189c6..bcc33ab 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java
@@ -210,7 +210,7 @@ public class SwitchTaskProcessor extends BaseTaskProcessor {
if (!org.apache.commons.lang.math.NumberUtils.isNumber(value)) {
value = "\"" + value + "\"";
}
- logger.info("paramName:{},paramValue{}", paramName, value);
+ logger.info("paramName:{},paramValue:{}", paramName, value);
content = content.replace("${" + paramName + "}", value);
}
return content;