public void disconnect(BaseWork a, BaseWork b) {
    workGraph.get(a).remove(b);
    invertedWorkGraph.get(b).remove(a);
    if (getParents(b).isEmpty()) {
      roots.add(b);
    }
    if (getChildren(a).isEmpty()) {
      leaves.add(a);
    }
  }
disconnect removes an edge between a and b. Both a and
b have to be in the graph. If there is no matching edge
no change happens.
ql/src/java/org/apache/hadoop/hive/ql/plan/TezWork.java