beam: github.com/apache/beam/sdks/go/pkg/beam/core/graph/window Index | Files

package window

import "github.com/apache/beam/sdks/go/pkg/beam/core/graph/window"

Package window contains window representation, windowing strategies and utilities.

Index

Package Files

fn.go strategy.go windows.go

Variables

var (
    // SingleGlobalWindow is a slice of a single global window. Convenience value.
    SingleGlobalWindow = []typex.Window{GlobalWindow{}}
)

func IsEqualList Uses

func IsEqualList(from, to []typex.Window) bool

IsEqualList returns true iff the lists of windows are equal. Note that ordering matters and that this is not set equality.

type Fn Uses

type Fn struct {
    Kind Kind

    Size   time.Duration // FixedWindows, SlidingWindows
    Period time.Duration // SlidingWindows
    Gap    time.Duration // Sessions
}

Fn defines the window fn.

func NewFixedWindows Uses

func NewFixedWindows(interval time.Duration) *Fn

NewFixedWindows returns the fixed WindowFn with the given interval.

func NewGlobalWindows Uses

func NewGlobalWindows() *Fn

NewGlobalWindows returns the default WindowFn, which places all elements into a single window.

func NewSessions Uses

func NewSessions(gap time.Duration) *Fn

NewSessions returns the session WindowFn with the given gap.

func NewSlidingWindows Uses

func NewSlidingWindows(period, duration time.Duration) *Fn

NewSlidingWindows returns the sliding WindowFn with the given period and duration.

func (*Fn) Coder Uses

func (w *Fn) Coder() *coder.WindowCoder

Coder returns the WindowCoder for the WindowFn.

func (*Fn) Equals Uses

func (w *Fn) Equals(o *Fn) bool

Equals returns true iff the windows have the same kind and underlying behavior. Built-in window types (such as global window) are only equal to the same instances of the window. A user-defined window that happens to match a built-in will not match on Equals().

func (*Fn) String Uses

func (w *Fn) String() string

type GlobalWindow Uses

type GlobalWindow struct{}

GlobalWindow represents the singleton, global window.

func (GlobalWindow) Equals Uses

func (GlobalWindow) Equals(o typex.Window) bool

func (GlobalWindow) MaxTimestamp Uses

func (GlobalWindow) MaxTimestamp() typex.EventTime

MaxTimestamp returns the maximum timestamp in the window.

func (GlobalWindow) String Uses

func (GlobalWindow) String() string

type IntervalWindow Uses

type IntervalWindow struct {
    Start, End typex.EventTime
}

IntervalWindow represents a half-open bounded window [start,end).

func (IntervalWindow) Equals Uses

func (w IntervalWindow) Equals(o typex.Window) bool

func (IntervalWindow) MaxTimestamp Uses

func (w IntervalWindow) MaxTimestamp() typex.EventTime

MaxTimestamp returns the maximum timestamp in the window.

func (IntervalWindow) String Uses

func (w IntervalWindow) String() string

type Kind Uses

type Kind string

Kind is the semantic type of a window fn.

const (
    GlobalWindows  Kind = "GLO"
    FixedWindows   Kind = "FIX"
    SlidingWindows Kind = "SLI"
    Sessions       Kind = "SES" // TODO
)

type WindowingStrategy Uses

type WindowingStrategy struct {
    Fn *Fn
}

WindowingStrategy defines the types of windowing used in a pipeline and contains the data to support executing a windowing strategy.

func DefaultWindowingStrategy Uses

func DefaultWindowingStrategy() *WindowingStrategy

DefaultWindowingStrategy returns the default windowing strategy.

func (*WindowingStrategy) Equals Uses

func (ws *WindowingStrategy) Equals(o *WindowingStrategy) bool

func (*WindowingStrategy) String Uses

func (ws *WindowingStrategy) String() string

Package window imports 5 packages (graph) and is imported by 7 packages. Updated 2018-05-22. Refresh now. Tools for package owners.