Trim everything above a given operator. The specified operator will NOT be removed. @param op Operator to trim everything before.
(E op)
| 293 | * @param op Operator to trim everything before. |
| 294 | */ |
| 295 | public void trimAbove(E op) { |
| 296 | List<E> predecessors = new ArrayList<E>(getPredecessors(op)); |
| 297 | IndexHelper<E> indexHelper = new IndexHelper<E>(predecessors); |
| 298 | trimAbove(predecessors); |
| 299 | for(E predecessor: predecessors) { |
| 300 | try { |
| 301 | op.rewire(predecessor, indexHelper.getIndex(predecessor), null, true); |
| 302 | } catch (PlanException pe) { |
| 303 | //TODO |
| 304 | //need to change the method signature to include the exception clause |
| 305 | //for now, throwing RunTimeException to workaround this issue |
| 306 | throw new RuntimeException("Encountered problems with rewiring operators.", pe); |
| 307 | } |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | private void trimAbove(List<E> ops) { |
| 312 | if (ops != null) { |
no test coverage detected