org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators
Class POForEach

java.lang.Object
  extended by org.apache.pig.impl.plan.Operator<PhyPlanVisitor>
      extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
          extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POForEach
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Operator>, Illustrable
Direct Known Subclasses:
POOptimizedForEach

public class POForEach
extends PhysicalOperator

See Also:
Serialized Form

Field Summary
protected  Object[] bags
           
protected  AccumulativeTupleBuffer buffer
           
protected  Object[] data
           
protected  Tuple inpTuple
           
protected  List<PhysicalPlan> inputPlans
           
protected  boolean[] isToBeFlattenedArray
           
protected  Iterator<Tuple>[] its
           
protected static TupleFactory mTupleFactory
           
protected  int noItems
           
protected  List<PhysicalOperator> opsToBeReset
           
protected  PhysicalOperator[] planLeafOps
           
protected  boolean processingPlan
           
protected  byte[] resultTypes
           
 
Fields inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
alias, dummyBag, dummyBool, dummyDBA, dummyDouble, dummyFloat, dummyInt, dummyLong, dummyMap, dummyString, dummyTuple, illustrator, input, inputAttached, inputs, lineageTracer, outputs, parentPlan, pigLogger, reporter, requestedParallelism, res, resultType
 
Fields inherited from class org.apache.pig.impl.plan.Operator
mKey
 
Constructor Summary
POForEach(OperatorKey k)
           
POForEach(OperatorKey k, int rp)
           
POForEach(OperatorKey k, int rp, List inp)
           
POForEach(OperatorKey k, int rp, List<PhysicalPlan> inp, List<Boolean> isToBeFlattened)
           
POForEach(OperatorKey k, List inp)
           
 
Method Summary
 void addInputPlan(PhysicalPlan plan, boolean flatten)
           
protected  void attachInputToPlans(Tuple t)
           
 POForEach clone()
          Make a deep copy of this operator.
protected  Tuple createTuple(Object[] data)
           
 List<PhysicalPlan> getInputPlans()
           
 void getLeaves()
           
 Result getNext(Tuple t)
          Calls getNext on the generate operator inside the nested physical plan and returns it maintaining an additional state to denote the begin and end of the nested plan processing.
 List<PhysicalOperator> getOpsToBeReset()
           
 List<Boolean> getToBeFlattened()
           
 Tuple illustratorMarkup(Object in, Object out, int eqClassIndex)
          input tuple mark up to be illustrate-able
 boolean inProcessing()
           
 String name()
           
protected  Result processPlan()
           
 void setAccumEnd()
           
 void setAccumStart()
           
 void setAccumulative()
           
 void setInputPlans(List<PhysicalPlan> plans)
           
 void setOpsToBeReset(List<PhysicalOperator> opsToBeReset)
           
 void setToBeFlattened(List<Boolean> flattens)
           
protected  void setUpFlattens(List<Boolean> isToBeFlattened)
           
 boolean supportsMultipleInputs()
          Indicates whether this operator supports multiple inputs.
 boolean supportsMultipleOutputs()
          Indicates whether this operator supports multiple outputs.
 void visit(PhyPlanVisitor v)
          Visit this node with the provided visitor.
 
Methods inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
attachInput, cloneHelper, detachInput, getAlias, getAliasString, getDummy, getIllustrator, getInputs, getLogger, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getPigLogger, getRequestedParallelism, getResultType, isAccumStarted, isAccumulative, isBlocking, isInputAttached, processInput, reset, setAlias, setIllustrator, setInputs, setParentPlan, setPigLogger, setReporter, setRequestedParallelism, setResultType
 
Methods inherited from class org.apache.pig.impl.plan.Operator
compareTo, equals, getOperatorKey, getProjectionMap, hashCode, regenerateProjectionMap, rewire, toString, unsetProjectionMap
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

inputPlans

protected List<PhysicalPlan> inputPlans

opsToBeReset

protected List<PhysicalOperator> opsToBeReset

mTupleFactory

protected static final TupleFactory mTupleFactory

processingPlan

protected boolean processingPlan

its

protected transient Iterator<Tuple>[] its

bags

protected Object[] bags

data

protected Object[] data

resultTypes

protected byte[] resultTypes

