Struct mz_compute_client::controller::replicated::ReportedUppers
source · [−]struct ReportedUppers<T> {
per_replica: HashMap<ReplicaId, Antichain<T>>,
bounds: FrontierBounds<T>,
}
Expand description
Reported upper frontiers for a single compute collection.
The type maintains the following invariants:
- replica frontiers only advance
- frontier bounds only advance
bounds.lower
<=bounds.upper
bounds.lower
is the lower bound of the frontiers of all active replicasbounds.upper
is the upper bound of the frontiers of all replicas
Fields
per_replica: HashMap<ReplicaId, Antichain<T>>
The reported uppers per replica.
bounds: FrontierBounds<T>
The lower and upper bound of all reported uppers.
Implementations
sourceimpl<T> ReportedUppers<T>where
T: Timestamp + Lattice,
impl<T> ReportedUppers<T>where
T: Timestamp + Lattice,
sourcefn new(replica_ids: &BTreeSet<ReplicaId>) -> Self
fn new(replica_ids: &BTreeSet<ReplicaId>) -> Self
Construct a ReportedUppers
that tracks frontiers of the given replicas.
sourcefn add_replica(&mut self, id: ReplicaId)
fn add_replica(&mut self, id: ReplicaId)
sourcefn remove_replica(&mut self, id: ReplicaId) -> bool
fn remove_replica(&mut self, id: ReplicaId) -> bool
Stop tracking the given replica.
Returns true
iff the update caused a change in any of the two bounds.
Panics
- If the given
replica_id
is not tracked.
sourcefn tracks_replica(&self, id: ReplicaId) -> bool
fn tracks_replica(&self, id: ReplicaId) -> bool
Return whether the given replica’s frontiers are tracked.
sourcefn update(&mut self, replica_id: ReplicaId, new_upper: Antichain<T>) -> bool
fn update(&mut self, replica_id: ReplicaId, new_upper: Antichain<T>) -> bool
Apply a frontier update from a single replica.
Returns true
iff the update caused a change in any of the two bounds.
Panics
- If the given
replica_id
is not tracked.
sourcefn update_lower_bound(&mut self) -> bool
fn update_lower_bound(&mut self) -> bool
Update bounds.lower
to restore its invariants.
Returns true
iff the update caused a change in the lower bound.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for ReportedUppers<T>where
T: RefUnwindSafe,
impl<T> Send for ReportedUppers<T>where
T: Send,
impl<T> Sync for ReportedUppers<T>where
T: Sync,
impl<T> Unpin for ReportedUppers<T>where
T: Unpin,
impl<T> UnwindSafe for ReportedUppers<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
sourcefn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See
RustType::from_proto
.sourcefn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See
RustType::into_proto
.