java.lang.Object
com.pervasive.datarush.operators.AbstractLogicalOperator
com.pervasive.datarush.operators.CompositeOperator
com.pervasive.datarush.operators.OpenComposite
- All Implemented Interfaces:
PropertyValued,LogicalOperator,OperatorComposable
A composite operator that can be externally composed. This is a convenient way to
create a grouping of nodes without needing to subclass
CompositeOperator.-
Constructor Summary
ConstructorsConstructorDescriptionOpenComposite(int numInputs, int numOutputs) Create an open composite whose input ports and output ports are all of type record.OpenComposite(List<? extends LogicalPortFactory<?>> inputs, List<? extends LogicalPortFactory<?>> outputs) Create an open composite whose input ports and output ports are of arbitrary types. -
Method Summary
Modifier and TypeMethodDescriptionfinal <O extends LogicalOperator>
Oadd(O op) Add a LogicalOperator to this graph, using the short class name as the name of the operator.final <O extends LogicalOperator>
Oadd(O op, OperatorSettings settings) Add a LogicalOperator to this graph, specifying advanced operator settings.final <O extends LogicalOperator>
OAdd a LogicalOperator to this graph, specifying a name of the operator.protected final voidThis implementation of compose adds any operators were added to this to the provided composition context and creates any connections that were added to this in the provided composition context.final voidconnect(LogicalPort from, LogicalPort to) Connect two ports together.voidconnectInput(int index, LogicalPort to) voidconnectOutput(LogicalPort from, int index) final LogicalPortgetInput(int index) Returns the input port of the given port indexfinal LogicalPortgetOutput(int index) Returns the output port of the given port indexfinal ObjectgetProperty(GraphPath path) Returns a property of the given path.final ObjectgetProperty(String path) Returns a property of the given path.final voidsetProperty(GraphPath path, Object value) Sets a property of the given path.final voidsetProperty(String path, Object value) Sets a property of the given path.Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Constructor Details
-
OpenComposite
public OpenComposite(List<? extends LogicalPortFactory<?>> inputs, List<? extends LogicalPortFactory<?>> outputs) Create an open composite whose input ports and output ports are of arbitrary types. Following construction, callers must create the body by callingaddandconnect.- Parameters:
inputs- the factories for each of the input portsoutputs- the factories for each of the output ports.
-
OpenComposite
public OpenComposite(int numInputs, int numOutputs) Create an open composite whose input ports and output ports are all of type record. Following construction, callers must create the body by callingaddandconnect.- Parameters:
numInputs- the number of record inputsnumOutputs- the number of record outputs
-
-
Method Details
-
getInput
Returns the input port of the given port index- Parameters:
index- the port index- Returns:
- the input port
-
getOutput
Returns the output port of the given port index- Parameters:
index- the port index- Returns:
- the output port
-
connectOutput
-
connectInput
-
compose
This implementation of compose adds any operators were added to this to the provided composition context and creates any connections that were added to this in the provided composition context.- Specified by:
composein classCompositeOperator- Parameters:
ctx- the context
-
add
Description copied from interface:OperatorComposableAdd a LogicalOperator to this graph, using the short class name as the name of the operator.- Specified by:
addin interfaceOperatorComposable- Type Parameters:
O- the type of the operator.- Parameters:
op- the operator to add to the graph.- Returns:
- the same operator that was passed to this method
-
add
Description copied from interface:OperatorComposableAdd a LogicalOperator to this graph, specifying a name of the operator.- Specified by:
addin interfaceOperatorComposable- Type Parameters:
O- the type of the operator.- Parameters:
op- the operator to add to the graph.name- the name of the the operator- Returns:
- the same operator that was passed to this method
-
add
Description copied from interface:OperatorComposableAdd a LogicalOperator to this graph, specifying advanced operator settings.- Specified by:
addin interfaceOperatorComposable- Type Parameters:
O- the type of the operator.- Parameters:
op- the operator to add to the graph.settings- operators settings, contains name and other configuration options.- Returns:
- the same operator that was passed to this method
-
connect
Description copied from interface:OperatorComposableConnect two ports together. Depending in the specific context, the source and target operators may be one of the following pairs:- From an output port of an operator that was added to this context to an input port of an operator that was added to this context
- From an input port of the
CompositeOperatorto an input port of an operator that was added to this context. (Applies toCompositeOperator.compose(com.pervasive.datarush.operators.CompositionContext)). - From an output port of an operator that was added to this context to an output port of the
CompositeOperator. (Applies toCompositeOperator.compose(com.pervasive.datarush.operators.CompositionContext)).
Note on port types: connecting mixed type ports will generally fail when the graph is compiled.
Note that ports do not store connection information; rather, connection information is stored externally within this context.
- Specified by:
connectin interfaceOperatorComposable- Parameters:
from- the source portto- the target port
-
getProperty
Description copied from interface:PropertyValuedReturns a property of the given path. Paths are of the form operatorPath.propertyName", where operatorPath is the name of an operator that was added to this graph and propertyName is the name of a property of the object.- Specified by:
getPropertyin interfacePropertyValued- Parameters:
path- the path to the property.- Returns:
- the value of the property
-
setProperty
Description copied from interface:PropertyValuedSets a property of the given path. Paths are of the form operatorPath.propertyName", where operatorPath is the name of an operator that was added to this graph and propertyName is the name of a property of the object.- Specified by:
setPropertyin interfacePropertyValued- Parameters:
path- the path to the property.value- the new value of the property
-
getProperty
Description copied from interface:PropertyValuedReturns a property of the given path. Paths are of the form operatorPath.propertyName", where operatorPath is the name of an operator that was added to this graph and propertyName is the name of a property of the object.- Specified by:
getPropertyin interfacePropertyValued- Parameters:
path- the path to the property.- Returns:
- the value of the property
-
setProperty
Description copied from interface:PropertyValuedSets a property of the given path. Paths are of the form operatorPath.propertyName", where operatorPath is the name of an operator that was added to this graph and propertyName is the name of a property of the object.- Specified by:
setPropertyin interfacePropertyValued- Parameters:
path- the path to the property.value- the new value of the property
-