Fileoverview

Defines all of the Apache Beam standard coders.

Beyond required coders, standard coders provide an efficient way to encode data for communication between the runner and various Beam workers for types that commonly cross process boundaries. Though none of these coders is strictly necessary, if encodings are given for these types it is highly advised to use these definitions that are interoperable with runners and other SDKs.

For the schema-aware transform RowCoder, which is a coder for rows of data with a predetermined schema, it is also advised.

The formal specifications for these coders can be found in model/pipeline/src/main/proto/beam_runner_api.proto

Hierarchy

  • StrUtf8Coder

Implements

Constructors

Properties

Methods

Constructors

Properties

decoder: TextDecoder = ...
encoder: TextEncoder = ...
type: string = "stringutf8coder"
URN: string = "beam:coder:string_utf8:v1"

Methods

  • Decode an element from an incoming stream of bytes.

    Parameters

    • reader: Reader

      a reader that interfaces the coder with the input byte stream

    • context: Context

      the context within which the element should be encoded

    Returns string

  • Encode an element into a stream of bytes.

    Parameters

    • element: string

      an element within a PCollection

    • writer: Writer

      a writer that interfaces the coder with the output byte stream.

    • context: Context

      the context within which the element should be encoded.

    Returns void

  • Convert this coder into its protocol buffer representation for the Runner API. A coder in protobuf format can be shared with other components such as Beam runners, SDK workers; and reconstructed into its runtime representation if necessary.

    Returns Coder

Generated using TypeDoc