Browse Source

解决单独执行子节点空指针的问题(增加checkstyle)

liliang1991 4 years ago
parent
commit
78972144e0

+ 13 - 31
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java

@@ -70,10 +70,10 @@ public class DagHelper {
     /**
      * generate task nodes needed by dag
      *
-     * @param taskNodeList         taskNodeList
-     * @param startNodeNameList    startNodeNameList
+     * @param taskNodeList taskNodeList
+     * @param startNodeNameList startNodeNameList
      * @param recoveryNodeNameList recoveryNodeNameList
-     * @param taskDependType       taskDependType
+     * @param taskDependType taskDependType
      * @return task node list
      */
     public static List<TaskNode> generateFlowNodeListByStartNode(List<TaskNode> taskNodeList, List<String> startNodeNameList,
@@ -131,7 +131,7 @@ public class DagHelper {
     /**
      * find all the nodes that depended on the start node
      *
-     * @param startNode    startNode
+     * @param startNode startNode
      * @param taskNodeList taskNodeList
      * @return task node list
      */
@@ -156,9 +156,9 @@ public class DagHelper {
     /**
      * find all nodes that start nodes depend on.
      *
-     * @param startNode            startNode
+     * @param startNode startNode
      * @param recoveryNodeNameList recoveryNodeNameList
-     * @param taskNodeList         taskNodeList
+     * @param taskNodeList taskNodeList
      * @return task node list
      */
     private static List<TaskNode> getFlowNodeListPre(TaskNode startNode, List<String> recoveryNodeNameList, List<TaskNode> taskNodeList, List<String> visitedNodeNameList) {
@@ -192,9 +192,9 @@ public class DagHelper {
      * generate dag by start nodes and recovery nodes
      *
      * @param processDefinitionJson processDefinitionJson
-     * @param startNodeNameList     startNodeNameList
-     * @param recoveryNodeNameList  recoveryNodeNameList
-     * @param depNodeType           depNodeType
+     * @param startNodeNameList startNodeNameList
+     * @param recoveryNodeNameList recoveryNodeNameList
+     * @param depNodeType depNodeType
      * @return process dag
      * @throws Exception if error throws Exception
      */
@@ -246,7 +246,7 @@ public class DagHelper {
      * find node by node name
      *
      * @param nodeDetails nodeDetails
-     * @param nodeName    nodeName
+     * @param nodeName nodeName
      * @return task node
      */
     public static TaskNode findNodeByName(List<TaskNode> nodeDetails, String nodeName) {
@@ -261,8 +261,8 @@ public class DagHelper {
     /**
      * the task can be submit when  all the depends nodes are forbidden or complete
      *
-     * @param taskNode         taskNode
-     * @param dag              dag
+     * @param taskNode taskNode
+     * @param dag dag
      * @param completeTaskList completeTaskList
      * @return can submit
      */
@@ -276,7 +276,7 @@ public class DagHelper {
         }
         for (String dependNodeName : dependList) {
             TaskNode dependNode = dag.getNode(dependNodeName);
-            if(dependNode==null){
+            if (dependNode == null) {
                 continue;
             }
             if (completeTaskList.containsKey(dependNodeName)
@@ -295,7 +295,6 @@ public class DagHelper {
      * this function parse the condition node to find the right branch.
      * also check all the depends nodes forbidden or complete
      *
-     * @param preNodeName
      * @return successor nodes
      */
     public static Set<String> parsePostNodes(String preNodeName,
@@ -332,9 +331,6 @@ public class DagHelper {
 
     /**
      * if all of the task dependence are skipped, skip it too.
-     *
-     * @param taskNode
-     * @return
      */
     private static boolean isTaskNodeNeedSkip(TaskNode taskNode,
                                               Map<String, TaskNode> skipTaskNodeList
@@ -354,9 +350,6 @@ public class DagHelper {
     /**
      * parse condition task find the branch process
      * set skip flag for another one.
-     *
-     * @param nodeName
-     * @return
      */
     public static List<String> parseConditionTask(String nodeName,
                                                   Map<String, TaskNode> skipTaskNodeList,
@@ -391,11 +384,6 @@ public class DagHelper {
 
     /**
      * set task node and the post nodes skip flag
-     *
-     * @param skipNodeName
-     * @param dag
-     * @param completeTaskList
-     * @param skipTaskNodeList
      */
     private static void setTaskNodeSkip(String skipNodeName,
                                         DAG<String, TaskNode, TaskNodeRelation> dag,
@@ -467,9 +455,6 @@ public class DagHelper {
 
     /**
      * is there have conditions after the parent node
-     *
-     * @param parentNodeName
-     * @return
      */
     public static boolean haveConditionsAfterNode(String parentNodeName,
                                                   DAG<String, TaskNode, TaskNodeRelation> dag
@@ -491,9 +476,6 @@ public class DagHelper {
 
     /**
      * is there have conditions after the parent node
-     *
-     * @param parentNodeName
-     * @return
      */
     public static boolean haveConditionsAfterNode(String parentNodeName,
                                                   List<TaskNode> taskNodes