public void addTaskList(List <Task<?>> taskList) {
    List <Task<?>> visited = new ArrayList<>();
    for (Task<?> task : taskList) {
      if (!visited.contains(task)) {
        tasks.add(task);
        updateTaskCount(task, visited);
      }
    }
  }
this method is used to identify all the tasks in a graph.
the graph however might get created in a disjoint fashion, in which case we can just update
the number of tasks using the "update" method.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/TaskTracker.java