|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.impl.physicalLayer.POVisitor
public abstract class POVisitor
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 |
---|
protected Map<OperatorKey,ExecPhysicalOperator> mOpTable
Constructor Detail |
---|
protected POVisitor(Map<OperatorKey,ExecPhysicalOperator> opTable)
opTable
- Operator table for the physical plan.Method Detail |
---|
public void visitMapreduce(POMapreduce mr)
public void visitLoad(POLoad load)
public void visitSort(POSort s)
public void visitStore(POStore s)
public void visitCogroup(POCogroup g)
public void visitEval(POEval e)
public void visitSplit(POSplit s)
public void visitUnion(POUnion u)
public void visitRead(PORead p)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |