org.apache.pig.impl.logicalLayer.optimizer.streaming
Class LoadOptimizer

java.lang.Object
  extended by org.apache.pig.impl.logicalLayer.LOVisitor
      extended by org.apache.pig.impl.logicalLayer.optimizer.Optimizer
          extended by org.apache.pig.impl.logicalLayer.optimizer.streaming.LoadOptimizer

public class LoadOptimizer
extends Optimizer

LoadOptimizer tries to optimize away the deserialization done by Pig for the simple case of a LOAD followed by a STREAM operator; both with the equivalent LoadFunc specifications. In such cases it is safe to replace the equivalent LoadFunc specifications with a BinaryStorage which doesn't interpret the input bytes at all.


Constructor Summary
LoadOptimizer()
           
 
Method Summary
 boolean optimize(LogicalPlan root)
          Optimize the given LogicalPlan if feasible and return status.
 void visitCogroup(LOCogroup g)
          Only LOCogroup.visit() and subclass implementations of this function should ever call this method.
 void visitEval(LOEval e)
          Only LOEval.visit() and subclass implementations of this function should ever call this method.
 void visitLoad(LOLoad load)
          Only LOLoad.visit() and subclass implementations of this function should ever call this method.
 void visitSort(LOSort s)
          Only LOSort.visit() and subclass implementations of this function should ever call this method.
 void visitSplit(LOSplit s)
          Only LOSplit.visit() and subclass implementations of this function should ever call this method.
 void visitSplitOutput(LOSplitOutput s)
           
 void visitStore(LOStore s)
          Only LOStore.visit() and subclass implementations of this function should ever call this method.
 void visitUnion(LOUnion u)
          Only LOUnion.visit() and subclass implementations of this function should ever call this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoadOptimizer

public LoadOptimizer()
Method Detail

visitCogroup

public void visitCogroup(LOCogroup g)
Description copied from class: LOVisitor
Only LOCogroup.visit() and subclass implementations of this function should ever call this method.

Overrides:
visitCogroup in class LOVisitor

visitEval

public void visitEval(LOEval e)
Description copied from class: LOVisitor
Only LOEval.visit() and subclass implementations of this function should ever call this method.

Overrides:
visitEval in class LOVisitor

visitLoad

public void visitLoad(LOLoad load)
Description copied from class: LOVisitor
Only LOLoad.visit() and subclass implementations of this function should ever call this method.

Overrides:
visitLoad in class LOVisitor

visitSort

public void visitSort(LOSort s)
Description copied from class: LOVisitor
Only LOSort.visit() and subclass implementations of this function should ever call this method.

Overrides:
visitSort in class LOVisitor

visitSplit

public void visitSplit(LOSplit s)
Description copied from class: LOVisitor
Only LOSplit.visit() and subclass implementations of this function should ever call this method.

Overrides:
visitSplit in class LOVisitor

visitSplitOutput

public void visitSplitOutput(LOSplitOutput s)
Overrides:
visitSplitOutput in class LOVisitor

visitStore

public void visitStore(LOStore s)
Description copied from class: LOVisitor
Only LOStore.visit() and subclass implementations of this function should ever call this method.

Overrides:
visitStore in class LOVisitor

visitUnion

public void visitUnion(LOUnion u)
Description copied from class: LOVisitor
Only LOUnion.visit() and subclass implementations of this function should ever call this method.

Overrides:
visitUnion in class LOVisitor

optimize

public boolean optimize(LogicalPlan root)
Description copied from class: Optimizer
Optimize the given LogicalPlan if feasible and return status.

Specified by:
optimize in class Optimizer
Parameters:
root - root of the LogicalPlan to optimize
Returns:
true if optimization was feasible and was effected, false otherwise.


Copyright © ${year} The Apache Software Foundation