Skip to content

Commit 0b5d0a1

Browse files
committed
DolphinScheduler publish workflow exception when it has installed schedulis.
1 parent 41addaf commit 0b5d0a1

File tree

2 files changed

+13
-3
lines changed
  • dss-appconn/appconns/dss-dolphinscheduler-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/dolphinscheduler/conversion
  • dss-orchestrator/orchestrators/dss-workflow/dss-linkis-node-execution/src/main/java/com/webank/wedatasphere/dss/linkis/node/execution/job

2 files changed

+13
-3
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.webank.wedatasphere.dss.appconn.dolphinscheduler.entity.DolphinSchedulerWorkflow;
66
import com.webank.wedatasphere.dss.common.entity.node.DSSNode;
77
import com.webank.wedatasphere.dss.common.exception.DSSRuntimeException;
8+
import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException;
89
import com.webank.wedatasphere.dss.workflow.conversion.entity.ConvertedRel;
910
import com.webank.wedatasphere.dss.workflow.conversion.entity.PreConversionRel;
1011
import com.webank.wedatasphere.dss.workflow.conversion.operation.WorkflowToRelConverter;
@@ -30,6 +31,12 @@ public class WorkflowToDolphinSchedulerRelConverter implements WorkflowToRelConv
3031
@Override
3132
public ConvertedRel convertToRel(PreConversionRel rel) {
3233
DolphinSchedulerConvertedRel dolphinSchedulerConvertedRel = (DolphinSchedulerConvertedRel)rel;
34+
List<WorkflowNode> workflowNodes = dolphinSchedulerConvertedRel.getWorkflow().getWorkflowNodes();
35+
for (WorkflowNode workflowNode : workflowNodes) {
36+
if ("workflow.subflow".equals(workflowNode.getNodeType())) {
37+
throw new ExternalOperationFailedException(90021, workflowNode.getName() + "当前不支持将subFlow节点发布到DolphinScheduler!");
38+
}
39+
}
3340
Workflow dolphinSchedulerWorkflow = convertWorkflow(dolphinSchedulerConvertedRel);
3441
dolphinSchedulerConvertedRel.setWorkflow(dolphinSchedulerWorkflow);
3542
return dolphinSchedulerConvertedRel;
@@ -62,13 +69,16 @@ private DolphinSchedulerWorkflow convertWorkflow(DolphinSchedulerConvertedRel do
6269
.collect(Collectors.toMap(WorkflowNode::getName, WorkflowNode::getId));
6370
for (WorkflowNode workflowNode : workflow.getWorkflowNodes()) {
6471
DSSNode node = workflowNode.getDSSNode();
72+
if (node.getLayout() == null) {
73+
continue;
74+
}
6575
DolphinSchedulerTask dolphinSchedulerTask = nodeConverter.convertNode(dolphinSchedulerConvertedRel, node);
6676
processDefinitionJson.addTask(dolphinSchedulerTask);
6777

6878
DolphinSchedulerWorkflow.LocationInfo locationInfo = new DolphinSchedulerWorkflow.LocationInfo();
6979
locationInfo.setName(node.getName());
70-
String targetarr = node.getDependencys().stream().map(nameToIdMap::get).collect(Collectors.joining(","));
71-
locationInfo.setTargetarr(targetarr);
80+
String targetArr = node.getDependencys().stream().map(nameToIdMap::get).collect(Collectors.joining(","));
81+
locationInfo.setTargetarr(targetArr);
7282
locationInfo.setX((int)node.getLayout().getX());
7383
locationInfo.setY((int)node.getLayout().getY());
7484
locations.put(node.getId(), locationInfo);

dss-orchestrator/orchestrators/dss-workflow/dss-linkis-node-execution/src/main/java/com/webank/wedatasphere/dss/linkis/node/execution/job/Builder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public Job build() throws Exception {
5555
LinkisJob job = null;
5656
String jobType = getJobType();
5757
String[] jobTypeSplit = jobType.split("\\.");
58-
if (jobTypeSplit.length < 3) {
58+
if (jobTypeSplit.length < 2) {
5959
throw new LinkisJobExecutionErrorException(90100, "This is not Linkis job type, this jobtype is " + jobType);
6060
}
6161
String engineType = jobTypeSplit[1];

0 commit comments

Comments
 (0)