|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pig.newplan.BaseOperatorPlan
public abstract class BaseOperatorPlan
| Field Summary | |
|---|---|
protected PlanEdge |
fromEdges
|
protected static org.apache.commons.logging.Log |
log
|
protected List<Operator> |
ops
|
protected PlanEdge |
softFromEdges
|
protected PlanEdge |
softToEdges
|
protected PlanEdge |
toEdges
|
| Constructor Summary | |
|---|---|
BaseOperatorPlan()
|
|
BaseOperatorPlan(BaseOperatorPlan other)
|
|
| 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. |
void |
createSoftLink(Operator from,
Operator to)
Create an soft edge between two nodes. |
Pair<Integer,Integer> |
disconnect(Operator from,
Operator to)
Disconnect two operators in the plan. |
void |
explain(PrintStream ps,
String format,
boolean verbose)
|
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> |
getSoftLinkPredecessors(Operator op)
For a given operator, get all operators softly immediately before it in the plan. |
List<Operator> |
getSoftLinkSuccessors(Operator op)
For a given operator, get all operators softly immediately after it. |
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. |
void |
insertBetween(Operator pred,
Operator operatorToInsert,
Operator succ)
This method insert node operatorToInsert between pred and succ. |
boolean |
isConnected(Operator from,
Operator to)
Check if given two operators are directly connected. |
boolean |
isEqual(OperatorPlan other)
This is like a shallow comparison. |
protected static boolean |
isEqual(OperatorPlan p1,
OperatorPlan p2)
|
boolean |
pathExists(Operator from,
Operator to)
A method to check if there is a path from a given node to another node |
void |
remove(Operator op)
Remove an operator from the plan. |
void |
removeAndReconnect(Operator operatorToRemove)
This method remove a node operatorToRemove. |
void |
removeSoftLink(Operator from,
Operator to)
Remove an soft edge |
void |
replace(Operator oldOperator,
Operator newOperator)
This method replace the oldOperator with the newOperator, make all connection to the new operator in the place of old operator |
int |
size()
Get number of nodes in the plan. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected List<Operator> ops
protected PlanEdge fromEdges
protected PlanEdge toEdges
protected PlanEdge softFromEdges
protected PlanEdge softToEdges
protected static final org.apache.commons.logging.Log log
| Constructor Detail |
|---|
public BaseOperatorPlan()
public BaseOperatorPlan(BaseOperatorPlan other)
| Method Detail |
|---|
public int size()
size in interface OperatorPlanpublic List<Operator> getSources()
getSources in interface OperatorPlanpublic List<Operator> getSinks()
getSinks in interface OperatorPlanpublic List<Operator> getPredecessors(Operator op)
getPredecessors in interface OperatorPlanop - operator to fetch predecessors of
public List<Operator> getSuccessors(Operator op)
getSuccessors in interface OperatorPlanop - operator to fetch successors of
public List<Operator> getSoftLinkPredecessors(Operator op)
getSoftLinkPredecessors in interface OperatorPlanop - operator to fetch predecessors of
public List<Operator> getSoftLinkSuccessors(Operator op)
getSoftLinkSuccessors in interface OperatorPlanop - operator to fetch successors of
public void add(Operator op)
add in interface OperatorPlanop - operator to add
public void remove(Operator op)
throws FrontendException
remove in interface OperatorPlanop - Operator to be removed
FrontendException - if the remove operation attempts to
remove an operator that is still connected to other operators.
public void connect(Operator from,
int fromPos,
Operator to,
int toPos)
connect in interface OperatorPlanfrom - 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 edge
public boolean isConnected(Operator from,
Operator to)
from - Operator edge will come fromto - Operator edge will go to
public void connect(Operator from,
Operator to)
connect in interface OperatorPlanfrom - Operator edge will come fromto - Operator edge will go to
public void createSoftLink(Operator from,
Operator to)
createSoftLink in interface OperatorPlanfrom - Operator dependent uponto - Operator having the dependency
public void removeSoftLink(Operator from,
Operator to)
removeSoftLink in interface OperatorPlanfrom - Operator dependent uponto - Operator having the dependency
public Pair<Integer,Integer> disconnect(Operator from,
Operator to)
throws FrontendException
disconnect in interface OperatorPlanfrom - Operator edge is coming fromto - Operator edge is going to
FrontendException - if the two operators aren't connected.public Iterator<Operator> getOperators()
OperatorPlan
getOperators in interface OperatorPlan
public boolean isEqual(OperatorPlan other)
throws FrontendException
OperatorPlan
isEqual in interface OperatorPlanother - object to compare
FrontendException
protected static boolean isEqual(OperatorPlan p1,
OperatorPlan p2)
throws FrontendException
FrontendException
public void explain(PrintStream ps,
String format,
boolean verbose)
throws FrontendException
FrontendExceptionpublic String toString()
toString in class Object
public void replace(Operator oldOperator,
Operator newOperator)
throws FrontendException
OperatorPlan
replace in interface OperatorPlanoldOperator - operator to be replacednewOperator - operator to replace
FrontendException
public void removeAndReconnect(Operator operatorToRemove)
throws FrontendException
OperatorPlan
removeAndReconnect in interface OperatorPlanoperatorToRemove - operator to remove
FrontendException
public void insertBetween(Operator pred,
Operator operatorToInsert,
Operator succ)
throws FrontendException
OperatorPlan
insertBetween in interface OperatorPlanpred - predecessor of inserted node after this methodoperatorToInsert - operato to insertsucc - successor of inserted node after this method
FrontendException
public boolean pathExists(Operator from,
Operator to)
pathExists in interface OperatorPlanfrom - the start node for checkingto - the end node for checking
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||