|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.impl.plan.Operator<PhyPlanVisitor>
org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator
public abstract class PhysicalOperator
This is the base class for all operators. This supports a generic way of processing inputs which can be overridden by operators extending this class. The input model assumes that it can either be taken from an operator or can be attached directly to this operator. Also it is assumed that inputs to an operator are always in the form of a tuple. For this pipeline rework, we assume a pull based model, i.e, the root operator is going to call getNext with the appropriate type which initiates a cascade of getNext calls that unroll to create input for the root operator to work on. Any operator that extends the PhysicalOperator, supports a getNext with all the different types of parameter types. The concrete implementation should use the result type of its input operator to decide the type of getNext's parameter. This is done to avoid switch/case based on the type as much as possible. The default is assumed to return an erroneus Result corresponding to an unsupported operation on that type. So the operators need to implement only those types that are supported.
Nested Class Summary | |
---|---|
static class |
PhysicalOperator.OriginalLocation
|
Field Summary | |
---|---|
protected String |
alias
|
protected Illustrator |
illustrator
|
protected Tuple |
input
|
protected boolean |
inputAttached
|
protected List<PhysicalOperator> |
inputs
|
protected LineageTracer |
lineageTracer
|
protected List<PhysicalOperator> |
outputs
|
protected PhysicalPlan |
parentPlan
|
protected static PigLogger |
pigLogger
|
protected int |
requestedParallelism
|
protected Result |
res
|
protected byte |
resultType
|
protected static long |
serialVersionUID
|
Fields inherited from class org.apache.pig.impl.plan.Operator |
---|
mKey |
Constructor Summary | |
---|---|
PhysicalOperator(OperatorKey k)
|
|
PhysicalOperator(OperatorKey k,
int rp)
|
|
PhysicalOperator(OperatorKey k,
int rp,
List<PhysicalOperator> inp)
|
|
PhysicalOperator(OperatorKey k,
List<PhysicalOperator> inp)
|
Method Summary | |
---|---|
void |
addOriginalLocation(String alias,
List<PhysicalOperator.OriginalLocation> originalLocations)
|
void |
addOriginalLocation(String alias,
SourceLocation sourceLocation)
|
void |
attachInput(Tuple t)
Shorts the input path of this operator by providing the input tuple directly |
PhysicalOperator |
clone()
Make a deep copy of this operator. |
protected void |
cloneHelper(PhysicalOperator op)
|
void |
detachInput()
Detaches any tuples that are attached |
String |
getAlias()
|
protected String |
getAliasString()
|
Illustrator |
getIllustrator()
|
List<PhysicalOperator> |
getInputs()
|
org.apache.commons.logging.Log |
getLogger()
|
Result |
getNext(byte dataType)
Implementations that call into the different versions of getNext are often identical, differing only in the signature of the getNext() call they make. |
Result |
getNextBigDecimal()
|
Result |
getNextBigInteger()
|
Result |
getNextBoolean()
|
Result |
getNextDataBag()
|
Result |
getNextDataByteArray()
|
Result |
getNextDateTime()
|
Result |
getNextDouble()
|
Result |
getNextFloat()
|
Result |
getNextInteger()
|
Result |
getNextLong()
|
Result |
getNextMap()
|
Result |
getNextString()
|
Result |
getNextTuple()
|
List<PhysicalOperator.OriginalLocation> |
getOriginalLocations()
|
static PigLogger |
getPigLogger()
|
static PigProgressable |
getReporter()
|
int |
getRequestedParallelism()
|
byte |
getResultType()
|
boolean |
isAccumStarted()
|
boolean |
isAccumulative()
|
boolean |
isBlocking()
A blocking operator should override this to return true. |
boolean |
isInputAttached()
|
Result |
processInput()
A generic method for parsing input that either returns the attached input if it exists or fetches it from its predecessor. |
void |
reset()
Reset internal state in an operator. |
void |
setAccumEnd()
|
void |
setAccumStart()
|
void |
setAccumulative()
|
void |
setIllustrator(Illustrator illustrator)
|
void |
setInputs(List<PhysicalOperator> inputs)
|
void |
setParentPlan(PhysicalPlan physicalPlan)
|
static void |
setPigLogger(PigLogger logger)
|
static void |
setReporter(PigProgressable reporter)
|
void |
setRequestedParallelism(int requestedParallelism)
|
void |
setResultType(byte resultType)
|
abstract void |
visit(PhyPlanVisitor v)
Visit this node with the provided visitor. |
Methods inherited from class org.apache.pig.impl.plan.Operator |
---|
compareTo, equals, getOperatorKey, getProjectionMap, hashCode, name, regenerateProjectionMap, rewire, supportsMultipleInputs, supportsMultipleOutputs, toString, unsetProjectionMap |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.pig.pen.Illustrable |
---|
illustratorMarkup |
Field Detail |
---|
protected static final long serialVersionUID
protected int requestedParallelism
protected List<PhysicalOperator> inputs
protected List<PhysicalOperator> outputs
protected byte resultType
protected PhysicalPlan parentPlan
protected boolean inputAttached
protected Tuple input
protected Result res
protected String alias
protected static PigLogger pigLogger
protected LineageTracer lineageTracer
protected transient Illustrator illustrator
Constructor Detail |
---|
public PhysicalOperator(OperatorKey k)
public PhysicalOperator(OperatorKey k, int rp)
public PhysicalOperator(OperatorKey k, List<PhysicalOperator> inp)
public PhysicalOperator(OperatorKey k, int rp, List<PhysicalOperator> inp)
Method Detail |
---|
public void setIllustrator(Illustrator illustrator)
setIllustrator
in interface Illustrable
public Illustrator getIllustrator()
public int getRequestedParallelism()
public void setRequestedParallelism(int requestedParallelism)
public byte getResultType()
public String getAlias()
protected String getAliasString()
public void addOriginalLocation(String alias, SourceLocation sourceLocation)
public void addOriginalLocation(String alias, List<PhysicalOperator.OriginalLocation> originalLocations)
public List<PhysicalOperator.OriginalLocation> getOriginalLocations()
public void setAccumulative()
public boolean isAccumulative()
public void setAccumStart()
public boolean isAccumStarted()
public void setAccumEnd()
public void setResultType(byte resultType)
public List<PhysicalOperator> getInputs()
public void setInputs(List<PhysicalOperator> inputs)
public boolean isInputAttached()
public void attachInput(Tuple t)
t
- -
The tuple that should be used as inputpublic void detachInput()
public boolean isBlocking()
public Result processInput() throws ExecException
ExecException
public abstract void visit(PhyPlanVisitor v) throws VisitorException
Operator
visit
in class Operator<PhyPlanVisitor>
v
- Visitor to visit with.
VisitorException
- if the visitor has a problem.public Result getNext(byte dataType) throws ExecException
dataType
- Describes the type of obj; a byte from DataType.
ExecException
public Result getNextInteger() throws ExecException
ExecException
public Result getNextLong() throws ExecException
ExecException
public Result getNextDouble() throws ExecException
ExecException
public Result getNextFloat() throws ExecException
ExecException
public Result getNextDateTime() throws ExecException
ExecException
public Result getNextString() throws ExecException
ExecException
public Result getNextDataByteArray() throws ExecException
ExecException
public Result getNextMap() throws ExecException
ExecException
public Result getNextBoolean() throws ExecException
ExecException
public Result getNextTuple() throws ExecException
ExecException
public Result getNextDataBag() throws ExecException
ExecException
public Result getNextBigInteger() throws ExecException
ExecException
public Result getNextBigDecimal() throws ExecException
ExecException
public void reset()
public static PigProgressable getReporter()
public static void setReporter(PigProgressable reporter)
reporter
- PigProgressable to be stored in threadlocalpublic PhysicalOperator clone() throws CloneNotSupportedException
clone
in class Operator<PhyPlanVisitor>
CloneNotSupportedException
Do not use the clone method directly. Operators are cloned when logical plans
are cloned using {@link LogicalPlanCloner}
protected void cloneHelper(PhysicalOperator op)
public void setParentPlan(PhysicalPlan physicalPlan)
physicalPlan
- public org.apache.commons.logging.Log getLogger()
public static void setPigLogger(PigLogger logger)
public static PigLogger getPigLogger()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |