snippets

package
v2.32.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 9 Imported by: 0

Documentation

Overview

Package snippets contains code used in the Beam Programming Guide as examples for the Apache Beam Go SDK. These snippets are compiled and their tests run to ensure correctness. However, due to their piecemeal pedagogical use, they may not be the best example of production code.

The Beam Programming Guide can be found at https://beam.apache.org/documentation/programming-guide/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountWords

func CountWords(s beam.Scope, lines beam.PCollection) beam.PCollection

[START countwords_composite] CountWords is a function that builds a composite PTransform to count the number of times each word appears.

func Create

func Create()

Create demonstrates using beam.CreateList.

func CreateAndSplit

func CreateAndSplit(s beam.Scope, input []stringPair) beam.PCollection

CreateAndSplit is a helper function that creates

func PipelineConstruction

func PipelineConstruction()

PipelineConstruction contains snippets for the initial sections of the Beam Programming Guide, from initializing to submitting a pipeline.

func PipelineOptions

func PipelineOptions()

PipelineOptions shows basic pipeline options using flags.

func PipelineOptionsCustom

func PipelineOptionsCustom()

PipelineOptionsCustom shows slightly less basic pipeline options using flags.

Types

type ComputeWordLengthFn

type ComputeWordLengthFn struct{}

ComputeWordLengthFn is the DoFn to perform on each element in the input PCollection.

func (*ComputeWordLengthFn) ProcessElement

func (fn *ComputeWordLengthFn) ProcessElement(word string, emit func(int))

ProcessElement is the method to execute for each element.

type Student

type Student struct {
	Percentile int
}

Jump to

Keyboard shortcuts

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