Package org.apache.beam.sdk.runners
Class TransformHierarchy
- java.lang.Object
-
- org.apache.beam.sdk.runners.TransformHierarchy
-
@Internal public class TransformHierarchy extends java.lang.Object
For internal use only; no backwards-compatibility guarantees.Captures information about a collection of transformations and their associated
PCollections
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
TransformHierarchy.Node
Provides internal tracking of transform relationships with helper methods for initialization and ordered visitation.
-
Constructor Summary
Constructors Constructor Description TransformHierarchy(ResourceHints resourceHints)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finishSpecifyingInput()
Finish specifying all of the inputPValues
of the currentTransformHierarchy.Node
.TransformHierarchy.Node
getCurrent()
void
popNode()
Pops the current node off the top of the stack, finishing it.TransformHierarchy.Node
pushNode(java.lang.String name, PInput input, PTransform<?,?> transform)
Adds the namedPTransform
consuming the providedPInput
as a node in thisTransformHierarchy
as a child of the current node, and sets it to be the current node.TransformHierarchy.Node
replaceNode(TransformHierarchy.Node existing, PInput input, PTransform<?,?> transform)
void
replaceOutputs(java.util.Map<PCollection<?>,PTransformOverrideFactory.ReplacementOutput> originalToReplacement)
Recursively replace the outputs of the currentTransformHierarchy.Node
with the original outputs of the node it is replacing.void
setOutput(POutput output)
Set the output of the currentTransformHierarchy.Node
.java.util.Set<PValue>
visit(Pipeline.PipelineVisitor visitor)
-
-
-
Constructor Detail
-
TransformHierarchy
public TransformHierarchy(ResourceHints resourceHints)
-
-
Method Detail
-
pushNode
public TransformHierarchy.Node pushNode(java.lang.String name, PInput input, PTransform<?,?> transform)
Adds the namedPTransform
consuming the providedPInput
as a node in thisTransformHierarchy
as a child of the current node, and sets it to be the current node.This call should be finished by expanding and recursively calling
pushNode(String, PInput, PTransform)
, callingfinishSpecifyingInput()
, setting the output withsetOutput(POutput)
, and ending with a call topopNode()
.- Returns:
- the added node
-
replaceNode
public TransformHierarchy.Node replaceNode(TransformHierarchy.Node existing, PInput input, PTransform<?,?> transform)
-
finishSpecifyingInput
public void finishSpecifyingInput()
Finish specifying all of the inputPValues
of the currentTransformHierarchy.Node
. Ensures that all of the inputs to the current node have been fully specified, and have been produced by a node in this graph.
-
setOutput
public void setOutput(POutput output)
Set the output of the currentTransformHierarchy.Node
. If the output is new (setOutput has not previously been called with it as the parameter), the current node is set as the producer of thatPOutput
.Also validates the output - specifically, a Primitive
PTransform
produces all of its outputs, and a CompositePTransform
produces none of its outputs. Verifies that the expanded output does not containPValues
produced by both this node and other nodes.
-
replaceOutputs
public void replaceOutputs(java.util.Map<PCollection<?>,PTransformOverrideFactory.ReplacementOutput> originalToReplacement)
Recursively replace the outputs of the currentTransformHierarchy.Node
with the original outputs of the node it is replacing. No value that is a key inoriginalToReplacement
may be present within theTransformHierarchy
after this method completes.
-
popNode
public void popNode()
Pops the current node off the top of the stack, finishing it. Outputs of the node are finished once they are consumed as input.
-
visit
public java.util.Set<PValue> visit(Pipeline.PipelineVisitor visitor)
-
getCurrent
public TransformHierarchy.Node getCurrent()
-
-