T
- the type of the modelpublic class PutModel<T> extends ExecutableOperator implements SourceOperator<AbstractModelPort<T>>
NOTE: this operator is non-parallel
Constructor and Description |
---|
PutModel(LogicalPortFactory<? extends AbstractModelPort<T>> factory)
Injects a model into a graph.
|
PutModel(LogicalPortFactory<? extends AbstractModelPort<T>> factory,
T model)
Injects a model into a graph
|
Modifier and Type | Method and Description |
---|---|
protected ExecutableOperator |
cloneForExecution()
Performs a deep copy of the operator for execution.
|
protected void |
computeMetadata(StreamingMetadataContext ctx)
Implementations must adhere to the following contracts
|
protected void |
execute(ExecutionContext ctx)
Executes the operator.
|
T |
getModel()
Returns the model to be injected
|
Reference<T> |
getModelReference()
For advanced use only; returns the reference location where the model is to be obtained.
|
AbstractModelPort<T> |
getOutput()
Returns the output port which will transmit the model during graph execution
|
void |
setModel(T model)
Sets the model to be injected
|
void |
setModelReference(Reference<T> reference)
For advanced use only; sets the reference location where the model is to be obtained.
|
getNumInputCopies, getPortSettings, handleInactiveOutput
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disableParallelism, getInputPorts, getOutputPorts
public PutModel(LogicalPortFactory<? extends AbstractModelPort<T>> factory)
factory
- the port factory for the modelpublic PutModel(LogicalPortFactory<? extends AbstractModelPort<T>> factory, T model)
factory
- the port factory for the modelmodel
- the model to inject.public final T getModel()
public final void setModel(T model)
model
- the modelpublic final AbstractModelPort<T> getOutput()
getOutput
in interface SourceOperator<AbstractModelPort<T>>
public final Reference<T> getModelReference()
public final void setModelReference(Reference<T> reference)
reference
- the reference locationprotected final void computeMetadata(StreamingMetadataContext ctx)
StreamingOperator
StreamingMetadataContext.parallelize(ParallelismStrategy)
.
RecordPort#setRequiredDataOrdering
, otherwise data may arrive in any order.
RecordPort#setRequiredDataDistribution
, otherwise data will arrive in an unspecified partial distribution
.
RecordPort#getSourceDataDistribution
and RecordPort#getSourceDataOrdering
. These should be
viewed as a hints to help chose a more efficient algorithm. In such cases, though, operators must
still declare data ordering and data distribution requirements; otherwise there is no guarantee that
data will arrive sorted/distributed as required.
RecordPort#setType
.RecordPort#setOutputDataOrdering
RecordPort#setOutputDataDistribution
AbstractModelPort#setMergeHandler
.MergeModel
is a convenient, re-usable model reducer, parameterized with
a merge-handler.
SimpleModelPort
's have no associated metadata and therefore there is
never any output metadata to declare. PMMLPort
's, on the other hand,
do have associated metadata. For all PMMLPorts, implementations must declare
the following:
PMMLPort.setPMMLModelSpec
.
computeMetadata
in class StreamingOperator
ctx
- the contextprotected final ExecutableOperator cloneForExecution()
ExecutableOperator
cloneForExecution
in class ExecutableOperator
protected final void execute(ExecutionContext ctx)
ExecutableOperator
execute
in class ExecutableOperator
ctx
- context in which to lookup physical ports bound to logical portsCopyright © 2021 Actian Corporation. All rights reserved.