public abstract class DeferredCompositeOperator extends StreamingOperator
CompositeOperator
whenever possible!
Similar to CompositeOperator
in that this is composed of sub-operators.
The key distinction, though, is that composition is deferred until execution time such
that compose(DeferredCompositionContext)
is invoked on a per-partition basis.
Thus, subclasses of this class control input partitioning and output partitioning declaration.
Beware that input partitioning requirements effectively override those that the components
may have declared by-default, thus it is preferable to use CompositeOperator
if possible.
In addition be aware of the following restrictions:
Constructor and Description |
---|
DeferredCompositeOperator() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
compose(DeferredCompositionContext ctx)
Compose the body of this operator.
|
protected abstract void |
computeMetadata(StreamingMetadataContext ctx)
Implementations must adhere to all of the contracts specified
by
StreamingOperator.computeMetadata(com.pervasive.datarush.operators.StreamingMetadataContext) . |
protected void |
computeOutputTypes(StreamingMetadataContext ctx)
Convenience method that implementations of
computeMetadata
may use in order to compute the output types. |
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
protected abstract void computeMetadata(StreamingMetadataContext ctx)
StreamingOperator.computeMetadata(com.pervasive.datarush.operators.StreamingMetadataContext)
. In addition,
DeferredCompositeOperators must declare required metadata so
as to satisfy requirements of the operators that are added
during compose(com.pervasive.datarush.operators.DeferredCompositionContext)
.computeMetadata
in class StreamingOperator
ctx
- the contextprotected final void computeOutputTypes(StreamingMetadataContext ctx)
computeMetadata
may use in order to compute the output types. Beware that this method is implemented
by invoking compose(com.pervasive.datarush.operators.DeferredCompositionContext)
on the client in order to get the output types. Thus, operators whose
compose method performs some machine-specific operation (i.e. validating the existence
of a file on a machine in the cluster) should not invoke this method.ctx
- the contextprotected abstract void compose(DeferredCompositionContext ctx)
OperatorComposable.add(O)
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 portsctx
- the contextCopyright © 2016 Actian Corporation. All rights reserved.