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
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
ConstructorsConstructorDescriptionMergeModel(LogicalPortFactory<? extends AbstractModelPort<T>> factory, ModelMergeHandler<T> mergeHandler) Merge the input model -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCompose the body of this operator.protected final voidImplementations must adhere to all of the contracts specified byStreamingOperator.computeMetadata(com.pervasive.datarush.operators.StreamingMetadataContext).final AbstractModelPort<T>getInput()Returns the input port for the partial modelfinal AbstractModelPort<T>Returns the output port that will produce the final modelMethods inherited from class com.pervasive.datarush.operators.DeferredCompositeOperator
computeOutputTypesMethods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Constructor Details
-
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 Details
-
getInput
Returns the input port for the partial model- Returns:
- the input port
-
getOutput
Returns the output port that will produce the final model- Returns:
- the output port
-
computeMetadata
Description copied from class:DeferredCompositeOperatorImplementations 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:
computeMetadatain classDeferredCompositeOperator- Parameters:
ctx- the context
-
compose
Description copied from class:DeferredCompositeOperatorCompose 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:
composein classDeferredCompositeOperator- Parameters:
ctx- the context
- Instantiate and configure sub-operators, adding them to the provided context via
the method
-