- java.lang.Object
-
- com.pervasive.datarush.operators.AbstractLogicalOperator
-
- com.pervasive.datarush.operators.CompositeOperator
-
- com.pervasive.datarush.operators.OpenMultiModelSource<T>
-
- Type Parameters:
T
- the model type
- All Implemented Interfaces:
PropertyValued
,LogicalOperator
,MultiSourceOperator<AbstractModelPort<T>>
,OperatorComposable
public final class OpenMultiModelSource<T> extends CompositeOperator implements MultiSourceOperator<AbstractModelPort<T>>
A model source that can be externally composed. This is a convenient way to create a grouping of nodes without needing to subclassCompositeOperator
.
-
-
Constructor Summary
Constructors Constructor Description OpenMultiModelSource(LogicalPortFactory<? extends AbstractModelPort<T>> portFactory, int numOutputs)
Create a model source for the given model port type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <O extends LogicalOperator>
Oadd(O op)
Add a LogicalOperator to this graph, using the short class name as the name of the operator.<O extends LogicalOperator>
Oadd(O op, OperatorSettings settings)
Add a LogicalOperator to this graph, specifying advanced operator settings.<O extends LogicalOperator>
Oadd(O op, String name)
Add a LogicalOperator to this graph, specifying a name of the operator.protected void
compose(CompositionContext ctx)
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.void
connect(LogicalPort from, LogicalPort to)
Connect two ports together.void
connectOutput(AbstractModelPort<T> from, int index)
int
getNumOutputs()
Returns the number of input portsList<AbstractModelPort<T>>
getOutputs()
Returns the output portsObject
getProperty(GraphPath path)
Returns a property of the given path.Object
getProperty(String path)
Returns a property of the given path.void
setProperty(GraphPath path, Object value)
Sets a property of the given path.void
setProperty(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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pervasive.datarush.operators.LogicalOperator
disableParallelism, getInputPorts, getOutputPorts
-
-
-
-
Constructor Detail
-
OpenMultiModelSource
public OpenMultiModelSource(LogicalPortFactory<? extends AbstractModelPort<T>> portFactory, int numOutputs)
Create a model source for the given model port type. Following construction, callers must create the body by callingadd
andconnect
.- Parameters:
portFactory
- the factory for the model port, determines the port typenumOutputs
- the number of output ports
-
-
Method Detail
-
getOutputs
public List<AbstractModelPort<T>> getOutputs()
Description copied from interface:MultiSourceOperator
Returns the output ports- Specified by:
getOutputs
in interfaceMultiSourceOperator<T>
- Returns:
- the output ports
-
getNumOutputs
public int getNumOutputs()
Returns the number of input ports- Returns:
- the number of input ports
-
connectOutput
public void connectOutput(AbstractModelPort<T> from, int index)
-
compose
protected final void compose(CompositionContext ctx)
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:
compose
in classCompositeOperator
- Parameters:
ctx
- the context
-
add
public final <O extends LogicalOperator> O add(O op)
Description copied from interface:OperatorComposable
Add a LogicalOperator to this graph, using the short class name as the name of the operator.- Specified by:
add
in 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
public final <O extends LogicalOperator> O add(O op, String name)
Description copied from interface:OperatorComposable
Add a LogicalOperator to this graph, specifying a name of the operator.- Specified by:
add
in 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
public final <O extends LogicalOperator> O add(O op, OperatorSettings settings)
Description copied from interface:OperatorComposable
Add a LogicalOperator to this graph, specifying advanced operator settings.- Specified by:
add
in 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
public final void connect(LogicalPort from, LogicalPort to)
Description copied from interface:OperatorComposable
Connect 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
CompositeOperator
to 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:
connect
in interfaceOperatorComposable
- Parameters:
from
- the source portto
- the target port
-
getProperty
public final Object getProperty(GraphPath path)
Description copied from interface:PropertyValued
Returns 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:
getProperty
in interfacePropertyValued
- Parameters:
path
- the path to the property.- Returns:
- the value of the property
-
setProperty
public final void setProperty(GraphPath path, Object value)
Description copied from interface:PropertyValued
Sets 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:
setProperty
in interfacePropertyValued
- Parameters:
path
- the path to the property.value
- the new value of the property
-
getProperty
public final Object getProperty(String path)
Description copied from interface:PropertyValued
Returns 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:
getProperty
in interfacePropertyValued
- Parameters:
path
- the path to the property.- Returns:
- the value of the property
-
setProperty
public final void setProperty(String path, Object value)
Description copied from interface:PropertyValued
Sets 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:
setProperty
in interfacePropertyValued
- Parameters:
path
- the path to the property.value
- the new value of the property
-
-