public boolean addRootIfPossible(Task<?> task) {
    if (task.getParentTasks() == null || task.getParentTasks().isEmpty()) {
      if (!rootTasks.contains(task)) {
        return rootTasks.add(task);
      }
    }
    return false;
  }
@param rootTasks
         root tasks for the plan
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMRProcContext.java