@Internal public abstract class OpFusionCodegenSpecGenerator extends Object
OpFusionCodegenSpecGenerator
is used to operator fusion codegen that generate the fusion
code, it has multiple inputs and outputs, then form a DAG. Every OpFusionCodegenSpecGenerator
holds an OpFusionCodegenSpec
that used to generate the operator process row code. In
addition, it also provides some meta information that codegen needed.Modifier and Type | Field and Description |
---|---|
protected OpFusionCodegenSpec |
opFusionCodegenSpec |
Constructor and Description |
---|
OpFusionCodegenSpecGenerator(RowType outputType,
OpFusionCodegenSpec opFusionCodegenSpec) |
Modifier and Type | Method and Description |
---|---|
abstract void |
addOutput(int inputIdOfOutput,
OpFusionCodegenSpecGenerator output)
Add the specific
OpFusionCodegenSpecGenerator as the output of current operator spec
generator, one OpFusionCodegenSpecGenerator may have multiple outputs that form a
DAG. |
abstract void |
addReusableCloseCode(org.apache.flink.table.planner.codegen.CodeGeneratorContext fusionCtx) |
abstract void |
addReusableInitCode(org.apache.flink.table.planner.codegen.CodeGeneratorContext fusionCtx) |
abstract void |
addReusableOpenCode(org.apache.flink.table.planner.codegen.CodeGeneratorContext fusionCtx) |
abstract String |
endInputConsume()
Generate code to trigger the clean work of operator, call its output's
OpFusionCodegenSpec.doEndInputConsume(int) . |
abstract void |
endInputProduce(org.apache.flink.table.planner.codegen.CodeGeneratorContext fusionCtx)
Generate Java source code to do clean work for operator corresponding input.
|
abstract List<OpFusionCodegenSpecGenerator> |
getInputs() |
abstract long |
getManagedMemory() |
OpFusionCodegenSpec |
getOpFusionCodegenSpec() |
OpFusionContext |
getOpFusionContext() |
RowType |
getOutputType() |
abstract String |
processConsume(List<org.apache.flink.table.planner.codegen.GeneratedExpression> outputVars,
String row)
Consume the generated columns or row from current operator, call its output's
OpFusionCodegenSpec.doProcessConsume(int, List, GeneratedExpression) method. |
abstract void |
processProduce(org.apache.flink.table.planner.codegen.CodeGeneratorContext fusionCtx)
Generate Java source code to process the rows from operator corresponding input.
|
void |
setup(org.apache.flink.table.planner.plan.fusion.OpFusionCodegenSpecGenerator.Context context)
Initializes the operator spec generator needed information.
|
protected final OpFusionCodegenSpec opFusionCodegenSpec
public OpFusionCodegenSpecGenerator(RowType outputType, OpFusionCodegenSpec opFusionCodegenSpec)
public void setup(org.apache.flink.table.planner.plan.fusion.OpFusionCodegenSpecGenerator.Context context)
public RowType getOutputType()
public OpFusionCodegenSpec getOpFusionCodegenSpec()
public OpFusionContext getOpFusionContext()
public abstract long getManagedMemory()
public abstract List<OpFusionCodegenSpecGenerator> getInputs()
public abstract void addOutput(int inputIdOfOutput, OpFusionCodegenSpecGenerator output)
OpFusionCodegenSpecGenerator
as the output of current operator spec
generator, one OpFusionCodegenSpecGenerator
may have multiple outputs that form a
DAG.inputIdOfOutput
- This is numbered starting from 1, and `1` indicates the first input of
output OpFusionCodegenSpecGenerator
.output
- The OpFusionCodegenSpecGenerator
as output of current spec generator.public abstract void processProduce(org.apache.flink.table.planner.codegen.CodeGeneratorContext fusionCtx)
public abstract String processConsume(List<org.apache.flink.table.planner.codegen.GeneratedExpression> outputVars, String row)
OpFusionCodegenSpec.doProcessConsume(int, List, GeneratedExpression)
method.
Note that `outputVars` and `row` can't both be null.
public abstract void endInputProduce(org.apache.flink.table.planner.codegen.CodeGeneratorContext fusionCtx)
public abstract String endInputConsume()
OpFusionCodegenSpec.doEndInputConsume(int)
. The leaf operator start to call endInputConsume
method.public abstract void addReusableInitCode(org.apache.flink.table.planner.codegen.CodeGeneratorContext fusionCtx)
public abstract void addReusableOpenCode(org.apache.flink.table.planner.codegen.CodeGeneratorContext fusionCtx)
public abstract void addReusableCloseCode(org.apache.flink.table.planner.codegen.CodeGeneratorContext fusionCtx)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.