Enum mz_persist_client::internal::trace::MergeState
source · enum MergeState<T> {
Vacant,
Single(Option<SpineBatch<T>>),
Double(MergeVariant<T>),
}
Expand description
Describes the state of a layer.
A layer can be empty, contain a single batch, or contain a pair of batches that are in the process of merging into a batch for the next layer.
Variants§
Vacant
An empty layer, containing no updates.
Single(Option<SpineBatch<T>>)
A layer containing a single batch.
The None
variant is used to represent a structurally empty batch
present to ensure the progress of maintenance work.
Double(MergeVariant<T>)
A layer containing two batches, in the process of merging.
Implementations§
source§impl<T: Timestamp + Lattice> MergeState<T>
impl<T: Timestamp + Lattice> MergeState<T>
sourcefn complete(&mut self, log: &mut SpineLog<'_, T>) -> Option<SpineBatch<T>>
fn complete(&mut self, log: &mut SpineLog<'_, T>) -> Option<SpineBatch<T>>
Immediately complete any merge.
The result is either a batch, if there is a non-trivial batch to return
or None
if there is no meaningful batch to return. This does not
distinguish between Vacant entries and structurally empty batches, which
should be done with the is_complete()
method.
There is the additional option of input batches.
sourcefn is_complete(&mut self) -> bool
fn is_complete(&mut self) -> bool
True iff the layer is a complete merge, ready for extraction.
sourcefn work(&mut self, fuel: &mut isize, log: &mut SpineLog<'_, T>)
fn work(&mut self, fuel: &mut isize, log: &mut SpineLog<'_, T>)
Performs a bounded amount of work towards a merge.
If the merge completes, the resulting batch is returned. If a batch is returned, it is the obligation of the caller to correctly install the result.
sourcefn begin_merge(
batch1: Option<SpineBatch<T>>,
batch2: Option<SpineBatch<T>>,
compaction_frontier: Option<AntichainRef<'_, T>>
) -> MergeState<T>
fn begin_merge( batch1: Option<SpineBatch<T>>, batch2: Option<SpineBatch<T>>, compaction_frontier: Option<AntichainRef<'_, T>> ) -> MergeState<T>
Initiates the merge of an “old” batch with a “new” batch.
The upper frontier of the old batch should match the lower frontier of the new batch, with the resulting batch describing their composed interval, from the lower frontier of the old batch to the upper frontier of the new batch.
Either batch may be None
which corresponds to a structurally empty
batch whose upper and lower frontiers are equal. This option exists
purely for bookkeeping purposes, and no computation is performed to
merge the two batches.
Trait Implementations§
source§impl<T: Clone> Clone for MergeState<T>
impl<T: Clone> Clone for MergeState<T>
source§fn clone(&self) -> MergeState<T>
fn clone(&self) -> MergeState<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> RefUnwindSafe for MergeState<T>where T: RefUnwindSafe,
impl<T> Send for MergeState<T>where T: Send + Sync,
impl<T> Sync for MergeState<T>where T: Send + Sync,
impl<T> Unpin for MergeState<T>where T: Unpin,
impl<T> UnwindSafe for MergeState<T>where T: UnwindSafe + RefUnwindSafe,
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
.