public abstract class CompositeOperator extends AbstractLogicalOperator
Group operator: in the case of a key-less aggregation,
there is an initial parallel operator where partial aggregations are computed
connected to a non-parallel operator that combines the one-row from each partition
into a final result.
Here is an example of a CompositeOperator that consists of two sub-operators,
linked together:
public class MyComposite extends CompositeOperator {
//the input port for the composite
private final RecordPort input= newRecordInput("input");
//the output port for the composite
private final RecordPort output= newRecordOutput("output");
public MyComposite() {
}
//the input port for the composite
public RecordPort getInput() {
return input;
}
//the output port for the composite
public RecordPort getOutput() {
return output;
}
@Override
protected void compose(CompositionContext ctx) {
//perform any validation
if (...) {
throw new ...;
}
//add the two sub-operators
SubOp1 op1= ctx.add(new SubOp1());
SubOp2 op2= ctx.add(new SubOp2());
//connect the composite's input port to the op1's input
ctx.connect(input,op1.getInput());
//connect op1's output to op2's input
ctx.connect(op1.getOutput(), op2.getInput());
//connect op2's output to the composite's output port
ctx.connect(op2.getOutput(), output);
}
}
| Constructor and Description |
|---|
CompositeOperator() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
compose(CompositionContext ctx)
Compose the body of this operator.
|
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyErrorprotected abstract void compose(CompositionContext 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 © 2024 Actian Corporation. All rights reserved.