MCPcopy Create free account
hub / github.com/apache/pig / skipStores

Method skipStores

src/org/apache/pig/PigServer.java:1694–1717  ·  view source on GitHub ↗

Remove stores that have been executed previously from the overall plan.

()

Source from the content-addressed store, hash-verified

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);

Callers 3

buildPlanMethod · 0.95
storeExMethod · 0.80
getExamplesMethod · 0.80

Calls 7

removeToLoadMethod · 0.95
addMethod · 0.65
getMethod · 0.65
getPredecessorsMethod · 0.65
disconnectMethod · 0.65
removeMethod · 0.65

Tested by

no test coverage detected