Expand description
Watermarking system for handling late events in stream processing
This module provides watermarking capabilities to handle out-of-order and late-arriving events in the stream processing pipeline. Watermarks represent a timestamp threshold indicating that all events with timestamps below this threshold have been processed.
§Overview
The watermarking system supports:
- Bounded out-of-orderness handling
- Per-partition watermark tracking
- Idle partition detection
- Periodic and punctuated watermark generation
- Late event detection and handling
§Example
use processor::watermark::{Watermark, BoundedOutOfOrdernessWatermark, WatermarkGenerator};
use std::time::Duration;
let mut generator = BoundedOutOfOrdernessWatermark::new(
Duration::from_secs(10), // 10 second max out-of-orderness
Some(Duration::from_secs(60)) // 60 second idle timeout
);
// Process an event with timestamp 1000ms
if let Some(watermark) = generator.on_event(1000, 0) {
println!("New watermark: {:?}", watermark);
}Structs§
- Bounded
OutOf Orderness Config - Configuration for bounded out-of-orderness watermarking
- Bounded
OutOf Orderness Watermark - Bounded out-of-orderness watermark generator
- Late
Event Config - Late event handler configuration
- Late
Event Handler - Handler for late events
- Late
Event Stats - Statistics for late event handling
- Periodic
Watermark - Periodic watermark generator
- Periodic
Watermark Config - Configuration for periodic watermark emission
- Punctuated
Watermark - Punctuated watermark generator
- Watermark
- Represents a watermark timestamp
Traits§
- Watermark
Generator - Trait for generating watermarks from event streams