Class WireCoders


  • public class WireCoders
    extends java.lang.Object
    Helpers to construct coders for gRPC port reads and writes.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.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 java.lang.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> org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.values.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> org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.values.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • addSdkWireCoder

        public static java.lang.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 java.lang.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> org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.values.WindowedValue<T>> instantiateRunnerWireCoder​(org.apache.beam.sdk.util.construction.graph.PipelineNode.PCollectionNode pCollectionNode,
                                                                                                                                   org.apache.beam.model.pipeline.v1.RunnerApi.Components components)
                                                                                                                            throws java.io.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:
        java.io.IOException
      • instantiateRunnerWireCoder

        public static <T> org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.values.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 java.io.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:
        java.io.IOException