pub struct WatermarkConfig {
pub max_out_of_order_ms: u64,
pub idle_timeout_ms: Option<u64>,
pub drop_late_events: bool,
}Expand description
Watermark configuration for handling out-of-order events.
Fields§
§max_out_of_order_ms: u64Maximum allowed out-of-order delay in milliseconds.
idle_timeout_ms: Option<u64>Optional idle timeout: emit partial windows after this many ms of silence.
drop_late_events: boolWhether to silently drop events that arrive beyond the watermark.
Implementations§
Source§impl WatermarkConfig
impl WatermarkConfig
Sourcepub fn new(max_out_of_order_ms: u64) -> Self
pub fn new(max_out_of_order_ms: u64) -> Self
Create a new WatermarkConfig with the given out-of-order tolerance.
Defaults: idle_timeout_ms=None, drop_late_events=false.
Sourcepub fn with_idle_timeout(self, timeout_ms: u64) -> Self
pub fn with_idle_timeout(self, timeout_ms: u64) -> Self
Set the idle timeout in milliseconds.
Sourcepub fn with_drop_late(self, drop: bool) -> Self
pub fn with_drop_late(self, drop: bool) -> Self
Configure whether late events should be dropped.
Sourcepub fn current_watermark(&self, max_event_time_ms: u64) -> u64
pub fn current_watermark(&self, max_event_time_ms: u64) -> u64
Compute the current watermark given the maximum observed event timestamp.
The watermark is max_event_time_ms - max_out_of_order_ms, saturating at zero.
Trait Implementations§
Source§impl Clone for WatermarkConfig
impl Clone for WatermarkConfig
Source§fn clone(&self) -> WatermarkConfig
fn clone(&self) -> WatermarkConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WatermarkConfig
impl RefUnwindSafe for WatermarkConfig
impl Send for WatermarkConfig
impl Sync for WatermarkConfig
impl Unpin for WatermarkConfig
impl UnsafeUnpin for WatermarkConfig
impl UnwindSafe for WatermarkConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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