Struct mz_persist_client::internal::trace::Trace
source · pub struct Trace<T> {
spine: Spine<T>,
pub(crate) roundtrip_structure: bool,
}
Expand description
An append-only collection of compactable update batches.
In an effort to keep our fork of Spine as close as possible to the original, we push as many changes as possible into this wrapper.
Fields§
§spine: Spine<T>
§roundtrip_structure: bool
Implementations§
source§impl<T> Trace<T>
impl<T> Trace<T>
pub fn since(&self) -> &Antichain<T>
pub fn upper(&self) -> &Antichain<T>
pub fn map_batches<'a, F: FnMut(&'a HollowBatch<T>)>(&'a self, f: F)
pub fn batches(&self) -> impl Iterator<Item = &HollowBatch<T>>
pub fn num_spine_batches(&self) -> usize
source§impl<T: Timestamp + Lattice> Trace<T>
impl<T: Timestamp + Lattice> Trace<T>
pub fn downgrade_since(&mut self, since: &Antichain<T>)
pub fn push_batch(&mut self, batch: HollowBatch<T>) -> Vec<FueledMergeReq<T>>
pub fn claim_compaction(&mut self, id: SpineId, compaction: ActiveCompaction)
sourcepub(crate) fn push_batch_no_merge_reqs(&mut self, batch: HollowBatch<T>)
pub(crate) fn push_batch_no_merge_reqs(&mut self, batch: HollowBatch<T>)
The same as Self::push_batch but without the FueledMergeReq
s, which
account for a surprising amount of cpu in prod. database-issues#5411
sourcepub fn exert(&mut self, fuel: usize) -> (Vec<FueledMergeReq<T>>, bool)
pub fn exert(&mut self, fuel: usize) -> (Vec<FueledMergeReq<T>>, bool)
Apply some amount of effort to trace maintenance.
The units of effort are updates, and the method should be thought of as analogous to inserting as many empty updates, where the trace is permitted to perform proportionate work.
Returns true if this did work and false if it left the spine unchanged.
sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validates invariants.
See Spine::validate
for details.
pub fn apply_merge_res(&mut self, res: &FueledMergeRes<T>) -> ApplyMergeResult
sourcepub(crate) fn fueled_merge_reqs_before_ms(
&self,
threshold_ms: u64,
threshold_writer: Option<WriterKey>,
) -> impl Iterator<Item = FueledMergeReq<T>> + '_
pub(crate) fn fueled_merge_reqs_before_ms( &self, threshold_ms: u64, threshold_writer: Option<WriterKey>, ) -> impl Iterator<Item = FueledMergeReq<T>> + '_
Obtain all fueled merge reqs that either have no active compaction, or the previous compaction was started at or before the threshold time, in order from oldest to newest.
fn remove_redundant_merge_reqs( merge_reqs: Vec<FueledMergeReq<T>>, ) -> Vec<FueledMergeReq<T>>
pub fn spine_metrics(&self) -> SpineMetrics
Trait Implementations§
source§impl<T: Timestamp + Lattice + Codec64> RustType<ProtoTrace> for Trace<T>
impl<T: Timestamp + Lattice + Codec64> RustType<ProtoTrace> for Trace<T>
source§fn into_proto(&self) -> ProtoTrace
fn into_proto(&self) -> ProtoTrace
Self
into a Proto
value.source§fn from_proto(proto: ProtoTrace) -> Result<Self, TryFromProtoError>
fn from_proto(proto: ProtoTrace) -> Result<Self, TryFromProtoError>
source§fn into_proto_owned(self) -> Proto
fn into_proto_owned(self) -> Proto
Self::into_proto
that types can
optionally implement, otherwise, the default implementation
delegates to Self::into_proto
.Auto Trait Implementations§
impl<T> Freeze for Trace<T>where
T: Freeze,
impl<T> RefUnwindSafe for Trace<T>where
T: RefUnwindSafe,
impl<T> Send for Trace<T>
impl<T> Sync for Trace<T>
impl<T> Unpin for Trace<T>where
T: Unpin,
impl<T> UnwindSafe for Trace<T>where
T: RefUnwindSafe + 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp 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
.