Documentation ¶
Overview ¶
Package window contains window representation, windowing strategies and utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // SingleGlobalWindow is a slice of a single global window. Convenience value. SingleGlobalWindow = []typex.Window{GlobalWindow{}} )
Functions ¶
func IsEqualList ¶
IsEqualList returns true iff the lists of windows are equal. Note that ordering matters and that this is not set equality.
Types ¶
type AccumulationMode ¶
type AccumulationMode string
const ( Unspecified AccumulationMode = "AccumulationMode_UNSPECIFIED" Discarding AccumulationMode = "AccumulationMode_DISCARDING" Accumulating AccumulationMode = "AccumulationMode_ACCUMULATING" Retracting AccumulationMode = "AccumulationMode_RETRACTING" )
type Fn ¶
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 ¶
NewFixedWindows returns the fixed WindowFn with the given interval.
func NewGlobalWindows ¶
func NewGlobalWindows() *Fn
NewGlobalWindows returns the default WindowFn, which places all elements into a single window.
func NewSessions ¶
NewSessions returns the session WindowFn with the given gap.
func NewSlidingWindows ¶
NewSlidingWindows returns the sliding WindowFn with the given period and duration.
func (*Fn) Coder ¶
func (w *Fn) Coder() *coder.WindowCoder
Coder returns the WindowCoder for the WindowFn.
type GlobalWindow ¶
type GlobalWindow struct{}
GlobalWindow represents the singleton, global window.
func (GlobalWindow) Equals ¶
func (GlobalWindow) Equals(o typex.Window) bool
Equals returns a boolean indicating if the window is equal to a given window. This is true for global windows if the provided window is also a global window.
func (GlobalWindow) MaxTimestamp ¶
func (GlobalWindow) MaxTimestamp() typex.EventTime
MaxTimestamp returns the maximum timestamp in the window.
func (GlobalWindow) String ¶
func (GlobalWindow) String() string
type IntervalWindow ¶
IntervalWindow represents a half-open bounded window [start,end).
func (IntervalWindow) Equals ¶
func (w IntervalWindow) Equals(o typex.Window) bool
Equals returns a boolean indicating if the window is equal to a given window. This is true for interval windows if the provided window is an interval window and they share the start and end timestamps.
func (IntervalWindow) MaxTimestamp ¶
func (w IntervalWindow) MaxTimestamp() typex.EventTime
MaxTimestamp returns the maximum timestamp in the window.
func (IntervalWindow) String ¶
func (w IntervalWindow) String() string
type WindowingStrategy ¶
type WindowingStrategy struct { Fn *Fn Trigger trigger.Trigger AccumulationMode AccumulationMode AllowedLateness int // in milliseconds }
WindowingStrategy defines the types of windowing used in a pipeline and contains the data to support executing a windowing strategy.
func DefaultWindowingStrategy ¶
func DefaultWindowingStrategy() *WindowingStrategy
DefaultWindowingStrategy returns the default windowing strategy.
func (*WindowingStrategy) Equals ¶
func (ws *WindowingStrategy) Equals(o *WindowingStrategy) bool
func (*WindowingStrategy) String ¶
func (ws *WindowingStrategy) String() string