pub struct TumblingWindow { /* private fields */ }Expand description
A tumbling window that collects events over a fixed duration.
Supports both row-oriented and columnar access patterns:
flush_shared(): Row-oriented access for backward compatibilityflush_columnar(): Columnar access for SIMD-optimized aggregations
Implementations§
Source§impl TumblingWindow
impl TumblingWindow
pub fn new(duration: Duration) -> Self
Add a shared event to the window, returning completed window if triggered.
Sourcepub fn add(&mut self, event: Event) -> Option<Vec<Event>>
pub fn add(&mut self, event: Event) -> Option<Vec<Event>>
Add an event to the window (wraps in Arc).
Flush all events as SharedEvent references.
Sourcepub fn flush_columnar(&mut self) -> ColumnarBuffer
pub fn flush_columnar(&mut self) -> ColumnarBuffer
Flush and return the columnar buffer for SIMD-optimized aggregations.
The returned buffer can be used with Aggregator::apply_columnar().
Sourcepub fn checkpoint(&self) -> WindowCheckpoint
pub fn checkpoint(&self) -> WindowCheckpoint
Create a checkpoint of the current window state.
Sourcepub fn restore(&mut self, cp: &WindowCheckpoint)
pub fn restore(&mut self, cp: &WindowCheckpoint)
Restore window state from a checkpoint.
Sourcepub fn advance_watermark(
&mut self,
wm: DateTime<Utc>,
) -> Option<Vec<SharedEvent>>
pub fn advance_watermark( &mut self, wm: DateTime<Utc>, ) -> Option<Vec<SharedEvent>>
Advance watermark — close window if watermark passes window end.
Trait Implementations§
Source§impl ColumnarAccess for TumblingWindow
impl ColumnarAccess for TumblingWindow
Source§fn columnar(&self) -> &ColumnarBuffer
fn columnar(&self) -> &ColumnarBuffer
Get a reference to the columnar buffer.
Source§fn columnar_mut(&mut self) -> &mut ColumnarBuffer
fn columnar_mut(&mut self) -> &mut ColumnarBuffer
Get a mutable reference to the columnar buffer.
Source§fn get_float_column(&mut self, field: &str) -> &[f64]
fn get_float_column(&mut self, field: &str) -> &[f64]
Get a float column, ensuring it exists.
Source§fn get_int_column(&mut self, field: &str) -> &[i64]
fn get_int_column(&mut self, field: &str) -> &[i64]
Get an int column, ensuring it exists.
Auto Trait Implementations§
impl Freeze for TumblingWindow
impl RefUnwindSafe for TumblingWindow
impl Send for TumblingWindow
impl Sync for TumblingWindow
impl Unpin for TumblingWindow
impl UnsafeUnpin for TumblingWindow
impl UnwindSafe for TumblingWindow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more