org.apache.pig.impl.logicalLayer
Class LogicalPlanCloneHelper

java.lang.Object
  extended by org.apache.pig.impl.plan.PlanVisitor<LogicalOperator,LogicalPlan>
      extended by org.apache.pig.impl.logicalLayer.LOVisitor
          extended by org.apache.pig.impl.logicalLayer.LogicalPlanCloneHelper

public class LogicalPlanCloneHelper
extends LOVisitor

LogicalPlanCloneHelper implements a visitor mechanism to clone a logical plan and then patch up the connections held within the operators of the logical plan. This class should not be used for cloning the logical plan. Use LogicalPlanCloner instead.


Field Summary
static Map<LogicalOperator,LogicalOperator> mOpToCloneMap
           
 
Fields inherited from class org.apache.pig.impl.plan.PlanVisitor
mCurrentWalker, mPlan
 
Constructor Summary
LogicalPlanCloneHelper(LogicalPlan plan)
           
LogicalPlanCloneHelper(LogicalPlan plan, Map<LogicalOperator,LogicalOperator> origCloneMap)
           
 
Method Summary
 LogicalPlan getClonedPlan()
           
static void resetState()
           
 void visit(BinaryExpressionOperator binOp)
           
 void visit(LOAdd op)
           
 void visit(LOAnd binOp)
           
protected  void visit(LOBinCond binCond)
           
protected  void visit(LOCast cast)
           
protected  void visit(LOCogroup cg)
           
protected  void visit(LOConst constant)
           
protected  void visit(LOCross cs)
           
protected  void visit(LODistinct dt)
           
 void visit(LODivide op)
           
 void visit(LOEqual op)
           
protected  void visit(LOFilter filter)
           
protected  void visit(LOForEach forEach)
           
protected  void visit(LOGenerate g)
           
protected  void visit(LogicalOperator op)
           
 void visit(LOGreaterThan op)
           
 void visit(LOGreaterThanEqual op)
           
 void visit(LOIsNull uniOp)
           
 void visit(LOLesserThan op)
           
 void visit(LOLesserThanEqual op)
           
protected  void visit(LOLimit limOp)
           
protected  void visit(LOLoad load)
           
 void visit(LOMapLookup op)
           
 void visit(LOMod op)
           
 void visit(LOMultiply op)
           
 void visit(LONegative op)
           
 void visit(LONot uniOp)
           
 void visit(LONotEqual op)
           
 void visit(LOOr binOp)
           
protected  void visit(LOProject project)
           
protected  void visit(LORegexp binOp)
           
protected  void visit(LOSort s)
           
protected  void visit(LOSplit split)
           
protected  void visit(LOSplitOutput sop)
           
protected  void visit(LOStore store)
           
protected  void visit(LOStream stream)
           
 void visit(LOSubtract op)
           
protected  void visit(LOUnion u)
           
protected  void visit(LOUserFunc func)
          Iterate over each expression that is part of the function argument list
protected  void visit(UnaryExpressionOperator uniOp)
           
 
Methods inherited from class org.apache.pig.impl.logicalLayer.LOVisitor
visit, visit, visit
 
Methods inherited from class org.apache.pig.impl.plan.PlanVisitor
getPlan, popWalker, pushWalker, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mOpToCloneMap

public static Map<LogicalOperator,LogicalOperator> mOpToCloneMap
Constructor Detail

LogicalPlanCloneHelper

public LogicalPlanCloneHelper(LogicalPlan plan)
                       throws CloneNotSupportedException
Parameters:
plan - logical plan to be cloned
Throws:
CloneNotSupportedException

LogicalPlanCloneHelper

public LogicalPlanCloneHelper(LogicalPlan plan,
                              Map<LogicalOperator,LogicalOperator> origCloneMap)
                       throws CloneNotSupportedException
Parameters:
plan -
origCloneMap - the lookup table used for tracking operators cloned in the plan
Throws:
CloneNotSupportedException
Method Detail

getClonedPlan

public LogicalPlan getClonedPlan()
                          throws CloneNotSupportedException
Throws:
CloneNotSupportedException

resetState

public static void resetState()

visit

public void visit(BinaryExpressionOperator binOp)
Overrides:
visit in class LOVisitor
Parameters:
binOp - the logical binary expression operator that has to be visited

visit

public void visit(LOAdd op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOAdd)

visit

public void visit(LOAnd binOp)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOAnd)

visit

protected void visit(LOBinCond binCond)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
binCond - the logical binCond operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOBinCond)

visit

protected void visit(LOCast cast)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
cast - the logical cast operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOCast)

visit

protected void visit(LOCogroup cg)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
cg - the logical cogroup operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOCogroup)

visit

protected void visit(LOConst constant)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOConst)

visit

protected void visit(LOCross cs)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOCross)

visit

protected void visit(LODistinct dt)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LODistinct)

visit

public void visit(LODivide op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LODivide)

visit

public void visit(LOEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOEqual)

visit

protected void visit(LOFilter filter)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
filter - the logical filter operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOFilter)

visit

protected void visit(LOForEach forEach)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
forEach - the logical foreach operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOForEach)

visit

protected void visit(LOGenerate g)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
g - the logical generate operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOGenerate)

visit

protected void visit(LogicalOperator op)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
op - the logical operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LogicalOperator)

visit

public void visit(LOGreaterThan op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOGreaterThan)

visit

public void visit(LOGreaterThanEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOGreaterThanEqual)

visit

public void visit(LOIsNull uniOp)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOIsNull)

visit

public void visit(LOLesserThan op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOLesserThan)

visit

public void visit(LOLesserThanEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOLesserThanEqual)

visit

protected void visit(LOLimit limOp)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOLimit)

visit

protected void visit(LOLoad load)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOLoad)

visit

public void visit(LOMapLookup op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOMapLookup)

visit

public void visit(LOMod op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOMod)

visit

public void visit(LOMultiply op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOMultiply)

visit

public void visit(LONegative op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LONegative)

visit

public void visit(LONot uniOp)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LONot)

visit

public void visit(LONotEqual op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LONotEqual)

visit

public void visit(LOOr binOp)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOOr)

visit

protected void visit(LOProject project)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOProject)

visit

protected void visit(LORegexp binOp)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
binOp - the logical regexp operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LORegexp)

visit

protected void visit(LOSort s)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
s - the logical sort operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOSort)

visit

protected void visit(LOSplit split)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
split - the logical split operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOSplit)

visit

protected void visit(LOSplitOutput sop)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOSplitOutput)

visit

protected void visit(LOStore store)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOStore)

visit

protected void visit(LOStream stream)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOStream)

visit

public void visit(LOSubtract op)
           throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOSubtract)

visit

protected void visit(LOUnion u)
              throws VisitorException
Overrides:
visit in class LOVisitor
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOUnion)

visit

protected void visit(LOUserFunc func)
              throws VisitorException
Description copied from class: LOVisitor
Iterate over each expression that is part of the function argument list

Overrides:
visit in class LOVisitor
Parameters:
func - the user defined function
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.LOUserFunc)

visit

protected void visit(UnaryExpressionOperator uniOp)
              throws VisitorException
Overrides:
visit in class LOVisitor
Parameters:
uniOp - the logical unary operator that has to be visited
Throws:
VisitorException
See Also:
LOVisitor.visit(org.apache.pig.impl.logicalLayer.UnaryExpressionOperator)


Copyright © ${year} The Apache Software Foundation