|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.impl.plan.Operator<LOVisitor>
org.apache.pig.impl.logicalLayer.LogicalOperator
public abstract class LogicalOperator
Parent for all Logical operators.
Field Summary | |
---|---|
protected String |
mAlias
Name of the record set that results from this operator. |
protected boolean |
mIsProjectionMapComputed
A boolean variable to remember if the projection map has been computed |
protected boolean |
mIsSchemaComputed
A boolean variable to remember if the schema has been computed |
protected LogicalPlan |
mPlan
Logical plan that this operator is a part of. |
protected ProjectionMap |
mProjectionMap
ProjectionMap of this operator. |
protected int |
mRequestedParallelism
Requested level of parallelism for this operation. |
protected Schema |
mSchema
Schema that defines the output of this operator. |
protected byte |
mType
Datatype of this output of this operator. |
Fields inherited from class org.apache.pig.impl.plan.Operator |
---|
mKey |
Constructor Summary | |
---|---|
LogicalOperator(LogicalPlan plan,
OperatorKey k)
Equivalent to LogicalOperator(k, 0). |
|
LogicalOperator(LogicalPlan plan,
OperatorKey k,
int rp)
|
Method Summary | |
---|---|
protected Object |
clone()
|
void |
forceSchema(Schema schema)
Directly force the schema without reconcilation Please use with great care |
String |
getAlias()
|
OperatorKey |
getOperatorKey()
Get the operator key for this operator. |
LogicalPlan |
getPlan()
|
int |
getRequestedParallelism()
|
abstract Schema |
getSchema()
Get a copy of the schema for the output of this operator. |
byte |
getType()
Get the type of this operator. |
protected void |
reconcileSchema(Schema schema)
Given a schema, reconcile it with our existing schema. |
Schema |
regenerateSchema()
Regenerate the schema by unsetting and getting the schema |
void |
setAlias(String newAlias)
|
void |
setCanonicalNames()
Calculate canonical names for all fields in the schema. |
void |
setPlan(LogicalPlan plan)
Change the reference to the plan for this operator. |
void |
setRequestedParallelism(int newRequestedParallelism)
|
void |
setSchema(Schema schema)
Set the output schema for this operator. |
void |
setSchemaComputed(boolean computed)
IMPORTANT: This method is only used for unit testing purpose. |
void |
setType(byte t)
Set the type of this operator. |
boolean |
supportsMultipleOutputs()
Indicates whether this operator supports multiple outputs. |
String |
toString()
|
void |
unsetSchema()
Unset the schema as if it had not been calculated. |
abstract void |
visit(LOVisitor v)
Visit this node with the provided visitor. |
Methods inherited from class org.apache.pig.impl.plan.Operator |
---|
compareTo, equals, getProjectionMap, hashCode, name, regenerateProjectionMap, rewire, supportsMultipleInputs, unsetProjectionMap |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Schema mSchema
protected boolean mIsSchemaComputed
protected byte mType
protected int mRequestedParallelism
protected String mAlias
protected LogicalPlan mPlan
protected ProjectionMap mProjectionMap
protected boolean mIsProjectionMapComputed
Constructor Detail |
---|
public LogicalOperator(LogicalPlan plan, OperatorKey k)
plan
- Logical plan this operator is a part of.k
- Operator key to assign to this node.public LogicalOperator(LogicalPlan plan, OperatorKey k, int rp)
plan
- Logical plan this operator is a part of.k
- Operator key to assign to this node.rp
- degree of requested parallelism with which to execute this
node.Method Detail |
---|
public OperatorKey getOperatorKey()
getOperatorKey
in class Operator<LOVisitor>
public void setSchema(Schema schema) throws FrontendException
schema
- Schema to set.
org.apache.pig.impl.logicalLayer.parser.ParseException
- if there is already a schema and the existing schema cannot
be reconciled with this new schema.
FrontendException
public void forceSchema(Schema schema)
schema
- public void unsetSchema() throws VisitorException
VisitorException
public Schema regenerateSchema() throws FrontendException, VisitorException
FrontendException
VisitorException
public void setCanonicalNames()
public abstract Schema getSchema() throws FrontendException
FrontendException
public final void setType(byte t)
t
- Type to set this operator to.public byte getType()
public String getAlias()
public void setAlias(String newAlias)
public int getRequestedParallelism()
public void setRequestedParallelism(int newRequestedParallelism)
public String toString()
toString
in class Operator<LOVisitor>
protected void reconcileSchema(Schema schema) throws org.apache.pig.impl.logicalLayer.parser.ParseException
schema
- Schema to reconcile with the existing.
org.apache.pig.impl.logicalLayer.parser.ParseException
- if the reconciliation is not possible.public abstract void visit(LOVisitor v) throws VisitorException
visit
in class Operator<LOVisitor>
v
- Visitor to visit with.
VisitException
- if the visitor has a problem.
VisitorException
- if the visitor has a problem.public LogicalPlan getPlan()
public void setPlan(LogicalPlan plan)
public void setSchemaComputed(boolean computed)
public boolean supportsMultipleOutputs()
Operator
supportsMultipleOutputs
in class Operator<LOVisitor>
protected Object clone() throws CloneNotSupportedException
clone
in class Operator<LOVisitor>
CloneNotSupportedException
Do not use the clone method directly. Operators are cloned when logical plans
are cloned using {@link LogicalPlanCloner}
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |