@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(org.apache.flink.table.types.logical.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(CodeGeneratorContext fusionCtx) |
abstract void |
addReusableInitCode(CodeGeneratorContext fusionCtx) |
abstract void |
addReusableOpenCode(CodeGeneratorContext fusionCtx) |
abstract String |
endInputConsume()
Generate code to trigger the clean work of operator, call its output's
OpFusionCodegenSpec.doEndInputConsume(int). |
abstract void |
endInputProduce(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() |
org.apache.flink.table.types.logical.RowType |
getOutputType() |
abstract String |
processConsume(List<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(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(org.apache.flink.table.types.logical.RowType outputType,
OpFusionCodegenSpec opFusionCodegenSpec)
public void setup(org.apache.flink.table.planner.plan.fusion.OpFusionCodegenSpecGenerator.Context context)
public org.apache.flink.table.types.logical.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(CodeGeneratorContext fusionCtx)
public abstract String processConsume(List<GeneratedExpression> outputVars, String row)
OpFusionCodegenSpec.doProcessConsume(int, List, GeneratedExpression) method.
Note that `outputVars` and `row` can't both be null.
public abstract void endInputProduce(CodeGeneratorContext fusionCtx)
public abstract String endInputConsume()
OpFusionCodegenSpec.doEndInputConsume(int). The leaf operator start to call endInputConsume
method.public abstract void addReusableInitCode(CodeGeneratorContext fusionCtx)
public abstract void addReusableOpenCode(CodeGeneratorContext fusionCtx)
public abstract void addReusableCloseCode(CodeGeneratorContext fusionCtx)
Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.