|
||||||||||
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.
Field Summary | |
---|---|
protected String |
alias
|
protected static DataBag |
dummyBag
|
protected static Boolean |
dummyBool
|
protected static DataByteArray |
dummyDBA
|
protected static Double |
dummyDouble
|
protected static Float |
dummyFloat
|
protected static Integer |
dummyInt
|
protected static Long |
dummyLong
|
protected static Map |
dummyMap
|
protected static String |
dummyString
|
protected static Tuple |
dummyTuple
|
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
|
static PigProgressable |
reporter
|
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 |
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()
|
static Object |
getDummy(byte dataType)
|
Illustrator |
getIllustrator()
|
List<PhysicalOperator> |
getInputs()
|
org.apache.commons.logging.Log |
getLogger()
|
Result |
getNext(Boolean b)
|
Result |
getNext(DataBag db)
|
Result |
getNext(DataByteArray ba)
|
Result |
getNext(Double d)
|
Result |
getNext(Float f)
|
Result |
getNext(Integer i)
|
Result |
getNext(Long l)
|
Result |
getNext(Map m)
|
Result |
getNext(Object obj,
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 |
getNext(String s)
|
Result |
getNext(Tuple t)
|
static PigLogger |
getPigLogger()
|
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 |
setAlias(String alias)
|
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
public static PigProgressable reporter
protected static PigLogger pigLogger
protected static final DataByteArray dummyDBA
protected static final String dummyString
protected static final Double dummyDouble
protected static final Float dummyFloat
protected static final Integer dummyInt
protected static final Long dummyLong
protected static final Boolean dummyBool
protected static final Tuple dummyTuple
protected static final DataBag dummyBag
protected static final Map dummyMap
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 setAlias(String alias)
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(Object obj, byte dataType) throws ExecException
obj
- The object we are working with. Its class should correspond to DataTypedataType
- Describes the type of obj; a byte from DataType.
ExecException
public static Object getDummy(byte dataType) throws ExecException
ExecException
public Result getNext(Integer i) throws ExecException
ExecException
public Result getNext(Long l) throws ExecException
ExecException
public Result getNext(Double d) throws ExecException
ExecException
public Result getNext(Float f) throws ExecException
ExecException
public Result getNext(String s) throws ExecException
ExecException
public Result getNext(DataByteArray ba) throws ExecException
ExecException
public Result getNext(Map m) throws ExecException
ExecException
public Result getNext(Boolean b) throws ExecException
ExecException
public Result getNext(Tuple t) throws ExecException
ExecException
public Result getNext(DataBag db) throws ExecException
ExecException
public void reset()
public static void setReporter(PigProgressable reporter)
public 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 |