fuchanghai commented on code in PR #14563:
URL:
https://github.com/apache/dolphinscheduler/pull/14563#discussion_r1274287735
##########
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/utils/DagHelper.java:
##########
@@ -424,19 +424,61 @@ private static List<Long> skipTaskNode4Switch(TaskNode
taskNode,
int resultConditionLocation =
switchParameters.getResultConditionLocation();
List<SwitchResultVo> conditionResultVoList =
switchParameters.getDependTaskList();
List<Long> switchTaskList =
conditionResultVoList.get(resultConditionLocation).getNextNode();
+ Set<Long> switchNeedWorkCodes = new HashSet<>();
if (CollectionUtils.isEmpty(switchTaskList)) {
switchTaskList = new ArrayList<>();
+ } else {
+ // get all downstream nodes of the branch that the switch node
needs to execute
+ for (Long switchTaskCode : switchTaskList) {
+ getSwitchNeedWorkCodes(switchTaskCode, dag,
switchNeedWorkCodes);
+ }
}
// conditionResultVoList.remove(resultConditionLocation);
for (SwitchResultVo info : conditionResultVoList) {
if (CollectionUtils.isEmpty(info.getNextNode())) {
continue;
}
- setTaskNodeSkip(info.getNextNode().get(0), dag, completeTaskList,
skipTaskNodeList);
+ setSwitchTaskNodeSkip(info.getNextNode().get(0), dag,
completeTaskList, skipTaskNodeList,
Review Comment:
i will improve this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]