org.apache.pig.experimental.plan
Class PlanVisitor

java.lang.Object
  extended by org.apache.pig.experimental.plan.PlanVisitor
Direct Known Subclasses:
LogicalExpressionVisitor, LogicalPlanVisitor

public abstract class PlanVisitor
extends Object

A visitor mechanism for navigating and operating on a plan of Operators. This class contains the logic to traverse the plan. It does not visit individual nodes. That is left to implementing classes (such as LOVisitor).


Field Summary
protected  PlanWalker currentWalker
          Guaranteed to always point to the walker currently being used.
protected static String DEFAULT_SCOPE
           
protected  OperatorPlan plan
           
 
Constructor Summary
protected PlanVisitor(OperatorPlan plan, PlanWalker walker)
           
 
Method Summary
 OperatorPlan getPlan()
           
protected  void popWalker()
          Pop the next to previous walker off of the stack and set it as the current walker.
protected  void pushWalker(PlanWalker walker)
          Push the current walker onto the stack of saved walkers and begin using the newly passed walker as the current walker.
 void visit()
          Entry point for visiting the plan.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SCOPE

protected static final String DEFAULT_SCOPE
See Also:
Constant Field Values

plan

protected OperatorPlan plan

currentWalker

protected PlanWalker currentWalker
Guaranteed to always point to the walker currently being used.

Constructor Detail

PlanVisitor

protected PlanVisitor(OperatorPlan plan,
                      PlanWalker walker)
Parameters:
plan - OperatorPlan this visitor will visit.
walker - PlanWalker this visitor will use to traverse the plan.
Method Detail

visit

public void visit()
           throws IOException
Entry point for visiting the plan.

Throws:
VisitorException - if an error is encountered while visiting.
IOException

getPlan

public OperatorPlan getPlan()

pushWalker

protected void pushWalker(PlanWalker walker)
Push the current walker onto the stack of saved walkers and begin using the newly passed walker as the current walker.

Parameters:
walker - new walker to set as the current walker.

popWalker

protected void popWalker()
                  throws VisitorException
Pop the next to previous walker off of the stack and set it as the current walker. This will drop the reference to the current walker.

Throws:
VisitorException - if there are no more walkers on the stack. In this case the current walker is not reset.


Copyright © ${year} The Apache Software Foundation