org.apache.pig.impl.physicalLayer
Class POVisitor

java.lang.Object
  extended by org.apache.pig.impl.physicalLayer.POVisitor
Direct Known Subclasses:
InstantiateFuncCallerPOVisitor, POPrinter, POTreePrinter

public abstract class POVisitor
extends Object

A visitor mechanism for navigating and operating on a tree of Physical Operators. This class contains the logic to navigate the tree, but does not do anything with or to the tree. In order to operate on or extract information from the tree, extend this class. You only need to implement the methods dealing with the physical operators you are concerned with. For example, if you wish to find every POMapreduce in a physical plan and perform some operation on it, your visitor would look like: class MyPOVisitor extends POVisitor { public void visitMapreduce(POMapreduce mr) { you're logic here } } Any operators that you do not implement the visitX method for will then be navigated through by this class. *NOTE* When envoking a visitor, you should never call one of the methods in this class. You should pass your visitor as an argument to visit() on the object you want to visit. So: RIGHT: POEval myEval; MyVisitor v; myEval.visit(v); WRONG: POEval myEval; MyVisitor v; v.visitEval(myEval); These methods are only public to make them accessible to the PO* objects.


Field Summary
protected  Map<OperatorKey,ExecPhysicalOperator> mOpTable
           
 
Constructor Summary
protected POVisitor(Map<OperatorKey,ExecPhysicalOperator> opTable)
           
 
Method Summary
 void visitCogroup(POCogroup g)
          Only POCogroup.visit() and subclass implementations of this function should ever call this method.
 void visitEval(POEval e)
          Only POEval.visit() and subclass implementations of this function should ever call this method.
 void visitLoad(POLoad load)
          Only POLoad.visit() and subclass implementations of this function should ever call this method.
 void visitMapreduce(POMapreduce mr)
          Only POMapreduce.visit() and subclass implementations of this function should ever call this method.
 void visitRead(PORead p)
           
 void visitSort(POSort s)
          Only POSort.visit() and subclass implementations of this function should ever call this method.
 void visitSplit(POSplit s)
          Only POSplit.visit() and subclass implementations of this function should ever call this method.
 void visitStore(POStore s)
          Only POStore.visit() and subclass implementations of this function should ever call this method.
 void visitUnion(POUnion u)
          Only POUnion.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
 

Field Detail

mOpTable

protected Map<OperatorKey,ExecPhysicalOperator> mOpTable
Constructor Detail

POVisitor

protected POVisitor(Map<OperatorKey,ExecPhysicalOperator> opTable)
Parameters:
opTable - Operator table for the physical plan.
Method Detail

visitMapreduce

public void visitMapreduce(POMapreduce mr)
Only POMapreduce.visit() and subclass implementations of this function should ever call this method.


visitLoad

public void visitLoad(POLoad load)
Only POLoad.visit() and subclass implementations of this function should ever call this method.


visitSort

public void visitSort(POSort s)
Only POSort.visit() and subclass implementations of this function should ever call this method.


visitStore

public void visitStore(POStore s)
Only POStore.visit() and subclass implementations of this function should ever call this method.


visitCogroup

public void visitCogroup(POCogroup g)
Only POCogroup.visit() and subclass implementations of this function should ever call this method.


visitEval

public void visitEval(POEval e)
Only POEval.visit() and subclass implementations of this function should ever call this method.


visitSplit

public void visitSplit(POSplit s)
Only POSplit.visit() and subclass implementations of this function should ever call this method.


visitUnion

public void visitUnion(POUnion u)
Only POUnion.visit() and subclass implementations of this function should ever call this method.


visitRead

public void visitRead(PORead p)


Copyright © ${year} The Apache Software Foundation