Skip to main content

Spine

pub struct Spine<B: Batch> { /* private fields */ }
Expand description

An append-only collection of update tuples.

A spine maintains a small number of immutable collections of update tuples, merging the collections when two have similar sizes. In this way, it allows the addition of more tuples, which may then be merged with other immutable collections.

Implementations§

Source§

impl<B: Batch> Spine<B>

Source

pub fn with_effort( effort: usize, operator: OperatorInfo, logger: Option<Logger>, activator: Option<Activator>, ) -> Self

Allocates a fueled Spine with a specified effort multiplier.

This trace will merge batches progressively, with each inserted batch applying a multiple of the batch’s length in effort to each merge. The effort parameter is that multiplier. This value should be at least one for the merging to happen; a value of zero is not helpful.

Source

pub fn introduce_batch(&mut self, batch: Option<B>, batch_index: usize)

Introduces a batch at an indicated level.

The level indication is often related to the size of the batch, but it can also be used to artificially fuel the computation by supplying empty batches at non-trivial indices, to move merges along.

Source

pub fn apply_fuel(&mut self, fuel: &mut isize)

Applies an amount of fuel to merges in progress.

The supplied fuel is for each in progress merge, and if we want to spend the fuel non-uniformly (e.g. prioritizing merges at low layers) we could do so in order to maintain fewer batches on average (at the risk of completing merges of large batches later, but tbh probably not much later).

Trait Implementations§

Source§

impl<B: Batch> Drop for Spine<B>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<B: Batch + Clone + 'static> Trace for Spine<B>

Source§

fn exert(&mut self)

Apply some amount of effort to trace maintenance.

Whether and how much effort to apply is determined by self.exert_logic, a closure the user can set.

Source§

fn close(&mut self)

Completes the trace with a final empty batch.

Source§

fn new( info: OperatorInfo, logging: Option<Logger>, activator: Option<Activator>, ) -> Self

Allocates a new empty trace.
Source§

fn set_exert_logic(&mut self, logic: ExertionLogic)

Sets the logic for exertion in the absence of updates. Read more
Source§

fn insert(&mut self, batch: Self::Batch)

Introduces a batch of updates to the trace. Read more
Source§

impl<B: Batch + Clone + 'static> TraceReader for Spine<B>

Source§

type Time = <B as BatchReader>::Time

The timestamp type of the trace’s updates. Read more
Source§

type Batch = B

The type of an immutable collection of updates.
Source§

fn batches_through( &mut self, upper: AntichainRef<'_, Self::Time>, ) -> Option<Vec<Self::Batch>>

Acquires the non-empty sequence of batches covering updates at times not greater or equal to an element of upper. Read more
Source§

fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, B::Time>)

Advances the frontier that constrains logical compaction. Read more
Source§

fn get_logical_compaction(&mut self) -> AntichainRef<'_, B::Time>

Reports the logical compaction frontier. Read more
Source§

fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, B::Time>)

Advances the frontier that constrains physical compaction. Read more
Source§

fn get_physical_compaction(&mut self) -> AntichainRef<'_, B::Time>

Reports the physical compaction frontier. Read more
Source§

fn map_batches<F: FnMut(&Self::Batch)>(&self, f: F)

Maps logic across the non-empty sequence of batches in the trace. Read more
Source§

fn cursor( &mut self, ) -> (CursorList<<Self::Batch as Navigable>::Cursor>, Vec<Self::Batch>)
where Self::Batch: Navigable,

Provides a cursor over updates contained in the trace.
Source§

fn cursor_through( &mut self, upper: AntichainRef<'_, Self::Time>, ) -> Option<(CursorList<<Self::Batch as Navigable>::Cursor>, Vec<Self::Batch>)>
where Self::Batch: Navigable,

Acquires a cursor to the restriction of the collection’s contents to updates at times not greater or equal to an element of upper. Read more
Source§

fn read_upper(&mut self, target: &mut Antichain<Self::Time>)

Reads the upper frontier of committed times.
Source§

fn advance_upper(&mut self, upper: &mut Antichain<Self::Time>)

Advances upper by any empty batches. Read more

Auto Trait Implementations§

§

impl<B> !RefUnwindSafe for Spine<B>

§

impl<B> !Send for Spine<B>

§

impl<B> !Sync for Spine<B>

§

impl<B> !UnwindSafe for Spine<B>

§

impl<B> Freeze for Spine<B>
where <B as BatchReader>::Time: Freeze,

§

impl<B> Unpin for Spine<B>
where B: Unpin, <B as Batch>::Merger: Unpin, <B as BatchReader>::Time: Unpin,

§

impl<B> UnsafeUnpin for Spine<B>
where <B as BatchReader>::Time: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<'a, S, T> Semigroup<&'a S> for T
where T: Semigroup<S>,

Source§

fn plus_equals(&mut self, rhs: &&'a S)

The method of std::ops::AddAssign, for types that do not implement AddAssign.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.