public class SdkComponents
extends java.lang.Object
RunnerApi.Components
object.Modifier and Type | Method and Description |
---|---|
void |
addRequirement(java.lang.String urn) |
static SdkComponents |
create()
Create a new
SdkComponents with no components. |
static SdkComponents |
create(PipelineOptions options) |
static SdkComponents |
create(org.apache.beam.model.pipeline.v1.RunnerApi.Components components,
java.util.Collection<java.lang.String> requirements)
Create new
SdkComponents importing all items from provided RunnerApi.Components object. |
java.lang.String |
getEnvironmentIdFor(ResourceHints resourceHints) |
java.lang.String |
getPTransformIdOrThrow(AppliedPTransform<?,?,?> appliedPTransform) |
void |
mergeFrom(org.apache.beam.model.pipeline.v1.RunnerApi.Components components,
@Nullable java.util.Collection<java.lang.String> requirements)
Merge Components proto into this SdkComponents instance.
|
java.lang.String |
registerCoder(Coder<?> coder)
|
java.lang.String |
registerEnvironment(org.apache.beam.model.pipeline.v1.RunnerApi.Environment env)
Registers the provided
RunnerApi.Environment into this SdkComponents , returning a unique
ID for the RunnerApi.Environment . |
java.lang.String |
registerPCollection(PCollection<?> pCollection)
Registers the provided
PCollection into this SdkComponents , returning a unique
ID for the PCollection . |
java.lang.String |
registerPTransform(AppliedPTransform<?,?,?> appliedPTransform,
java.util.List<AppliedPTransform<?,?,?>> children)
Registers the provided
AppliedPTransform into this SdkComponents , returning a
unique ID for the AppliedPTransform . |
java.lang.String |
registerWindowingStrategy(WindowingStrategy<?,?> windowingStrategy)
Registers the provided
WindowingStrategy into this SdkComponents , returning a
unique ID for the WindowingStrategy . |
java.util.Collection<java.lang.String> |
requirements() |
org.apache.beam.model.pipeline.v1.RunnerApi.Components |
toComponents()
Convert this
SdkComponents into a RunnerApi.Components , including all of the
contained coders , windowing strategies , PCollections , and PTransforms . |
SdkComponents |
withNewIdPrefix(java.lang.String newIdPrefix)
Returns an SdkComponents like this one, but which will prefix all newly generated ids with the
given string.
|
public static SdkComponents create()
SdkComponents
with no components.public static SdkComponents create(org.apache.beam.model.pipeline.v1.RunnerApi.Components components, java.util.Collection<java.lang.String> requirements)
SdkComponents
importing all items from provided RunnerApi.Components
object.
WARNING: This action might cause some of duplicate items created.
public static SdkComponents create(PipelineOptions options)
public void mergeFrom(org.apache.beam.model.pipeline.v1.RunnerApi.Components components, @Nullable java.util.Collection<java.lang.String> requirements)
public SdkComponents withNewIdPrefix(java.lang.String newIdPrefix)
Useful for ensuring independently-constructed components have non-overlapping ids.
public java.lang.String registerPTransform(AppliedPTransform<?,?,?> appliedPTransform, java.util.List<AppliedPTransform<?,?,?>> children) throws java.io.IOException
AppliedPTransform
into this SdkComponents
, returning a
unique ID for the AppliedPTransform
. Multiple registrations of the same AppliedPTransform
will return the same unique ID.
All of the children must already be registered within this SdkComponents
.
java.io.IOException
public java.lang.String getPTransformIdOrThrow(AppliedPTransform<?,?,?> appliedPTransform)
public java.lang.String registerPCollection(PCollection<?> pCollection) throws java.io.IOException
PCollection
into this SdkComponents
, returning a unique
ID for the PCollection
. Multiple registrations of the same PCollection
will
return the same unique ID.java.io.IOException
public java.lang.String registerWindowingStrategy(WindowingStrategy<?,?> windowingStrategy) throws java.io.IOException
WindowingStrategy
into this SdkComponents
, returning a
unique ID for the WindowingStrategy
. Multiple registrations of the same WindowingStrategy
will return the same unique ID.java.io.IOException
public java.lang.String registerCoder(Coder<?> coder) throws java.io.IOException
Coder
into this SdkComponents
, returning a unique ID for
the Coder
. Multiple registrations of the same Coder
will return the same unique
ID.
Coders are stored by identity to ensure that coders with implementations of Object.equals(Object)
and Object.hashCode()
but incompatible binary formats are not considered the
same coder.
java.io.IOException
public java.lang.String registerEnvironment(org.apache.beam.model.pipeline.v1.RunnerApi.Environment env)
RunnerApi.Environment
into this SdkComponents
, returning a unique
ID for the RunnerApi.Environment
. Multiple registrations of the same RunnerApi.Environment
will
return the same unique ID.public java.lang.String getEnvironmentIdFor(ResourceHints resourceHints)
public void addRequirement(java.lang.String urn)
public org.apache.beam.model.pipeline.v1.RunnerApi.Components toComponents()
SdkComponents
into a RunnerApi.Components
, including all of the
contained coders
, windowing strategies
, PCollections
, and PTransforms
.public java.util.Collection<java.lang.String> requirements()