sliding

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

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

func NewSlidingWindow added in v1.2.0

func NewSlidingWindow(startTime time.Time, endTime time.Time) window.TimedWindow

func NewWindower added in v1.2.0

func NewWindower(length time.Duration, slide time.Duration, vertexInstance *dfv1.VertexInstance) window.TimedWindower

Types

type Windower added in v1.2.0

type Windower struct {
	// contains filtered or unexported fields
}

Windower is an implementation of TimedWindower of sliding window, windower is responsible for assigning windows to the incoming messages and closing the windows that are past the watermark.

func (*Windower) AssignWindows added in v1.2.0

func (w *Windower) AssignWindows(message *isb.ReadMessage) []*window.TimedWindowRequest

AssignWindows assigns the event to the window based on give window configuration. For sliding window, the message can be assigned to multiple windows. The operation can be either OPEN or APPEND, depending on whether the window is already present or not.

func (*Windower) CloseWindows added in v1.2.0

func (w *Windower) CloseWindows(time time.Time) []*window.TimedWindowRequest

CloseWindows closes the windows that are past the watermark.

func (*Windower) DeleteClosedWindow added in v1.2.0

func (w *Windower) DeleteClosedWindow(window window.TimedWindow)

DeleteClosedWindow deletes the window from the closed windows list

func (*Windower) InsertWindow added in v1.2.0

func (w *Windower) InsertWindow(tw window.TimedWindow)

InsertWindow inserts a window to the list of active windows.

func (*Windower) NextWindowToBeClosed added in v1.2.0

func (w *Windower) NextWindowToBeClosed() window.TimedWindow

NextWindowToBeClosed returns the next window yet to be closed.

func (*Windower) OldestWindowEndTime added in v1.2.0

func (w *Windower) OldestWindowEndTime() time.Time

OldestWindowEndTime returns the end time of the oldest window among both active and closed windows. If there are no windows, it returns -1.

func (*Windower) Strategy added in v1.2.0

func (w *Windower) Strategy() window.Strategy

func (*Windower) Type added in v1.2.0

func (*Windower) Type() window.Type

Type implements window.TimedWindower.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL