private static void linkMoveTask(Task<MoveWork> mvTask,
      Task<?> task, HiveConf hconf,
      DependencyCollectionTask dependencyTask) {

    if (task.getDependentTasks() == null || task.getDependentTasks().isEmpty()) {
      // If it's a leaf, add the move task as a child
      addDependentMoveTasks(mvTask, hconf, task, dependencyTask);
    } else {
      // Otherwise, for each child run this method recursively
      for (Task<?> childTask : task.getDependentTasks()) {
        linkMoveTask(mvTask, childTask, hconf, dependencyTask);
      }
    }
  }
Follows the task tree down from task and makes all leaves parents of mvTask

@param mvTask
@param task
@param hconf
@param dependencyTask
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java