Class ExecNodeContext
java.lang.Object
org.apache.flink.table.planner.plan.nodes.exec.ExecNodeContext
Helper class that holds the necessary identifier fields that are used for JSON plan serialization
and deserialization. It is instantiated using
newContext(Class) when
creating a new instance of an ExecNode, so that is contains the info from the ExecNodeMetadata annotation of the class with the latest ExecNodeMetadata.version(). It
can also be instantiated with ExecNodeContext(String) automatically when
the ExecNode is deserialized from a JSON Plan, and in this case the ExecNodeContext contains the version that is read from the JSON Plan and not the latest one. The
serialization format is <name>_<version>, see getTypeAsString().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateUid(String transformationName, ExecNodeConfig config) Returns a newuidfor transformations.getName()The type identifying an ExecNode in the JSON plan.Returns thenameandversion, to be serialized into the JSON plan as one string, which in turn will be parsed byExecNodeContext(String)when deserialized from a JSON plan or when needed byTypeIdResolverBase.typeFromId(DatabindContext, String).The version of the ExecNode in the JSON plan.static <T extends ExecNode<?>>
ExecNodeContextnewContext(Class<T> execNodeClass) static intGenerate an unique ID for ExecNode.static <T extends ExecNode<?>>
org.apache.flink.configuration.ReadableConfignewPersistedConfig(Class<T> execNodeClass, org.apache.flink.configuration.ReadableConfig tableConfig) Create a configuration for theExecNode, ready to be persisted to a JSON plan.static voidReset the id counter to 0.toString()withId(int id) Set the unique ID of the node, so that theExecNodeContext, together with the type relatednameandversion, stores all the necessary info to uniquely reconstruct theExecNode, and avoid storing theidindependently as a field inExecNodeBase.
-
Constructor Details
-
ExecNodeContext
-
-
Method Details
-
newNodeId
public static int newNodeId()Generate an unique ID for ExecNode. -
resetIdCounter
@VisibleForTesting public static void resetIdCounter()Reset the id counter to 0. -
getName
The type identifying an ExecNode in the JSON plan. SeeExecNodeMetadata.name(). -
getVersion
The version of the ExecNode in the JSON plan. SeeExecNodeMetadata.version(). -
generateUid
Returns a newuidfor transformations. -
withId
Set the unique ID of the node, so that theExecNodeContext, together with the type relatednameandversion, stores all the necessary info to uniquely reconstruct theExecNode, and avoid storing theidindependently as a field inExecNodeBase. -
getTypeAsString
Returns thenameandversion, to be serialized into the JSON plan as one string, which in turn will be parsed byExecNodeContext(String)when deserialized from a JSON plan or when needed byTypeIdResolverBase.typeFromId(DatabindContext, String). -
toString
-
newContext
-
newPersistedConfig
public static <T extends ExecNode<?>> org.apache.flink.configuration.ReadableConfig newPersistedConfig(Class<T> execNodeClass, org.apache.flink.configuration.ReadableConfig tableConfig) Create a configuration for theExecNode, ready to be persisted to a JSON plan.- Parameters:
execNodeClass- TheExecNodeclass.tableConfig- The planner configuration (include theTableConfig).- Returns:
- The
ExecNodeconfiguration, which contains the consumed options for the node, defined byExecNodeMetadata.consumedOptions(), along with their values.
-