|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.experimental.plan.OperatorSubPlan
public class OperatorSubPlan
Class to represent a view of a plan. The view contains a subset of the plan. All the operators returned from the view are the same objects to the operators in its base plan. It is used to represent match results.
Constructor Summary | |
---|---|
OperatorSubPlan(OperatorPlan base)
|
Method Summary | |
---|---|
void |
add(Operator op)
Add a new operator to the plan. |
void |
connect(Operator from,
int fromPos,
Operator to,
int toPos)
Connect two operators in the plan, controlling which position in the edge lists that the from and to edges are placed. |
void |
connect(Operator from,
Operator to)
Connect two operators in the plan. |
Pair<Integer,Integer> |
disconnect(Operator from,
Operator to)
Disconnect two operators in the plan. |
OperatorPlan |
getBasePlan()
|
Iterator<Operator> |
getOperators()
Get an iterator of all operators in this plan |
List<Operator> |
getPredecessors(Operator op)
For a given operator, get all operators immediately before it in the plan. |
List<Operator> |
getSinks()
Get all operators in the plan that have no successors. |
List<Operator> |
getSources()
Get all operators in the plan that have no predecessors. |
List<Operator> |
getSuccessors(Operator op)
For a given operator, get all operators immediately after it. |
boolean |
isEqual(OperatorPlan other)
This is like a shallow comparison. |
void |
remove(Operator op)
Remove an operator from the plan. |
int |
size()
Get number of nodes in the plan. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OperatorSubPlan(OperatorPlan base)
Method Detail |
---|
public OperatorPlan getBasePlan()
public void add(Operator op)
OperatorPlan
add
in interface OperatorPlan
op
- operator to addpublic void connect(Operator from, int fromPos, Operator to, int toPos)
OperatorPlan
connect
in interface OperatorPlan
from
- Operator edge will come fromfromPos
- Position in the array for the from edgeto
- Operator edge will go totoPos
- Position in the array for the to edgepublic void connect(Operator from, Operator to)
OperatorPlan
connect
in interface OperatorPlan
from
- Operator edge will come fromto
- Operator edge will go topublic Pair<Integer,Integer> disconnect(Operator from, Operator to) throws IOException
OperatorPlan
disconnect
in interface OperatorPlan
from
- Operator edge is coming fromto
- Operator edge is going to
IOException
- if the two operators aren't connected.public List<Operator> getSinks()
OperatorPlan
getSinks
in interface OperatorPlan
public Iterator<Operator> getOperators()
OperatorPlan
getOperators
in interface OperatorPlan
public List<Operator> getPredecessors(Operator op) throws IOException
OperatorPlan
getPredecessors
in interface OperatorPlan
op
- operator to fetch predecessors of
IOException
- if op is not in the plan.public List<Operator> getSources()
OperatorPlan
getSources
in interface OperatorPlan
public List<Operator> getSuccessors(Operator op) throws IOException
OperatorPlan
getSuccessors
in interface OperatorPlan
op
- operator to fetch successors of
IOException
- if op is not in the plan.public void remove(Operator op) throws IOException
OperatorPlan
remove
in interface OperatorPlan
op
- Operator to be removed
IOException
- if the remove operation attempts to
remove an operator that is still connected to other operators.public int size()
OperatorPlan
size
in interface OperatorPlan
public boolean isEqual(OperatorPlan other)
OperatorPlan
isEqual
in interface OperatorPlan
other
- object to compare
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |