public void removeFromChildrenTasks() {

    List<Task<?>> childrenTasks = this.getChildTasks();
    if (childrenTasks == null) {
      return;
    }

    for (Task<?> childTsk : childrenTasks) {
      // remove this task from its children tasks
      childTsk.getParentTasks().remove(this);

      // recursively remove non-parent task from its children
      List<Task<?>> siblingTasks = childTsk.getParentTasks();
      if (siblingTasks == null || siblingTasks.size() == 0) {
        childTsk.removeFromChildrenTasks();
      }
    }
  }
This method is overridden in each Task. TODO execute should return a TaskHandle.

@return status of executing the task
ql/src/java/org/apache/hadoop/hive/ql/exec/Task.java