Browse Source

fix code smells

pull/3/MERGE
Zhou Zheng 4 years ago
parent
commit
8ba41dc131
  1. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java
  2. 5
      dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java

@ -133,7 +133,7 @@ public class TaskInstanceController extends BaseController {
@PostMapping(value = "/force-success") @PostMapping(value = "/force-success")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(FORCE_TASK_SUCCESS_ERROR) @ApiException(FORCE_TASK_SUCCESS_ERROR)
public Result forceSingleTaskSuccess(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result<Object> forceSingleTaskSuccess(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName,
@RequestParam(value = "taskInstanceId") Integer taskInstanceId) { @RequestParam(value = "taskInstanceId") Integer taskInstanceId) {
String userNameReplace = StringUtils.replaceNRTtoUnderline(loginUser.getUserName()); String userNameReplace = StringUtils.replaceNRTtoUnderline(loginUser.getUserName());

5
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java

@ -278,13 +278,12 @@ public class DagHelper {
} }
Collection<String> startVertexs = null; Collection<String> startVertexs = null;
if (StringUtils.isNotEmpty(parentNodeName)) { if (StringUtils.isNotEmpty(parentNodeName)) {
startVertexs = dag.getSubsequentNodes(parentNodeName);
// if task is CONDITION node
TaskNode task = dag.getNode(parentNodeName); TaskNode task = dag.getNode(parentNodeName);
if (task.isConditionsTask() && completeTaskList.containsKey(parentNodeName)) { if (task.isConditionsTask() && completeTaskList.containsKey(parentNodeName)) {
startVertexs = parseConditionTask(parentNodeName, task, completeTaskList); startVertexs = parseConditionTask(parentNodeName, task, completeTaskList);
} }
else {
startVertexs = dag.getSubsequentNodes(parentNodeName);
}
} else { } else {
startVertexs = dag.getBeginNode(); startVertexs = dag.getBeginNode();
} }

Loading…
Cancel
Save