@Internal public class TransformHierarchy extends java.lang.Object
Captures information about a collection of transformations and their associated PCollections
.
Modifier and Type | Class and Description |
---|---|
class |
TransformHierarchy.Node
Provides internal tracking of transform relationships with helper methods for initialization
and ordered visitation.
|
Constructor and Description |
---|
TransformHierarchy() |
Modifier and Type | Method and Description |
---|---|
void |
finishSpecifyingInput()
Finish specifying all of the input
PValues of the current TransformHierarchy.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 named
PTransform consuming the provided PInput as a node in this
TransformHierarchy 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 current
TransformHierarchy.Node with the original outputs of the
node it is replacing. |
void |
setOutput(POutput output)
Set the output of the current
TransformHierarchy.Node . |
java.util.Set<PValue> |
visit(Pipeline.PipelineVisitor visitor) |
public TransformHierarchy.Node pushNode(java.lang.String name, PInput input, PTransform<?,?> transform)
PTransform
consuming the provided PInput
as a node in this
TransformHierarchy
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)
, calling finishSpecifyingInput()
, setting the output with setOutput(POutput)
, and ending with a call to popNode()
.
public TransformHierarchy.Node replaceNode(TransformHierarchy.Node existing, PInput input, PTransform<?,?> transform)
public void finishSpecifyingInput()
PValues
of the current TransformHierarchy.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.public void setOutput(POutput output)
TransformHierarchy.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 that POutput
.
Also validates the output - specifically, a Primitive PTransform
produces all of its
outputs, and a Composite PTransform
produces none of its outputs. Verifies that the
expanded output does not contain PValues
produced by both this node and other
nodes.
public void replaceOutputs(java.util.Map<PCollection<?>,PTransformOverrideFactory.ReplacementOutput> originalToReplacement)
TransformHierarchy.Node
with the original outputs of the
node it is replacing. No value that is a key in originalToReplacement
may be present
within the TransformHierarchy
after this method completes.public void popNode()
public java.util.Set<PValue> visit(Pipeline.PipelineVisitor visitor)
public TransformHierarchy.Node getCurrent()