beamio

package
v0.0.67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0, NCSA Imports: 22 Imported by: 0

Documentation

Overview

Package beamio provides Beam transformations for common IO patterns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeShards added in v0.0.50

func ComputeShards(s beam.Scope, kv beam.PCollection, opts stats.Opts) beam.PCollection

ComputeShards assigns shards to KeyValues. Input is a PCollection of beamio.KeyValue, output is (int, beamio.KeyValue).

func EncodeKeyValues added in v0.0.30

func EncodeKeyValues(s beam.Scope, tables ...beam.PCollection) beam.PCollection

EncodeKeyValues encodes each PCollection of KVs into encoded KeyValues and flattens all entries into a single PCollection.

func ReadEntries

func ReadEntries(ctx context.Context, s beam.Scope, fileOrDir string) (beam.PCollection, error)

ReadEntries reads a set of *spb.Entry messages into a PCollection from the given file, or files stored in a directory. The file can be part of any filesystem registered with the beam/io/filesystem package and can either be a delimited protobuf stream or a Riegeli file.

func WriteLevelDB added in v0.0.28

func WriteLevelDB(s beam.Scope, path string, opts stats.Opts, tables ...beam.PCollection)

WriteLevelDB writes a set of PCollections containing KVs to a new LevelDB at the given path. Each KV is serialized and stored as a single LevelDB key-value entry according to their enclosing PCollection's beam.Coder. Each table may have different KV types. Keys must be unique across all PCollections.

Types

type KeyValue added in v0.0.30

type KeyValue struct {
	Key   []byte `json:"k"`
	Value []byte `json:"v"`
}

A KeyValue is a concrete form of a Beam KV.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL