org.apache.pig.impl.plan
Class Operator<V extends PlanVisitor>

java.lang.Object
  extended by org.apache.pig.impl.plan.Operator<V>
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Operator>
Direct Known Subclasses:
LogicalOperator, MapReduceOper, PhysicalOperator

public abstract class Operator<V extends PlanVisitor>
extends Object
implements Serializable, Comparable<Operator>, Cloneable

Base class for all types of operators.

See Also:
Serialized Form

Field Summary
protected  OperatorKey mKey
          OperatorKey associated with this operator.
 
Constructor Summary
Operator(OperatorKey k)
           
 
Method Summary
protected  Object clone()
           
 int compareTo(Operator o)
           
 boolean equals(Object obj)
          Compares to Operators based on their opKey
 OperatorKey getOperatorKey()
          Get the operator key for this operator.
 int hashCode()
          Needed to ensure that the list iterators' outputs are deterministic.
abstract  String name()
           
abstract  boolean supportsMultipleInputs()
          Indicates whether this operator supports multiple inputs.
abstract  boolean supportsMultipleOutputs()
          Indicates whether this operator supports multiple outputs.
 String toString()
           
abstract  void visit(V v)
          Visit this node with the provided visitor.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mKey

protected OperatorKey mKey
OperatorKey associated with this operator. This key is used to find the operator in an OperatorPlan.

Constructor Detail

Operator

public Operator(OperatorKey k)
Parameters:
k - Operator key to assign to this node.
Method Detail

getOperatorKey

public OperatorKey getOperatorKey()
Get the operator key for this operator.


visit

public abstract void visit(V v)
                    throws VisitorException
Visit this node with the provided visitor. This should only be called by the visitor class itself, never directly.

Parameters:
v - Visitor to visit with.
Throws:
VisitorException - if the visitor has a problem.

supportsMultipleInputs

public abstract boolean supportsMultipleInputs()
Indicates whether this operator supports multiple inputs.

Returns:
true if it does, otherwise false.

supportsMultipleOutputs

public abstract boolean supportsMultipleOutputs()
Indicates whether this operator supports multiple outputs.

Returns:
true if it does, otherwise false.

name

public abstract String name()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Compares to Operators based on their opKey

Overrides:
equals in class Object

hashCode

public int hashCode()
Needed to ensure that the list iterators' outputs are deterministic. Without this we are totally at object id's mercy.

Overrides:
hashCode in class Object

compareTo

public int compareTo(Operator o)
Specified by:
compareTo in interface Comparable<Operator>

clone

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


Copyright © ${year} The Apache Software Foundation