public static interface PTransformTranslation.TransformPayloadTranslator<T extends PTransform<?,?>>
PTransform
and a protobuf payload for that transform.
When going to a protocol buffer message, the translator produces a payload corresponding to the Java representation while registering components that payload references.
Also, provides methods for generating a Row-based constructor config for the transform that can be later used to re-construct the transform.
Modifier and Type | Interface and Description |
---|---|
static class |
PTransformTranslation.TransformPayloadTranslator.NotSerializable<T extends PTransform<?,?>>
A
PTransformTranslation.TransformPayloadTranslator for transforms that contain no references to components,
so they do not need a specialized rehydration. |
Modifier and Type | Method and Description |
---|---|
default T |
fromConfigRow(Row configRow,
PipelineOptions options)
Construts a transform from a provided Row-based construction configuration.
|
java.lang.String |
getUrn()
Provides a unique URN for transforms represented by this
TransformPayloadTranslator . |
default java.lang.String |
getUrn(T transform)
Same as
getUrn() but the returned URN may depend on the transform provided. |
default Row |
toConfigRow(T transform)
Generates a Row-based construction configuration for the provided transform.
|
@Nullable org.apache.beam.model.pipeline.v1.RunnerApi.FunctionSpec |
translate(AppliedPTransform<?,?,T> application,
SdkComponents components)
Translates the given transform represented by the provided
AppliedPTransform to a
FunctionSpec with a URN and a payload. |
java.lang.String getUrn()
TransformPayloadTranslator
.default java.lang.String getUrn(T transform)
@Nullable org.apache.beam.model.pipeline.v1.RunnerApi.FunctionSpec translate(AppliedPTransform<?,?,T> application, SdkComponents components) throws java.io.IOException
AppliedPTransform
to a
FunctionSpec
with a URN and a payload.application
- an AppliedPTransform
that includes the transform to be expanded.components
- components of the pipeline that includes the transform.java.io.IOException
default Row toConfigRow(T transform)
transform
- a transform represented by the current TransformPayloadTranslator
.default T fromConfigRow(Row configRow, PipelineOptions options)
configRow
- a construction configuration similar to what would be generated by the
toConfigRow(PTransform)
method.TransformPayloadTranslator
.