Class GeneralObjectCoder<T>

A Coder that encodes common javascript types such as strings, numbers, nulls, or objects.

Type Parameters

  • T

Hierarchy

  • GeneralObjectCoder

Implements

Constructors

Properties

codersByType: {
    array: IterableCoder<T>;
    boolean: BoolCoder;
    number: NumberOrFloatCoder;
    object: BsonObjectCoder<unknown>;
    string: StrUtf8Coder;
} = ...

Type declaration

markerToTypes: {
    A: string;
    B: string;
    N: string;
    O: string;
    S: string;
} = ...

Type declaration

  • A: string
  • B: string
  • N: string
  • O: string
  • S: string
typeMarkers: {
    array: string;
    boolean: string;
    number: string;
    object: string;
    string: string;
} = ...

Type declaration

  • array: string
  • boolean: string
  • number: string
  • object: string
  • string: string
URN: string = "beam:coder:genericobjectjs: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 T

  • Encode an element into a stream of bytes.

    Parameters

    • element: T

      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.

    Parameters

    • pipelineContext: ProtoContext

      a context that holds relevant pipeline attributes such as other coders already in the pipeline.

    Returns Coder

Generated using TypeDoc