Documentation ¶
Overview ¶
Package fixed implements Fixed windows. Fixed windows (sometimes called tumbling windows) are defined by a static window size, e.g. minutely windows or hourly windows. They are generally aligned, i.e. every window applies across all the data for the corresponding period of time. Package fixed also maintains the state of active keyed windows in a vertex. Keyed AlignedWindower maintains the association between set of keys and an interval window. keyed also provides the lifecycle management of an interval window. Watermark is used to trigger the expiration of windows.
Index ¶
- func NewFixed(length time.Duration) window.Windower
- type Fixed
- func (f *Fixed) AssignWindow(eventTime time.Time) []window.AlignedKeyedWindower
- func (f *Fixed) InsertIfNotPresent(kw window.AlignedKeyedWindower) (aw window.AlignedKeyedWindower, isPresent bool)
- func (f *Fixed) NextWindowToBeClosed() window.AlignedKeyedWindower
- func (f *Fixed) RemoveWindows(wm time.Time) []window.AlignedKeyedWindower
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fixed ¶
type Fixed struct { // Length is the temporal length of the window. Length time.Duration // contains filtered or unexported fields }
Fixed implements Fixed window. Fixed maintains the state of active windows All the operations in Fixed (see window.Windower) order the entries in the ascending order of start time. So the earliest window is at the front and the oldest window is at the end.
func (*Fixed) AssignWindow ¶
func (f *Fixed) AssignWindow(eventTime time.Time) []window.AlignedKeyedWindower
AssignWindow assigns a window for the given eventTime.
func (*Fixed) InsertIfNotPresent ¶ added in v0.6.5
func (f *Fixed) InsertIfNotPresent(kw window.AlignedKeyedWindower) (aw window.AlignedKeyedWindower, isPresent bool)
InsertIfNotPresent inserts a window to the list of active windows if not present and returns the window
func (*Fixed) NextWindowToBeClosed ¶ added in v0.9.0
func (f *Fixed) NextWindowToBeClosed() window.AlignedKeyedWindower
NextWindowToBeClosed returns the next window which is yet to be closed.
func (*Fixed) RemoveWindows ¶ added in v0.6.3
func (f *Fixed) RemoveWindows(wm time.Time) []window.AlignedKeyedWindower
RemoveWindows returns an array of keyed windows that are before the current watermark. So these windows can be closed.