Skip to content

Commit a2963bf

Browse files
Fix the bug when update workflow in DolphinScheduler will cause cycle dependencies.
1 parent ce43b0e commit a2963bf

File tree

3 files changed

+4
-121
lines changed

3 files changed

+4
-121
lines changed

dss-appconn/appconns/dss-dolphinscheduler-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/dolphinscheduler/conversion/WorkflowToDolphinSchedulerRelConverter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import com.webank.wedatasphere.dss.workflow.core.entity.Workflow;
1212
import com.webank.wedatasphere.dss.workflow.core.entity.WorkflowNode;
1313
import com.webank.wedatasphere.dss.workflow.core.entity.WorkflowNodeEdge;
14-
import org.apache.commons.lang3.StringUtils;
1514
import org.slf4j.Logger;
1615
import org.slf4j.LoggerFactory;
1716
import org.springframework.beans.BeanUtils;
@@ -59,14 +58,17 @@ private DolphinSchedulerWorkflow convertWorkflow(DolphinSchedulerConvertedRel do
5958
put("direct", "IN");
6059
}});
6160
Map<String, DolphinSchedulerWorkflow.LocationInfo> locations = new HashMap<>();
61+
Map<String, String> nameToIdMap = workflow.getWorkflowNodes().stream()
62+
.collect(Collectors.toMap(WorkflowNode::getName, WorkflowNode::getId));
6263
for (WorkflowNode workflowNode : workflow.getWorkflowNodes()) {
6364
DSSNode node = workflowNode.getDSSNode();
6465
DolphinSchedulerTask dolphinSchedulerTask = nodeConverter.convertNode(dolphinSchedulerConvertedRel, node);
6566
processDefinitionJson.addTask(dolphinSchedulerTask);
6667

6768
DolphinSchedulerWorkflow.LocationInfo locationInfo = new DolphinSchedulerWorkflow.LocationInfo();
6869
locationInfo.setName(node.getName());
69-
locationInfo.setTargetarr(StringUtils.join(node.getDependencys(), ","));
70+
String targetarr = node.getDependencys().stream().map(nameToIdMap::get).collect(Collectors.joining(","));
71+
locationInfo.setTargetarr(targetarr);
7072
locationInfo.setX((int)node.getLayout().getX());
7173
locationInfo.setY((int)node.getLayout().getY());
7274
locations.put(node.getId(), locationInfo);

dss-appconn/appconns/dss-dolphinscheduler-appconn/src/main/scala/com/webank/wedatasphere/dss/appconn/schedulis/conf/SchedulisConf.scala

Lines changed: 0 additions & 32 deletions
This file was deleted.

dss-appconn/appconns/dss-dolphinscheduler-appconn/src/main/scala/com/webank/wedatasphere/dss/appconn/schedulis/http/SchedulisHttpAction.scala

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)