fixed

package
v1.2.0 Latest Latest
Warning

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

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

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFixedWindow added in v1.2.0

func NewFixedWindow(length time.Duration, message *isb.ReadMessage) window.TimedWindow

NewFixedWindow returns a new window for the given message.

func NewWindower added in v1.2.0

func NewWindower(length 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 fixed 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 fixed window, the message is assigned to one single window. 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. returns a list of TimedWindowRequests, each request contains the window operation and the window which needs to be closed.

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 (w *Windower) Type() window.Type

Jump to

Keyboard shortcuts

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