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 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) 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) 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
}
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