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 ¶
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.
func (*Fn) Equals ¶
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().
type GlobalWindow ¶
type GlobalWindow struct{}
GlobalWindow represents the singleton, global window.
func (GlobalWindow) Equals ¶
func (GlobalWindow) Equals(o typex.Window) bool
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
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