Struct mz_persist_client::internal::maintenance::RoutineMaintenance
source · pub struct RoutineMaintenance {
pub(crate) garbage_collection: Option<GcReq>,
pub(crate) write_rollup: Option<SeqNo>,
}
Expand description
Every handle to this shard may be occasionally asked to perform routine maintenance after a successful compare_and_set operation.
For one-shot operations (like registering a reader) handles are allowed to skip routine maintenance if necessary, as the same maintenance operations will be recomputed by the next successful compare_and_set of any handle.
Operations that run regularly once a handle is registered, such as heartbeats, are expected to always perform maintenance.
Fields§
§garbage_collection: Option<GcReq>
§write_rollup: Option<SeqNo>
Implementations§
source§impl RoutineMaintenance
impl RoutineMaintenance
pub(crate) fn is_empty(&self) -> bool
sourcepub(crate) fn start_performing<K, V, T, D>(
self,
machine: &Machine<K, V, T, D>,
gc: &GarbageCollector<K, V, T, D>,
)
pub(crate) fn start_performing<K, V, T, D>( self, machine: &Machine<K, V, T, D>, gc: &GarbageCollector<K, V, T, D>, )
Initiates any routine maintenance necessary in background tasks
sourcepub(crate) async fn perform<K, V, T, D>(
self,
machine: &Machine<K, V, T, D>,
gc: &GarbageCollector<K, V, T, D>,
)
pub(crate) async fn perform<K, V, T, D>( self, machine: &Machine<K, V, T, D>, gc: &GarbageCollector<K, V, T, D>, )
Performs any routine maintenance necessary. Returns when all background tasks have completed and the maintenance is done.
Generally, clients should prefer start_performing
since it’s typically not critical
that maintenance is performed by any particular deadline.
sourcefn perform_in_background<K, V, T, D>(
self,
machine: &Machine<K, V, T, D>,
gc: &GarbageCollector<K, V, T, D>,
) -> Vec<BoxFuture<'static, RoutineMaintenance>>
fn perform_in_background<K, V, T, D>( self, machine: &Machine<K, V, T, D>, gc: &GarbageCollector<K, V, T, D>, ) -> Vec<BoxFuture<'static, RoutineMaintenance>>
Initiates maintenance work in the background, either through spawned tasks or by sending messages to existing tasks. The returned futures may be awaited to know when the work is completed, but do not need to be polled to drive the work to completion.
sourcepub fn merge(&mut self, other: RoutineMaintenance)
pub fn merge(&mut self, other: RoutineMaintenance)
Merges another maintenance request into this one.
other
is expected to come “later”, and so its maintenance might
override self
’s maintenance.
Trait Implementations§
source§impl Debug for RoutineMaintenance
impl Debug for RoutineMaintenance
source§impl Default for RoutineMaintenance
impl Default for RoutineMaintenance
source§fn default() -> RoutineMaintenance
fn default() -> RoutineMaintenance
source§impl PartialEq for RoutineMaintenance
impl PartialEq for RoutineMaintenance
impl StructuralPartialEq for RoutineMaintenance
Auto Trait Implementations§
impl Freeze for RoutineMaintenance
impl RefUnwindSafe for RoutineMaintenance
impl Send for RoutineMaintenance
impl Sync for RoutineMaintenance
impl Unpin for RoutineMaintenance
impl UnwindSafe for RoutineMaintenance
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
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.