public class QueryablePipeline
extends java.lang.Object
RunnerApi.Pipeline
which has additional methods to relate nodes in the graph relative to each
other.Modifier and Type | Method and Description |
---|---|
static QueryablePipeline |
forPipeline(org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline p)
Create a new
QueryablePipeline which uses the root transform IDs and components of the
provided RunnerApi.Pipeline . |
static QueryablePipeline |
forPrimitivesIn(org.apache.beam.model.pipeline.v1.RunnerApi.Components components)
Create a new
QueryablePipeline based on the provided components. |
static QueryablePipeline |
forTransforms(java.util.Collection<java.lang.String> transformIds,
org.apache.beam.model.pipeline.v1.RunnerApi.Components components)
Create a new
QueryablePipeline based on the provided components containing only the
provided transformIds . |
org.apache.beam.model.pipeline.v1.RunnerApi.Components |
getComponents() |
java.util.Optional<org.apache.beam.model.pipeline.v1.RunnerApi.Environment> |
getEnvironment(PipelineNode.PTransformNode parDo) |
java.util.Set<PipelineNode.PCollectionNode> |
getOutputPCollections(PipelineNode.PTransformNode ptransform) |
java.util.Set<PipelineNode.PTransformNode> |
getPerElementConsumers(PipelineNode.PCollectionNode pCollection)
Get all of the
PTransforms which consume the provided
PipelineNode.PCollectionNode on a per-element basis. |
java.util.Set<PipelineNode.PCollectionNode> |
getPerElementInputPCollections(PipelineNode.PTransformNode ptransform)
Gets each
PipelineNode.PCollectionNode that the provided PipelineNode.PTransformNode consumes on a per-element basis. |
PipelineNode.PTransformNode |
getProducer(PipelineNode.PCollectionNode pcollection) |
java.util.Set<PipelineNode.PTransformNode> |
getRootTransforms()
Get the transforms that are roots of this
QueryablePipeline . |
java.util.Collection<SideInputReference> |
getSideInputs(PipelineNode.PTransformNode transform)
Returns the
SideInputReferences that the provided transform consumes
as side inputs. |
java.util.Set<PipelineNode.PTransformNode> |
getSingletonConsumers(PipelineNode.PCollectionNode pCollection)
Same as
getPerElementConsumers(PipelineNode.PCollectionNode) , but returns transforms
that consume the collection as a singleton. |
java.util.Collection<TimerReference> |
getTimers(PipelineNode.PTransformNode transform) |
java.lang.Iterable<PipelineNode.PTransformNode> |
getTopologicallyOrderedTransforms() |
java.util.Collection<PipelineNode.PTransformNode> |
getTransforms() |
java.util.Collection<UserStateReference> |
getUserStates(PipelineNode.PTransformNode transform) |
public static QueryablePipeline forPrimitivesIn(org.apache.beam.model.pipeline.v1.RunnerApi.Components components)
QueryablePipeline
based on the provided components.
The returned QueryablePipeline
will contain only the primitive transforms present
within the provided components.
public static QueryablePipeline forPipeline(org.apache.beam.model.pipeline.v1.RunnerApi.Pipeline p)
QueryablePipeline
which uses the root transform IDs and components of the
provided RunnerApi.Pipeline
.public static QueryablePipeline forTransforms(java.util.Collection<java.lang.String> transformIds, org.apache.beam.model.pipeline.v1.RunnerApi.Components components)
QueryablePipeline
based on the provided components containing only the
provided transformIds
.public java.util.Collection<PipelineNode.PTransformNode> getTransforms()
public java.lang.Iterable<PipelineNode.PTransformNode> getTopologicallyOrderedTransforms()
public java.util.Set<PipelineNode.PTransformNode> getRootTransforms()
QueryablePipeline
. These are all nodes which
have no input RunnerApi.PCollection
.public PipelineNode.PTransformNode getProducer(PipelineNode.PCollectionNode pcollection)
public java.util.Set<PipelineNode.PTransformNode> getPerElementConsumers(PipelineNode.PCollectionNode pCollection)
PTransforms
which consume the provided
PipelineNode.PCollectionNode
on a per-element basis.
If a PipelineNode.PTransformNode
consumes a PipelineNode.PCollectionNode
on
a per-element basis one or more times, it will appear a single time in the result.
In theory, a transform may consume a single PipelineNode.PCollectionNode
in both a
per-element and singleton manner. If this is the case, the transform node is included in the
result, as it does consume the PipelineNode.PCollectionNode
on a per-element basis.
public java.util.Set<PipelineNode.PTransformNode> getSingletonConsumers(PipelineNode.PCollectionNode pCollection)
getPerElementConsumers(PipelineNode.PCollectionNode)
, but returns transforms
that consume the collection as a singleton.public java.util.Set<PipelineNode.PCollectionNode> getPerElementInputPCollections(PipelineNode.PTransformNode ptransform)
PipelineNode.PCollectionNode
that the provided PipelineNode.PTransformNode
consumes on a per-element basis.public java.util.Set<PipelineNode.PCollectionNode> getOutputPCollections(PipelineNode.PTransformNode ptransform)
public org.apache.beam.model.pipeline.v1.RunnerApi.Components getComponents()
public java.util.Collection<SideInputReference> getSideInputs(PipelineNode.PTransformNode transform)
SideInputReferences
that the provided transform consumes
as side inputs.public java.util.Collection<UserStateReference> getUserStates(PipelineNode.PTransformNode transform)
public java.util.Collection<TimerReference> getTimers(PipelineNode.PTransformNode transform)
public java.util.Optional<org.apache.beam.model.pipeline.v1.RunnerApi.Environment> getEnvironment(PipelineNode.PTransformNode parDo)