private void getLeafTasks(List<Task<?>> rootTasks,
      Set<Task<?>> leaves) {

    for (Task<?> root : rootTasks) {
      getLeafTasks(root, leaves);
    }
  }
Find all leaf tasks of the list of root tasks.
ql/src/java/org/apache/hadoop/hive/ql/parse/TaskCompiler.java