pub struct WindowAlgebra<T: Clone> { /* private fields */ }Expand description
The main stream windowing algebra operator.
Generic over the event payload type T.
Implementations§
Source§impl<T: Clone> WindowAlgebra<T>
impl<T: Clone> WindowAlgebra<T>
Sourcepub fn new(config: WindowAlgebraConfig) -> Self
pub fn new(config: WindowAlgebraConfig) -> Self
Create a new windowing operator with the given configuration.
Sourcepub fn with_late_policy(self, policy: LatePolicy) -> Self
pub fn with_late_policy(self, policy: LatePolicy) -> Self
Set the late data policy.
Sourcepub fn with_max_open_windows(self, max: usize) -> Self
pub fn with_max_open_windows(self, max: usize) -> Self
Set the maximum number of open windows.
Sourcepub fn stats(&self) -> &WindowAlgebraStats
pub fn stats(&self) -> &WindowAlgebraStats
Get current statistics.
Sourcepub fn watermark_ms(&self) -> i64
pub fn watermark_ms(&self) -> i64
Get current watermark in milliseconds.
Sourcepub fn open_pane_count(&self) -> usize
pub fn open_pane_count(&self) -> usize
Get the number of currently open panes.
Sourcepub fn drain_side_output(&mut self) -> Vec<WindowEvent<T>>
pub fn drain_side_output(&mut self) -> Vec<WindowEvent<T>>
Get the side output (late events).
Sourcepub fn advance_watermark(&mut self, watermark_ms: i64) -> Vec<WindowOutput<T>>
pub fn advance_watermark(&mut self, watermark_ms: i64) -> Vec<WindowOutput<T>>
Advance the watermark and return any windows that should be closed.
Sourcepub fn ingest(&mut self, event: WindowEvent<T>) -> Vec<WindowOutput<T>>
pub fn ingest(&mut self, event: WindowEvent<T>) -> Vec<WindowOutput<T>>
Ingest a single event. Returns any triggered window outputs.
Sourcepub fn ingest_batch(
&mut self,
events: Vec<WindowEvent<T>>,
) -> Vec<WindowOutput<T>>
pub fn ingest_batch( &mut self, events: Vec<WindowEvent<T>>, ) -> Vec<WindowOutput<T>>
Ingest a batch of events.
Sourcepub fn flush(&mut self) -> Vec<WindowOutput<T>>
pub fn flush(&mut self) -> Vec<WindowOutput<T>>
Flush all open windows, emitting their contents.
Auto Trait Implementations§
impl<T> Freeze for WindowAlgebra<T>
impl<T> RefUnwindSafe for WindowAlgebra<T>where
T: RefUnwindSafe,
impl<T> Send for WindowAlgebra<T>where
T: Send,
impl<T> Sync for WindowAlgebra<T>where
T: Sync,
impl<T> Unpin for WindowAlgebra<T>where
T: Unpin,
impl<T> UnsafeUnpin for WindowAlgebra<T>
impl<T> UnwindSafe for WindowAlgebra<T>where
T: UnwindSafe + RefUnwindSafe,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.