public void connect(BaseWork a, BaseWork b,
      TezEdgeProperty edgeProp) {
    workGraph.get(a).add(b);
    invertedWorkGraph.get(b).add(a);
    roots.remove(b);
    leaves.remove(a);
    ImmutablePair workPair = new ImmutablePair(a, b);
    edgeProperties.put(workPair, edgeProp);
  }
connect adds an edge between a and b. Both nodes have
to be added prior to calling connect.
ql/src/java/org/apache/hadoop/hive/ql/plan/TezWork.java