Google Cloud Dataflow SDK for Java, version 1.9.1
Class TransformTreeNode
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.runners.TransformTreeNode
-
public class TransformTreeNode extends Object
Provides internal tracking of transform relationships with helper methods for initialization and ordered visitation.
-
-
Constructor Summary
Constructors Constructor and Description TransformTreeNode(TransformTreeNode enclosingNode, PTransform<?,?> transform, String fullName, PInput input)
Creates a new TransformTreeNode with the given parent and transform.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
addComposite(TransformTreeNode node)
Adds a composite operation to the transform node.void
addInputProducer(PValue expandedInput, TransformTreeNode producer)
Adds an input to the transform node.void
finishSpecifying()
Finish specifying a transform.TransformTreeNode
getEnclosingNode()
Returns the enclosing composite transform node, or null if there is none.Collection<? extends PValue>
getExpandedOutputs()
Returns the transform outputs, in expanded form.String
getFullName()
PInput
getInput()
Returns the transform input, in unexpanded form.Map<PValue,TransformTreeNode>
getInputs()
Returns a mapping of inputs to the producing nodes for all inputs to the transform.POutput
getOutput()
Returns the transform output, in unexpanded form.PTransform<?,?>
getTransform()
Returns the transform associated with this transform node.boolean
isCompositeNode()
Returns true if this node represents a composite transform that does not perform processing of its own, but merely encapsulates a sub-pipeline (which may be empty).boolean
isRootNode()
void
setOutput(POutput output)
Adds an output to the transform node.void
visit(Pipeline.PipelineVisitor visitor, Set<PValue> visitedValues)
Visit the transform node.
-
-
-
Constructor Detail
-
TransformTreeNode
public TransformTreeNode(@Nullable TransformTreeNode enclosingNode, @Nullable PTransform<?,?> transform, String fullName, @Nullable PInput input)
Creates a new TransformTreeNode with the given parent and transform.EnclosingNode and transform may both be null for a root-level node, which holds all other nodes.
- Parameters:
enclosingNode
- the composite node containing this nodetransform
- the PTransform tracked by this nodefullName
- the fully qualified name of the transforminput
- the unexpanded input to the transform
-
-
Method Detail
-
getTransform
public PTransform<?,?> getTransform()
Returns the transform associated with this transform node.
-
getEnclosingNode
public TransformTreeNode getEnclosingNode()
Returns the enclosing composite transform node, or null if there is none.
-
addComposite
public void addComposite(TransformTreeNode node)
Adds a composite operation to the transform node.As soon as a node is added, the transform node is considered a composite operation instead of a primitive transform.
-
isCompositeNode
public boolean isCompositeNode()
Returns true if this node represents a composite transform that does not perform processing of its own, but merely encapsulates a sub-pipeline (which may be empty).Note that a node may be composite with no sub-transforms if it returns its input directly extracts a component of a tuple, or other operations that occur at pipeline assembly time.
-
isRootNode
public boolean isRootNode()
-
getFullName
public String getFullName()
-
addInputProducer
public void addInputProducer(PValue expandedInput, TransformTreeNode producer)
Adds an input to the transform node.
-
getInput
public PInput getInput()
Returns the transform input, in unexpanded form.
-
getInputs
public Map<PValue,TransformTreeNode> getInputs()
Returns a mapping of inputs to the producing nodes for all inputs to the transform.
-
setOutput
public void setOutput(POutput output)
Adds an output to the transform node.
-
getOutput
public POutput getOutput()
Returns the transform output, in unexpanded form.
-
getExpandedOutputs
public Collection<? extends PValue> getExpandedOutputs()
Returns the transform outputs, in expanded form.
-
visit
public void visit(Pipeline.PipelineVisitor visitor, Set<PValue> visitedValues)
Visit the transform node.Provides an ordered visit of the input values, the primitive transform (or child nodes for composite transforms), then the output values.
-
finishSpecifying
public void finishSpecifying()
Finish specifying a transform.All inputs are finished first, then the transform, then all outputs.
-
-