|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.tools.AbstractObservable<ExecutionUnit>
com.rapidminer.operator.ExecutionUnit
public class ExecutionUnit
A process is a collection of operators whose ports can be wired. A process provides input and output ports to its contained operators. ExecutionUnit replaces the legacy OperatorChain. This class takes care of executing the operators in the correct order by sorting them topologically with respect to their dependencies.
| Constructor Summary | |
|---|---|
ExecutionUnit(OperatorChain enclosingOperator,
java.lang.String name)
|
|
| Method Summary | |
|---|---|
int |
addOperator(Operator operator)
Same as addOperator(Operator, boolean). |
int |
addOperator(Operator operator,
boolean registerWithProcess)
Adds the operator to this execution unit. |
void |
addOperator(Operator operator,
int index)
Adds the operator to this execution unit. |
void |
autoWire(CompatibilityLevel level,
boolean keepConnections,
boolean recursive)
Connects the ports automatically in a first-fit approach. |
void |
autoWireSingle(Operator operator,
CompatibilityLevel level,
boolean inputs,
boolean outputs)
Automatically wires inputs and outputs of a single operator in this execution unit. |
void |
bringToFront(java.util.Collection<Operator> movedOperators,
Operator insertAfter)
Re-arranges the execution order such that the specified operators immediately follow insertAfter. |
void |
clear(int clearFlags)
|
void |
cloneExecutionUnitFrom(ExecutionUnit original,
boolean forParallelExecution)
Clones operators contained in original, adds them
to this execution unit and wires them as they were originally. |
protected java.lang.String |
createProcessTree(int indent,
java.lang.String selfPrefix,
java.lang.String childPrefix,
Operator markOperator,
java.lang.String mark)
|
void |
execute()
Executes the inner operators. |
void |
freeMemory()
Frees memory used by inner sinks. |
java.util.List<Operator> |
getAllInnerOperators()
Recursively returns all nested operators. |
java.util.Collection<OutputPort> |
getAllOutputPorts()
Returns a list of all available output ports within this process, including inner sources and output ports of enclosed operators. |
java.util.Collection<Operator> |
getChildOperators()
Returns all nested operators. |
java.util.List<Operator> |
getEnabledOperators()
Returns an unmodifiable view of the operators contained in this process. |
OperatorChain |
getEnclosingOperator()
Returns the operator that contains this process as a subprocess. |
int |
getIndexOfOperator(Operator operator)
|
InputPorts |
getInnerSinks()
|
OutputPorts |
getInnerSources()
|
java.lang.String |
getName()
|
int |
getNumberOfOperators()
|
Operator |
getOperatorByName(java.lang.String toOp)
|
java.util.Enumeration<Operator> |
getOperatorEnumeration()
Use this method only in cases where you are sure that you don't want a ConcurrentModificationException to occur when the list of operators is modified. |
java.util.List<Operator> |
getOperators()
Returns an unmodifiable view of the operators contained in this process. |
boolean |
isExpanded()
Returns true if this operator should be painted expanded. |
void |
moveToIndex(Operator op,
int newIndex)
Moves an operator to the given index. |
void |
processFinished()
|
void |
processStarts()
|
protected void |
removeOperator(Operator operator)
Removes the given operator. |
void |
setExpanded(boolean expanded)
Sets the expansion mode which indicates if this operator is drawn expanded or not. |
void |
setName(java.lang.String name)
|
int |
stealOperatorsFrom(ExecutionUnit otherUnit)
Moves the operators from this process to another process, keeping all connections intact. |
java.util.Vector<Operator> |
topologicalSort()
Sorts the operators topologically, i.e. such that operator i in the returned ordering has dependencies (i.e. connected InputPorts) only
from operators 0..i-1. |
void |
transformMetaData()
|
protected void |
updateExecutionOrder()
|
| Methods inherited from class com.rapidminer.tools.AbstractObservable |
|---|
addObserver, addObserverAsFirst, fireUpdate, fireUpdate, removeObserver |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExecutionUnit(OperatorChain enclosingOperator,
java.lang.String name)
| Method Detail |
|---|
public InputPorts getInnerSinks()
public OutputPorts getInnerSources()
public int addOperator(Operator operator)
addOperator(Operator, boolean).
public int addOperator(Operator operator,
boolean registerWithProcess)
registerWithProcess - Typically true. If false, the operator will not be registered with its parent process.
public void addOperator(Operator operator,
int index)
public int getIndexOfOperator(Operator operator)
protected void removeOperator(Operator operator)
Operator.remove().
public void clear(int clearFlags)
public java.util.Vector<Operator> topologicalSort()
InputPorts) only
from operators 0..i-1.
protected void updateExecutionOrder()
public void transformMetaData()
public java.util.List<Operator> getOperators()
public java.util.Enumeration<Operator> getOperatorEnumeration()
public java.util.List<Operator> getEnabledOperators()
public java.lang.String getName()
public void setName(java.lang.String name)
public OperatorChain getEnclosingOperator()
public void autoWire(CompatibilityLevel level,
boolean keepConnections,
boolean recursive)
throws PortException
operators list.
Every input of every operator is connected to the first compatible output
of an operator "left" of this operator. This corresponds to the way,
IOObjects were consumed in the pre-5.0 version. Disabled operators
are skipped.
level - If level is CompatibilityLevel.VERSION_5, an input
is considered compatible only if it satisfies all meta data
constraints. For CompatibilityLevel.PRE_VERSION_5 we
only consider the classes.keepConnections - if true, don't unwire old connections before rewiring.
PortException
public void autoWireSingle(Operator operator,
CompatibilityLevel level,
boolean inputs,
boolean outputs)
inputs - Wire inputs?outputs - Wire outputs?public java.util.Collection<OutputPort> getAllOutputPorts()
public Operator getOperatorByName(java.lang.String toOp)
public int getNumberOfOperators()
public void cloneExecutionUnitFrom(ExecutionUnit original,
boolean forParallelExecution)
original, adds them
to this execution unit and wires them as they were originally.
forParallelExecution - Indicates whether this clone is supposed
to be executed in parallel. If yes, the clone will not be
registered with the parent process and will share its
Operator.applyCount with the original.public java.util.Collection<Operator> getChildOperators()
public java.util.List<Operator> getAllInnerOperators()
protected java.lang.String createProcessTree(int indent,
java.lang.String selfPrefix,
java.lang.String childPrefix,
Operator markOperator,
java.lang.String mark)
public void execute()
throws OperatorException
OperatorExceptionpublic void freeMemory()
public void setExpanded(boolean expanded)
public boolean isExpanded()
public void processStarts()
throws OperatorException
OperatorException
public void processFinished()
throws OperatorException
OperatorExceptionpublic int stealOperatorsFrom(ExecutionUnit otherUnit)
public void moveToIndex(Operator op,
int newIndex)
public void bringToFront(java.util.Collection<Operator> movedOperators,
Operator insertAfter)
insertAfter.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||