public void add(BaseWork w) {
    if (workGraph.containsKey(w)) {
      return;
    }
    workGraph.put(w, new LinkedList<BaseWork>());
    invertedWorkGraph.put(w, new LinkedList<BaseWork>());
    roots.add(w);
    leaves.add(w);
  }
add creates a new node in the graph without any connections
ql/src/java/org/apache/hadoop/hive/ql/plan/TezWork.java