Remove stores that have been executed previously from the overall plan.
()
| 1692 | * Remove stores that have been executed previously from the overall plan. |
| 1693 | */ |
| 1694 | private void skipStores() throws IOException { |
| 1695 | // Get stores specifically |
| 1696 | List<LOStore> sinks = Util.getLogicalRelationalOperators(lp, LOStore.class); |
| 1697 | List<Operator> sinksToRemove = new ArrayList<Operator>(); |
| 1698 | int skipCount = processedStores; |
| 1699 | if( skipCount > 0 ) { |
| 1700 | for( LOStore sink : sinks ) { |
| 1701 | sinksToRemove.add( sink ); |
| 1702 | skipCount--; |
| 1703 | if( skipCount == 0 ) |
| 1704 | break; |
| 1705 | } |
| 1706 | } |
| 1707 | |
| 1708 | for( Operator op : sinksToRemove ) { |
| 1709 | // It's fully possible in the multiquery case that |
| 1710 | // a store that is not a leaf (sink) and therefor has |
| 1711 | // successors that need to be removed. |
| 1712 | removeToLoad(op); |
| 1713 | Operator pred = lp.getPredecessors( op ).get(0); |
| 1714 | lp.disconnect( pred, op ); |
| 1715 | lp.remove( op ); |
| 1716 | } |
| 1717 | } |
| 1718 | |
| 1719 | private void removeToLoad(Operator toRemove) throws IOException { |
| 1720 | List<Operator> successors = lp.getSuccessors(toRemove); |
no test coverage detected