Skip to main content

WindowAssigner

Trait WindowAssigner 

Source
pub trait WindowAssigner: Send {
    // Required method
    fn assign_windows(&self, timestamp: i64) -> WindowIdVec;

    // Provided method
    fn max_timestamp(&self, window_end: i64) -> i64 { ... }
}
Expand description

Trait for assigning events to windows.

Required Methods§

Source

fn assign_windows(&self, timestamp: i64) -> WindowIdVec

Assigns an event timestamp to zero or more windows.

For tumbling windows, this returns exactly one window. For sliding windows, this may return multiple windows.

Provided Methods§

Source

fn max_timestamp(&self, window_end: i64) -> i64

Returns the maximum timestamp that could still be assigned to a window ending at window_end.

Used for determining when a window can be safely triggered.

Implementors§