org.apache.pig.newplan
Class Operator

java.lang.Object
  extended by org.apache.pig.newplan.Operator
Direct Known Subclasses:
JobStats, LogicalExpression, LogicalRelationalOperator, PatternNode

public abstract class Operator
extends Object


Field Summary
protected  Map<String,Object> annotations
           
protected  int hashPrime
           
protected  SourceLocation location
           
protected  String name
           
protected  OperatorPlan plan
           
 
Constructor Summary
Operator(String n, OperatorPlan p)
           
 
Method Summary
abstract  void accept(PlanVisitor v)
          Accept a visitor at this node in the graph.
 void annotate(String key, Object val)
          Add an annotation to a node in the plan.
 Object getAnnotation(String key)
          Look to see if a node is annotated.
 SourceLocation getLocation()
           
 String getName()
           
 OperatorPlan getPlan()
          Get the plan associated with this operator.
abstract  boolean isEqual(Operator operator)
          This is like a shallow equals comparison.
 Object removeAnnotation(String key)
          Remove an annotation
 void setLocation(SourceLocation loc)
           
 void setPlan(OperatorPlan p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

location

protected SourceLocation location

name

protected String name

plan

protected OperatorPlan plan

annotations

protected Map<String,Object> annotations

hashPrime

protected final int hashPrime
See Also:
Constant Field Values
Constructor Detail

Operator

public Operator(String n,
                OperatorPlan p)
Method Detail

accept

public abstract void accept(PlanVisitor v)
                     throws FrontendException
Accept a visitor at this node in the graph.

Parameters:
v - Visitor to accept.
Throws:
FrontendException

getName

public String getName()

getLocation

public SourceLocation getLocation()

setLocation

public void setLocation(SourceLocation loc)

getPlan

public OperatorPlan getPlan()
Get the plan associated with this operator.

Returns:
plan

annotate

public void annotate(String key,
                     Object val)
Add an annotation to a node in the plan.

Parameters:
key - string name of this annotation
val - value, as an Object

getAnnotation

public Object getAnnotation(String key)
Look to see if a node is annotated.

Parameters:
key - string name of annotation to look for
Returns:
value of the annotation, as an Object, or null if the key is not present in the map.

removeAnnotation

public Object removeAnnotation(String key)
Remove an annotation

Parameters:
key - the key of the annotation
Returns:
the original value of the annotation

setPlan

public void setPlan(OperatorPlan p)

isEqual

public abstract boolean isEqual(Operator operator)
                         throws FrontendException
This is like a shallow equals comparison. It returns true if two operators have equivalent properties even if they are different objects. Here properties mean equivalent plan and equivalent name.

Parameters:
operator -
Returns:
true if two object have equivalent properties, else false
Throws:
FrontendException


Copyright © 2007-2012 The Apache Software Foundation