fixed

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 5 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 Window 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

This section is empty.

Types

type ActiveWindows

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

ActiveWindows maintains the state of active windows All the operations in ActiveWindows 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 NewWindows

func NewWindows() *ActiveWindows

NewWindows initializes the windows object.

func (*ActiveWindows) CreateKeyedWindow

func (aw *ActiveWindows) CreateKeyedWindow(iw *window.IntervalWindow) *keyed.KeyedWindow

CreateKeyedWindow adds a new keyed window for a given interval window

func (*ActiveWindows) GetKeyedWindow

func (aw *ActiveWindows) GetKeyedWindow(iw *window.IntervalWindow) *keyed.KeyedWindow

GetKeyedWindow returns an existing window for the given interval

func (*ActiveWindows) RemoveWindow

func (aw *ActiveWindows) RemoveWindow(wm time.Time) []*keyed.KeyedWindow

RemoveWindow returns an array of keyed windows that are before the current watermark. So these windows can be closed.

type Fixed

type Fixed struct {
	// Length is the temporal length of the window.
	Length time.Duration
}

Fixed implements Fixed window.

func NewFixed

func NewFixed(length time.Duration) *Fixed

NewFixed returns a Fixed window.

func (*Fixed) AssignWindow

func (f *Fixed) AssignWindow(eventTime time.Time) []*window.IntervalWindow

AssignWindow assigns a window for the given eventTime.

Jump to

Keyboard shortcuts

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