- java.lang.Object
-
- com.pervasive.datarush.operators.AbstractLogicalOperator
-
- com.pervasive.datarush.operators.StreamingOperator
-
- com.pervasive.datarush.operators.DeferredCompositeOperator
-
- com.pervasive.datarush.operators.model.MergeModel<T>
-
- Type Parameters:
T
- the type of the model
- All Implemented Interfaces:
LogicalOperator
public final class MergeModel<T> extends DeferredCompositeOperator
This operator is uses to force a merge of a partitioned model into a single model. This is to be used as a building block of model learner operators that build a model in-parallel and need to perform a final reduction.NOTE: this operator is non-parallel
-
-
Constructor Summary
Constructors Constructor Description MergeModel(LogicalPortFactory<? extends AbstractModelPort<T>> factory, ModelMergeHandler<T> mergeHandler)
Merge the input model
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
compose(DeferredCompositionContext ctx)
Compose the body of this operator.protected void
computeMetadata(StreamingMetadataContext ctx)
Implementations must adhere to all of the contracts specified byStreamingOperator.computeMetadata(com.pervasive.datarush.operators.StreamingMetadataContext)
.AbstractModelPort<T>
getInput()
Returns the input port for the partial modelAbstractModelPort<T>
getOutput()
Returns the output port that will produce the final model-
Methods inherited from class com.pervasive.datarush.operators.DeferredCompositeOperator
computeOutputTypes
-
Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
-
-
-
Constructor Detail
-
MergeModel
public MergeModel(LogicalPortFactory<? extends AbstractModelPort<T>> factory, ModelMergeHandler<T> mergeHandler)
Merge the input model- Parameters:
factory
- determines the type of model portmergeHandler
- performs the merge of partial models into a final model
-
-
Method Detail
-
getInput
public final AbstractModelPort<T> getInput()
Returns the input port for the partial model- Returns:
- the input port
-
getOutput
public final AbstractModelPort<T> getOutput()
Returns the output port that will produce the final model- Returns:
- the output port
-
computeMetadata
protected final void computeMetadata(StreamingMetadataContext ctx)
Description copied from class:DeferredCompositeOperator
Implementations must adhere to all of the contracts specified byStreamingOperator.computeMetadata(com.pervasive.datarush.operators.StreamingMetadataContext)
. In addition, DeferredCompositeOperators must declare required metadata so as to satisfy requirements of the operators that are added duringDeferredCompositeOperator.compose(com.pervasive.datarush.operators.DeferredCompositionContext)
.- Specified by:
computeMetadata
in classDeferredCompositeOperator
- Parameters:
ctx
- the context
-
compose
protected void compose(DeferredCompositionContext ctx)
Description copied from class:DeferredCompositeOperator
Compose the body of this operator. Implementations should do the following:- Instantiate and configure sub-operators, adding them to the provided context via
the method
OperatorComposable.add(O)
- Create necessary connections via the method
OperatorComposable.connect(P, P)
. This includes connections from the composite's input ports to sub-operators, connections between sub-operators, and connections from sub-operators output ports to the composite's output ports
- Specified by:
compose
in classDeferredCompositeOperator
- Parameters:
ctx
- the context
- Instantiate and configure sub-operators, adding them to the provided context via
the method
-
-