pub struct WatermarkUpdate<T>(/* private fields */);Expand description
Update from ranks for watermark accumulator using Last-Writer-Wins CRDT.
This is a proper CRDT that tracks the latest value from each rank using logical timestamps. When updates from the same rank are merged, the one with the higher timestamp wins. This allows ranks to report values that may decrease (e.g., during failure recovery) while maintaining proper commutativity and idempotence.
§CRDT Properties
- Commutative: Merge order doesn’t matter (timestamps resolve conflicts)
- Idempotent: Merging duplicate updates has no effect
- Convergent: All replicas converge to the same state
§Watermark Semantics
The watermark is the minimum value across all ranks’ latest reports. “Latest” is determined by logical timestamp, not arrival order.
Implementations§
Source§impl<T: Ord + Clone> WatermarkUpdate<T>
impl<T: Ord + Clone> WatermarkUpdate<T>
Sourcepub fn get(&self) -> &T
pub fn get(&self) -> &T
Get the watermark value (minimum of all ranks’ current values).
WatermarkUpdate is guaranteed to be initialized by the accumulator before it is sent to the user.
Trait Implementations§
Source§impl<T: Clone> Clone for WatermarkUpdate<T>
impl<T: Clone> Clone for WatermarkUpdate<T>
Source§fn clone(&self) -> WatermarkUpdate<T>
fn clone(&self) -> WatermarkUpdate<T>
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 moreSource§impl<T: Debug> Debug for WatermarkUpdate<T>
impl<T: Debug> Debug for WatermarkUpdate<T>
Source§impl<T: Default> Default for WatermarkUpdate<T>
impl<T: Default> Default for WatermarkUpdate<T>
Source§fn default() -> WatermarkUpdate<T>
fn default() -> WatermarkUpdate<T>
Returns the “default value” for a type. Read more
Source§impl<'de, T> Deserialize<'de> for WatermarkUpdate<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for WatermarkUpdate<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Clone + PartialEq> JoinSemilattice for WatermarkUpdate<T>
impl<T: Clone + PartialEq> JoinSemilattice for WatermarkUpdate<T>
Source§impl<T: Named> Named for WatermarkUpdate<T>
impl<T: Named> Named for WatermarkUpdate<T>
Source§fn typename() -> &'static str
fn typename() -> &'static str
The globally unique type name for the type.
This should typically be the fully qualified Rust name of the type.
Source§fn typehash() -> u64
fn typehash() -> u64
A globally unique hash for this type.
TODO: actually enforce perfect hashing
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
The TypeId for this type. TypeIds are unique only within a binary,
and should not be used for global identification.
Source§fn port() -> u64
fn port() -> u64
The globally unique port for this type. Typed ports are in the range
of 1<<63..1<<64-1.
Auto Trait Implementations§
impl<T> Freeze for WatermarkUpdate<T>
impl<T> RefUnwindSafe for WatermarkUpdate<T>where
T: RefUnwindSafe,
impl<T> Send for WatermarkUpdate<T>where
T: Send,
impl<T> Sync for WatermarkUpdate<T>where
T: Sync,
impl<T> Unpin for WatermarkUpdate<T>where
T: Unpin,
impl<T> UnwindSafe for WatermarkUpdate<T>where
T: UnwindSafe,
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> Checkpointable for Twhere
T: RemoteMessage + Clone,
impl<T> Checkpointable for Twhere
T: RemoteMessage + Clone,
Source§type State = T
type State = T
The type of the state that is saved. The state can be serialized and deserialized
from persistent storage.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].