Class WireCoders
java.lang.Object
org.apache.beam.runners.fnexecution.wire.WireCoders
Helpers to construct coders for gRPC port reads and writes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
addRunnerWireCoder
(org.apache.beam.sdk.util.construction.graph.PipelineNode.PCollectionNode pCollectionNode, org.apache.beam.model.pipeline.v1.RunnerApi.Components.Builder components, org.apache.beam.model.pipeline.v1.RunnerApi.ExecutableStagePayload.WireCoderSetting wireCoderSetting) Creates a runner-side wire coder for a port read/write for the given PCollection.static String
addSdkWireCoder
(org.apache.beam.sdk.util.construction.graph.PipelineNode.PCollectionNode pCollectionNode, org.apache.beam.model.pipeline.v1.RunnerApi.Components.Builder components, org.apache.beam.model.pipeline.v1.RunnerApi.ExecutableStagePayload.WireCoderSetting wireCoderSetting) Creates an SDK-side wire coder for a port read/write for the given PCollection.static <T> Coder
<WindowedValue<T>> instantiateRunnerWireCoder
(org.apache.beam.sdk.util.construction.graph.PipelineNode.PCollectionNode pCollectionNode, org.apache.beam.model.pipeline.v1.RunnerApi.Components components) Instantiates a runner-side wire coder for the given PCollection.static <T> Coder
<WindowedValue<T>> instantiateRunnerWireCoder
(org.apache.beam.sdk.util.construction.graph.PipelineNode.PCollectionNode pCollectionNode, org.apache.beam.model.pipeline.v1.RunnerApi.Components components, org.apache.beam.model.pipeline.v1.RunnerApi.ExecutableStagePayload.WireCoderSetting wireCoderSetting) Instantiates a runner-side wire coder for the given PCollection.
-
Method Details
-
addSdkWireCoder
public static String addSdkWireCoder(org.apache.beam.sdk.util.construction.graph.PipelineNode.PCollectionNode pCollectionNode, org.apache.beam.model.pipeline.v1.RunnerApi.Components.Builder components, org.apache.beam.model.pipeline.v1.RunnerApi.ExecutableStagePayload.WireCoderSetting wireCoderSetting) Creates an SDK-side wire coder for a port read/write for the given PCollection. Coders that are unknown to the runner are wrapped with length-prefix coders. The inner element coders are kept intact so that SDK harnesses can reconstruct the original elements.Adds all necessary coders to the components builder.
- Returns:
- id of a windowed value coder containing the PCollection's element coder
-
addRunnerWireCoder
public static String addRunnerWireCoder(org.apache.beam.sdk.util.construction.graph.PipelineNode.PCollectionNode pCollectionNode, org.apache.beam.model.pipeline.v1.RunnerApi.Components.Builder components, org.apache.beam.model.pipeline.v1.RunnerApi.ExecutableStagePayload.WireCoderSetting wireCoderSetting) Creates a runner-side wire coder for a port read/write for the given PCollection. Unknown coders are replaced with length-prefixed byte arrays.Adds all necessary coders to the components builder.
- Returns:
- id of a windowed value coder containing the PCollection's element coder
-
instantiateRunnerWireCoder
public static <T> Coder<WindowedValue<T>> instantiateRunnerWireCoder(org.apache.beam.sdk.util.construction.graph.PipelineNode.PCollectionNode pCollectionNode, org.apache.beam.model.pipeline.v1.RunnerApi.Components components) throws IOException Instantiates a runner-side wire coder for the given PCollection. Any component coders that are unknown by the runner are replaced with length-prefixed byte arrays.- Returns:
- a full windowed value coder containing the PCollection's element coder
- Throws:
IOException
-
instantiateRunnerWireCoder
public static <T> Coder<WindowedValue<T>> instantiateRunnerWireCoder(org.apache.beam.sdk.util.construction.graph.PipelineNode.PCollectionNode pCollectionNode, org.apache.beam.model.pipeline.v1.RunnerApi.Components components, org.apache.beam.model.pipeline.v1.RunnerApi.ExecutableStagePayload.WireCoderSetting wireCoderSetting) throws IOException Instantiates a runner-side wire coder for the given PCollection. Any component coders that are unknown by the runner are replaced with length-prefixed byte arrays.- Returns:
- a full or parameterized windowed value coder containing the PCollection's element coder
- Throws:
IOException
-