@Internal public final class ExecNodeContext extends Object
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 and Description |
---|
ExecNodeContext(String value) |
Modifier and Type | Method and Description |
---|---|
String |
generateUid(String transformationName,
ExecNodeConfig config)
Returns a new
uid for transformations. |
String |
getName()
The type identifying an ExecNode in the JSON plan.
|
String |
getTypeAsString()
Returns the
name and version , to be serialized into the JSON plan as one
string, which in turn will be parsed by ExecNodeContext(String) when
deserialized from a JSON plan or when needed by ExecNodeTypeIdResolver.typeFromId(DatabindContext, String) . |
Integer |
getVersion()
The version of the ExecNode in the JSON plan.
|
static <T extends ExecNode<?>> |
newContext(Class<T> execNodeClass) |
static int |
newNodeId()
Generate an unique ID for ExecNode.
|
static <T extends ExecNode<?>> |
newPersistedConfig(Class<T> execNodeClass,
ReadableConfig tableConfig)
Create a configuration for the
ExecNode , ready to be persisted to a JSON plan. |
static void |
resetIdCounter()
Reset the id counter to 0.
|
String |
toString() |
ExecNodeContext |
withId(int id)
Set the unique ID of the node, so that the
ExecNodeContext , together with the type
related name and version , stores all the necessary info to uniquely
reconstruct the ExecNode , and avoid storing the id independently as a field
in ExecNodeBase . |
public ExecNodeContext(String value)
public static int newNodeId()
@VisibleForTesting public static void resetIdCounter()
public String getName()
ExecNodeMetadata.name()
.public Integer getVersion()
ExecNodeMetadata.version()
.public String generateUid(String transformationName, ExecNodeConfig config)
uid
for transformations.public ExecNodeContext withId(int id)
ExecNodeContext
, together with the type
related name
and version
, stores all the necessary info to uniquely
reconstruct the ExecNode
, and avoid storing the id
independently as a field
in ExecNodeBase
.public String getTypeAsString()
name
and version
, to be serialized into the JSON plan as one
string, which in turn will be parsed by ExecNodeContext(String)
when
deserialized from a JSON plan or when needed by ExecNodeTypeIdResolver.typeFromId(DatabindContext, String)
.public static <T extends ExecNode<?>> ExecNodeContext newContext(Class<T> execNodeClass)
public static <T extends ExecNode<?>> ReadableConfig newPersistedConfig(Class<T> execNodeClass, ReadableConfig tableConfig)
ExecNode
, ready to be persisted to a JSON plan.execNodeClass
- The ExecNode
class.tableConfig
- The planner configuration (include the TableConfig
).ExecNode
configuration, which contains the consumed options for the node,
defined by ExecNodeMetadata.consumedOptions()
, along with their values.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.