public abstract class IterativeOperator extends AbstractLogicalOperator
computeMetadata
is called once during graph compilation. This
gives operators a chance to validate and declare parallelizability, input metadata, and output metadata.createIterator
is called once during graph execution.execute
is invoked once during graph execution to perform the "body" of the iteration.finalComposition
is invoked once during graph execution to give the operator a chance to output final results.Constructor and Description |
---|
IterativeOperator() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
computeMetadata(IterativeMetadataContext ctx)
Implementations must adhere to the following contracts
|
protected abstract CompositionIterator |
createIterator(MetadataContext ctx)
Invoked at the start of execution.
|
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
protected abstract void computeMetadata(IterativeMetadataContext ctx)
IterativeMetadataContext.parallelize(ParallelismStrategy)
.
IterativeMetadataContext.setOutputParallelizable(com.pervasive.datarush.ports.LogicalPort, boolean)
IterativeMetadataContext.setIterationParallelizable(com.pervasive.datarush.ports.LogicalPort, boolean)
.MetadataUtil#negotiateParallelismBasedOnSourceAssumingParallelizableRecords
RecordPort#setRequiredDataOrdering
, otherwise iteration will proceed on an input dataset whose order is undefined.
RecordPort#setRequiredDataDistribution
, otherwise iteration will proceed on an input dataset whose distribution is the unspecified partial distribution
.
RecordPort#setType
.RecordPort#setOutputDataOrdering
RecordPort#setOutputDataDistribution
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
.
IterativeMetadataContext.setOutputMetadataDynamic(com.pervasive.datarush.ports.LogicalPort, boolean)
. In the case that metadata
is dynamic, calls to RecordPort#setType
, RecordPort#setOutputDataOrdering
,
etc are not allowed and thus the sections above entitled "Output record ports (static metadata)"
and "Output model ports (static metadata)" must be skipped. Note that, if possible,
dynamic metadata should be avoided (see IterativeMetadataContext.setOutputMetadataDynamic(com.pervasive.datarush.ports.LogicalPort, boolean)
).
ctx
- the contextprotected abstract CompositionIterator createIterator(MetadataContext ctx)
ctx
- a context in which the iterative operator can find input port metadata, etc.
this information was available in the previous call to computeMetadata(IterativeMetadataContext)
,
but is available here as well so that the iterative operator need not cache any
metadata in its instance variables.Copyright © 2020 Actian Corporation. All rights reserved.