Class OpFusionCodegenSpecGenerator
java.lang.Object
org.apache.flink.table.planner.plan.fusion.OpFusionCodegenSpecGenerator
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.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOpFusionCodegenSpecGenerator(org.apache.flink.table.types.logical.RowType outputType, OpFusionCodegenSpec opFusionCodegenSpec) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddOutput(int inputIdOfOutput, OpFusionCodegenSpecGenerator output) Add the specificOpFusionCodegenSpecGeneratoras the output of current operator spec generator, oneOpFusionCodegenSpecGeneratormay have multiple outputs that form a DAG.abstract voidaddReusableCloseCode(CodeGeneratorContext fusionCtx) abstract voidaddReusableInitCode(CodeGeneratorContext fusionCtx) abstract voidaddReusableOpenCode(CodeGeneratorContext fusionCtx) abstract StringGenerate code to trigger the clean work of operator, call its output'sOpFusionCodegenSpec.doEndInputConsume(int).abstract voidendInputProduce(CodeGeneratorContext fusionCtx) Generate Java source code to do clean work for operator corresponding input.abstract List<OpFusionCodegenSpecGenerator>abstract longorg.apache.flink.table.types.logical.RowTypeabstract StringprocessConsume(List<GeneratedExpression> outputVars, String row) Consume the generated columns or row from current operator, call its output'sOpFusionCodegenSpec.doProcessConsume(int, List, GeneratedExpression)method.abstract voidprocessProduce(CodeGeneratorContext fusionCtx) Generate Java source code to process the rows from operator corresponding input.voidsetup(org.apache.flink.table.planner.plan.fusion.OpFusionCodegenSpecGenerator.Context context) Initializes the operator spec generator needed information.
-
Field Details
-
opFusionCodegenSpec
-
-
Constructor Details
-
OpFusionCodegenSpecGenerator
public OpFusionCodegenSpecGenerator(org.apache.flink.table.types.logical.RowType outputType, OpFusionCodegenSpec opFusionCodegenSpec)
-
-
Method Details
-
setup
public void setup(org.apache.flink.table.planner.plan.fusion.OpFusionCodegenSpecGenerator.Context context) Initializes the operator spec generator needed information. This method must be called before produce and consume related method. -
getOutputType
public org.apache.flink.table.types.logical.RowType getOutputType() -
getOpFusionCodegenSpec
-
getOpFusionContext
-
getManagedMemory
public abstract long getManagedMemory() -
getInputs
-
addOutput
Add the specificOpFusionCodegenSpecGeneratoras the output of current operator spec generator, oneOpFusionCodegenSpecGeneratormay have multiple outputs that form a DAG.- Parameters:
inputIdOfOutput- This is numbered starting from 1, and `1` indicates the first input of outputOpFusionCodegenSpecGenerator.output- TheOpFusionCodegenSpecGeneratoras output of current spec generator.
-
processProduce
public abstract void processProduce(CodeGeneratorContext fusionCtx) Generate Java source code to process the rows from operator corresponding input. -
processConsume
Consume the generated columns or row from current operator, call its output'sOpFusionCodegenSpec.doProcessConsume(int, List, GeneratedExpression)method.Note that `outputVars` and `row` can't both be null.
-
endInputProduce
public abstract void endInputProduce(CodeGeneratorContext fusionCtx) Generate Java source code to do clean work for operator corresponding input. -
endInputConsume
Generate code to trigger the clean work of operator, call its output'sOpFusionCodegenSpec.doEndInputConsume(int). The leaf operator start to call endInputConsume method. -
addReusableInitCode
public abstract void addReusableInitCode(CodeGeneratorContext fusionCtx) -
addReusableOpenCode
public abstract void addReusableOpenCode(CodeGeneratorContext fusionCtx) -
addReusableCloseCode
public abstract void addReusableCloseCode(CodeGeneratorContext fusionCtx)
-