/** * Cleans up the plan after combining similar branches into one branch making sure parents & children point to * each other correctly. */ private void cleanupPlan() { for (Mutable<ILogicalOperator> root : roots) { replicateToOutputs.clear(); newOutputs.clear(); findReplicateOp(root, replicateToOutputs); cleanup(replicateToOutputs, newOutputs); } }