Documentation ¶
Overview ¶
Package sliding implements Sliding windows. Sliding windows are defined by a static window size e.g. minutely windows or hourly windows and a fixed "slide". This is the duration by which the boundaries of the windows move once every <slide> duration. Package sliding also maintains the state of active windows. Watermark is used to trigger the expiration of windows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sliding ¶
type Sliding struct { // Length is the duration of the window Length time.Duration // offset between successive windows. // successive windows are phased out by this duration. Slide time.Duration // contains filtered or unexported fields }
Sliding implements sliding windows
func NewSliding ¶
NewSliding returns a Sliding windower
func (*Sliding) AssignWindow ¶
func (s *Sliding) AssignWindow(eventTime time.Time) []window.AlignedKeyedWindower
AssignWindow returns a set of windows that contain the element based on event time
func (*Sliding) InsertIfNotPresent ¶
func (s *Sliding) 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 (*Sliding) RemoveWindows ¶
func (s *Sliding) RemoveWindows(wm time.Time) []window.AlignedKeyedWindower
Click to show internal directories.
Click to hide internal directories.