isToBeFlattenedArray

protected boolean[] isToBeFlattenedArray

noItems

protected int noItems

planLeafOps

protected PhysicalOperator[] planLeafOps

buffer

protected transient AccumulativeTupleBuffer buffer

inpTuple

protected Tuple inpTuple
Constructor Detail

POForEach

public POForEach(OperatorKey k)

POForEach

public POForEach(OperatorKey k,
                 int rp,
                 List inp)

POForEach

public POForEach(OperatorKey k,
                 int rp)

POForEach

public POForEach(OperatorKey k,
                 List inp)

POForEach

public POForEach(OperatorKey k,
                 int rp,
                 List<PhysicalPlan> inp,
                 List<Boolean> isToBeFlattened)
Method Detail

visit

public void visit(PhyPlanVisitor v)
           throws VisitorException
Description copied from class: Operator
Visit this node with the provided visitor. This should only be called by the visitor class itself, never directly.

Specified by:
visit in class PhysicalOperator
Parameters:
v - Visitor to visit with.
Throws:
VisitorException - if the visitor has a problem.

name

public String name()
Specified by:
name in class Operator<PhyPlanVisitor>

supportsMultipleInputs

public boolean supportsMultipleInputs()
Description copied from class: Operator
Indicates whether this operator supports multiple inputs.

Specified by:
supportsMultipleInputs in class Operator<PhyPlanVisitor>
Returns:
true if it does, otherwise false.

supportsMultipleOutputs

public boolean supportsMultipleOutputs()
Description copied from class: Operator
Indicates whether this operator supports multiple outputs.

Specified by:
supportsMultipleOutputs in class Operator<PhyPlanVisitor>
Returns:
true if it does, otherwise false.

setAccumulative

public void setAccumulative()
Overrides:
setAccumulative in class PhysicalOperator

setAccumStart

public void setAccumStart()
Overrides:
setAccumStart in class PhysicalOperator

setAccumEnd

public void setAccumEnd()
Overrides:
setAccumEnd in class PhysicalOperator

getNext

public Result getNext(Tuple t)
               throws ExecException
Calls getNext on the generate operator inside the nested physical plan and returns it maintaining an additional state to denote the begin and end of the nested plan processing.

Overrides:
getNext in class PhysicalOperator
Throws:
ExecException

processPlan

protected Result processPlan()
                      throws ExecException
Throws:
ExecException

createTuple

protected Tuple createTuple(Object[] data)
                     throws ExecException
Parameters:
data - array that is the template for the final flattened tuple
Returns:
the final flattened tuple
Throws:
ExecException

attachInputToPlans

protected void attachInputToPlans(Tuple t)

getLeaves

public void getLeaves()

getInputPlans

public List<PhysicalPlan> getInputPlans()

setInputPlans

public void setInputPlans(List<PhysicalPlan> plans)

addInputPlan

public void addInputPlan(PhysicalPlan plan,
                         boolean flatten)

setToBeFlattened

public void setToBeFlattened(List<Boolean> flattens)

getToBeFlattened

public List<Boolean> getToBeFlattened()

clone

public POForEach clone()
                throws CloneNotSupportedException
Make a deep copy of this operator.

Overrides:
clone in class PhysicalOperator
Throws:
CloneNotSupportedException
See Also:
Do not use the clone method directly. Operators are cloned when logical plans are cloned using {@link LogicalPlanCloner}

inProcessing

public boolean inProcessing()

setUpFlattens

protected void setUpFlattens(List<Boolean> isToBeFlattened)

getOpsToBeReset

public List<PhysicalOperator> getOpsToBeReset()
Returns:
the opsToBeReset

setOpsToBeReset

public void setOpsToBeReset(List<PhysicalOperator> opsToBeReset)
Parameters:
opsToBeReset - the opsToBeReset to set

illustratorMarkup

public Tuple illustratorMarkup(Object in,
                               Object out,
                               int eqClassIndex)
Description copied from interface: Illustrable
input tuple mark up to be illustrate-able

Parameters:
in - input tuple
out - output tuple before wrapped in ExampleTuple
eqClassIndex - index into equivalence classes in illustrator
Returns:
tuple


Copyright © ${year} The Apache Software Foundation