T
- The type of the elements that result from this node.public abstract class ExecNodeBase<T> extends Object implements ExecNode<T>
ExecNode
.FIELD_NAME_CONFIGURATION, FIELD_NAME_DESCRIPTION, FIELD_NAME_ID, FIELD_NAME_INPUT_PROPERTIES, FIELD_NAME_OUTPUT_TYPE, FIELD_NAME_STATE, FIELD_NAME_TYPE
Modifier | Constructor and Description |
---|---|
protected |
ExecNodeBase(int id,
ExecNodeContext context,
ReadableConfig persistedConfig,
List<InputProperty> inputProperties,
LogicalType outputType,
String description) |
Modifier and Type | Method and Description |
---|---|
void |
accept(ExecNodeVisitor visitor)
Accepts a visit from a
ExecNodeVisitor . |
protected String |
createFormattedTransformationDescription(String description,
ReadableConfig config) |
protected String |
createFormattedTransformationName(String detailName,
String simplifiedName,
ReadableConfig config) |
protected String |
createTransformationDescription(ReadableConfig config) |
protected TransformationMetadata |
createTransformationMeta(String operatorName,
ExecNodeConfig config) |
protected TransformationMetadata |
createTransformationMeta(String operatorName,
String detailName,
String simplifiedName,
ExecNodeConfig config) |
protected String |
createTransformationName(ReadableConfig config) |
protected String |
createTransformationUid(String operatorName,
ExecNodeConfig config) |
protected ExecNodeContext |
getContextFromAnnotation()
Retrieves the default context from the
ExecNodeMetadata annotation to be serialized
into the JSON plan. |
String |
getDescription()
Returns a string which describes this node.
|
int |
getId()
The unique ID of the node.
|
List<ExecEdge> |
getInputEdges()
Returns a list of this node's input
ExecEdge s. |
List<InputProperty> |
getInputProperties()
Returns a list of this node's input properties.
|
LogicalType |
getOutputType()
Returns the output
LogicalType of this node, this type should be consistent with the
type parameter T . |
ReadableConfig |
getPersistedConfig() |
protected String |
getSimplifiedName() |
Transformation<T> |
getTransformation() |
protected boolean |
inputsContainSingleton()
Whether singleton distribution is required.
|
void |
replaceInputEdge(int index,
ExecEdge newInputEdge)
Replaces the
ordinalInParent th input edge. |
void |
setCompiled(boolean compiled)
Declares whether the node has been created as part of a plan compilation.
|
void |
setInputEdges(List<ExecEdge> inputEdges)
Sets the input
ExecEdge s which connect this nodes and its input nodes. |
boolean |
supportFusionCodegen()
Whether this ExecNode supports OFCG or not.
|
OpFusionCodegenSpecGenerator |
translateToFusionCodegenSpec(Planner planner,
org.apache.flink.table.planner.codegen.CodeGeneratorContext parentCtx)
Translates this node into a
OpFusionCodegenSpecGenerator . |
protected OpFusionCodegenSpecGenerator |
translateToFusionCodegenSpecInternal(org.apache.flink.table.planner.delegation.PlannerBase planner,
ExecNodeConfig config,
org.apache.flink.table.planner.codegen.CodeGeneratorContext parentCtx)
Internal method, translates this node into a operator codegen spec generator.
|
Transformation<T> |
translateToPlan(Planner planner)
Translates this node into a
Transformation . |
protected abstract Transformation<T> |
translateToPlanInternal(org.apache.flink.table.planner.delegation.PlannerBase planner,
ExecNodeConfig config)
Internal method, translates this node into a Flink operator.
|
protected ExecNodeBase(int id, ExecNodeContext context, ReadableConfig persistedConfig, List<InputProperty> inputProperties, LogicalType outputType, String description)
protected final ExecNodeContext getContextFromAnnotation()
ExecNodeMetadata
annotation to be serialized
into the JSON plan.public ReadableConfig getPersistedConfig()
public final int getId()
ExecNode
public String getDescription()
ExecNode
getDescription
in interface ExecNode<T>
public LogicalType getOutputType()
ExecNode
LogicalType
of this node, this type should be consistent with the
type parameter T
.
Such as, if T is RowData
, the output type should be RowType
. please refer
to the JavaDoc of RowData
for more info about mapping of logical types to internal
data structures.
getOutputType
in interface ExecNode<T>
public List<InputProperty> getInputProperties()
ExecNode
NOTE: If there are no inputs, returns an empty list, not null.
getInputProperties
in interface ExecNode<T>
public List<ExecEdge> getInputEdges()
ExecNode
ExecEdge
s.
NOTE: If there are no inputs, returns an empty list, not null.
getInputEdges
in interface ExecNode<T>
public void setInputEdges(List<ExecEdge> inputEdges)
ExecNode
ExecEdge
s which connect this nodes and its input nodes.
NOTE: If there are no inputs, the given inputEdges should be empty, not null.
setInputEdges
in interface ExecNode<T>
inputEdges
- the input ExecEdge
s.public void replaceInputEdge(int index, ExecEdge newInputEdge)
ExecNode
ordinalInParent
th input edge.replaceInputEdge
in interface ExecNode<T>
index
- Position of the child input edge, 0 is the first.newInputEdge
- New edge that should be put at position `index`.public final Transformation<T> translateToPlan(Planner planner)
ExecNodeTranslator
Transformation
.
NOTE: This method should return same translate result if called multiple times.
translateToPlan
in interface ExecNodeTranslator<T>
planner
- The Planner
of the translated graph.public void accept(ExecNodeVisitor visitor)
ExecNode
ExecNodeVisitor
.public void setCompiled(boolean compiled)
ExecNode
setCompiled
in interface ExecNode<T>
protected abstract Transformation<T> translateToPlanInternal(org.apache.flink.table.planner.delegation.PlannerBase planner, ExecNodeConfig config)
planner
- The planner.config
- per-ExecNode
configuration that contains the merged configuration from
various layers which all the nodes implementing this method should use, instead of
retrieving configuration from the planner
. For more details check ExecNodeConfig
.protected boolean inputsContainSingleton()
protected String getSimplifiedName()
protected String createTransformationUid(String operatorName, ExecNodeConfig config)
protected String createTransformationName(ReadableConfig config)
protected String createTransformationDescription(ReadableConfig config)
protected TransformationMetadata createTransformationMeta(String operatorName, ExecNodeConfig config)
protected TransformationMetadata createTransformationMeta(String operatorName, String detailName, String simplifiedName, ExecNodeConfig config)
protected String createFormattedTransformationDescription(String description, ReadableConfig config)
protected String createFormattedTransformationName(String detailName, String simplifiedName, ReadableConfig config)
@VisibleForTesting public Transformation<T> getTransformation()
public boolean supportFusionCodegen()
FusionCodegenExecNode
supportFusionCodegen
in interface FusionCodegenExecNode
public OpFusionCodegenSpecGenerator translateToFusionCodegenSpec(Planner planner, org.apache.flink.table.planner.codegen.CodeGeneratorContext parentCtx)
FusionCodegenExecNode
OpFusionCodegenSpecGenerator
.
NOTE: This method should return same spec generator result if called multiple times.
translateToFusionCodegenSpec
in interface FusionCodegenExecNode
planner
- The Planner
of the translated graph.parentCtx
- Parent CodeGeneratorContext.protected OpFusionCodegenSpecGenerator translateToFusionCodegenSpecInternal(org.apache.flink.table.planner.delegation.PlannerBase planner, ExecNodeConfig config, org.apache.flink.table.planner.codegen.CodeGeneratorContext parentCtx)
planner
- The planner.config
- per-ExecNode
configuration that contains the merged configuration from
various layers which all the nodes implementing this method should use, instead of
retrieving configuration from the planner
. For more details check ExecNodeConfig
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.