- java.lang.Object
-
- com.pervasive.datarush.operators.AbstractLogicalOperator
-
- All Implemented Interfaces:
LogicalOperator
- Direct Known Subclasses:
CompositeOperator
,IterativeOperator
,StreamingOperator
public abstract class AbstractLogicalOperator extends Object implements LogicalOperator
Base class for all LogicalOperators. Implementation must not extend this class directly; instead they must extend one of the following sub-classes:- See Also:
LogicalOperator
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disableParallelism()
Can be called to forcible disable parallelism for the given operator (and children if this is aCompositeOperator
).Namespace<LogicalPort>
getInputPorts()
Returns the list of input ports.Namespace<LogicalPort>
getOutputPorts()
Returns the list of output ports.protected <T extends LogicalPort>
TnewInput(String name, LogicalPortFactory<T> factory)
Creates a new input port.protected <T extends LogicalPort>
TnewInput(String name, LogicalPortFactory<T> factory, boolean optional)
Creates a new input port.protected <T extends LogicalPort>
TnewOutput(String name, LogicalPortFactory<T> factory)
Creates a new output port.protected RecordPort
newRecordInput(String name)
Creates a new record input port.protected RecordPort
newRecordInput(String name, boolean optional)
Creates a new record input port.protected RecordPort
newRecordOutput(String name)
Creates a new record output port.protected void
notifyError(Throwable e)
Called to notify the operator that the graph terminated abnormally either before the operator had a chance to run or while the operator is running.
-
-
-
Method Detail
-
getInputPorts
public final Namespace<LogicalPort> getInputPorts()
Description copied from interface:LogicalOperator
Returns the list of input ports. This method is generally used by framework code; operator consumers should generally use the methodsgetInput()
, etc to obtain a handle to input ports.- Specified by:
getInputPorts
in interfaceLogicalOperator
- Returns:
- the list of input ports
-
getOutputPorts
public final Namespace<LogicalPort> getOutputPorts()
Description copied from interface:LogicalOperator
Returns the list of output ports. This method is generally used by framework code; operator consumers should generally use the methodsgetOutput()
, etc to obtain a handle to input ports.- Specified by:
getOutputPorts
in interfaceLogicalOperator
- Returns:
- the list of output ports
-
disableParallelism
public final void disableParallelism()
Description copied from interface:LogicalOperator
Can be called to forcible disable parallelism for the given operator (and children if this is aCompositeOperator
). This method should be used sparingly since it will degrade performance significantly; but is needed in certain cases. For example:- If there is a
RunScript
operator that contains a non-parallelizable script - If there is a
DeriveFields
operator that contains a non-parallelizable function
- Specified by:
disableParallelism
in interfaceLogicalOperator
- If there is a
-
notifyError
protected void notifyError(Throwable e)
Called to notify the operator that the graph terminated abnormally either before the operator had a chance to run or while the operator is running. If this is aCompositeOperator
, this method will be invoked if any of the components- Parameters:
e
- the error that occured
-
newRecordInput
protected final RecordPort newRecordInput(String name)
Creates a new record input port. The result should be assigned to a private final variable and exposed through a public getter.- Parameters:
name
- the name of the port, must be unique within the operator.- Returns:
- a new record input port.
- See Also:
LogicalOperator
-
newRecordInput
protected final RecordPort newRecordInput(String name, boolean optional)
Creates a new record input port. The result should be assigned to a private final variable and exposed through a public getter.- Parameters:
name
- the name of the port, must be unique within the operator.optional
- whether the port is optional.- Returns:
- a new record input port.
- See Also:
LogicalOperator
-
newInput
protected final <T extends LogicalPort> T newInput(String name, LogicalPortFactory<T> factory)
Creates a new input port. The result should be assigned to a private final variable and exposed through a public getter.- Type Parameters:
T
- the type of the port- Parameters:
name
- the name of the port, must be unique within the operator.factory
- the factory, determines the type of the port- Returns:
- a new input port.
- See Also:
LogicalOperator
-
newInput
protected final <T extends LogicalPort> T newInput(String name, LogicalPortFactory<T> factory, boolean optional)
Creates a new input port. The result should be assigned to a private final variable and exposed through a public getter.- Type Parameters:
T
- the type of the port- Parameters:
name
- the name of the port, must be unique within the operator.factory
- the factory, determines the type of the portoptional
- whether the port is optional- Returns:
- a new input port.
- See Also:
LogicalOperator
-
newRecordOutput
protected final RecordPort newRecordOutput(String name)
Creates a new record output port. The result should be assigned to a private final variable and exposed through a public getter.- Parameters:
name
- the name of the port, must be unique within the operator.- Returns:
- a new record output port.
- See Also:
LogicalOperator
-
newOutput
protected final <T extends LogicalPort> T newOutput(String name, LogicalPortFactory<T> factory)
Creates a new output port. The result should be assigned to a private final variable and exposed through a public getter.- Type Parameters:
T
- the type of the port- Parameters:
name
- the name of the port, must be unique within the operator.factory
- the factory, determines the type of the port- Returns:
- a new output port.
- See Also:
LogicalOperator
-
-