pub struct Spine<B: Batch, BA, BU> { /* 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, BA, BU> Spine<B, BA, BU>

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, BA, BU> Drop for Spine<B, BA, BU>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<B, BA, BU> Trace for Spine<B, BA, BU>
where B: Batch + Clone + 'static, BA: Batcher<Time = B::Time>, BU: Builder<Input = BA::Output, Time = BA::Time, Output = B>,

§

type Batcher = BA

A type used to assemble batches from disordered updates.

§

type Builder = BU

A type used to assemble batches from ordered update sequences.

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, BA, BU> TraceReader for Spine<B, BA, BU>
where B: Batch + Clone + 'static,

§

type Key<'a> = <B as BatchReader>::Key<'a>

Key by which updates are indexed.
§

type KeyOwned = <B as BatchReader>::KeyOwned

Owned version of the above.
§

type Val<'a> = <B as BatchReader>::Val<'a>

Values associated with keys.
§

type Time = <B as BatchReader>::Time

Timestamps associated with updates
§

type Diff = <B as BatchReader>::Diff

Associated update.
§

type Batch = B

The type of an immutable collection of updates.
§

type Storage = Vec<B>

Storage type for Self::Cursor. Likely related to Self::Batch.
§

type Cursor = CursorList<<B as BatchReader>::Cursor>

The type used to enumerate the collections contents.
source§

fn cursor_through( &mut self, upper: AntichainRef<'_, Self::Time> ) -> Option<(Self::Cursor, Self::Storage)>

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 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) -> (Self::Cursor, Self::Storage)

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

fn advance_by(&mut self, frontier: AntichainRef<'_, Self::Time>)

👎Deprecated since 0.11: please use set_logical_compaction
Deprecated form of set_logical_compaction.
source§

fn advance_frontier(&mut self) -> AntichainRef<'_, Self::Time>

👎Deprecated since 0.11: please use get_logical_compaction
Deprecated form of get_logical_compaction.
source§

fn distinguish_since(&mut self, frontier: AntichainRef<'_, Self::Time>)

👎Deprecated since 0.11: please use set_physical_compaction
Deprecated form of set_physical_compaction.
source§

fn distinguish_frontier(&mut self) -> AntichainRef<'_, Self::Time>

👎Deprecated since 0.11: please use get_physical_compaction
Deprecated form of get_physical_compaction.
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, BA, BU> Freeze for Spine<B, BA, BU>

§

impl<B, BA, BU> !RefUnwindSafe for Spine<B, BA, BU>

§

impl<B, BA, BU> !Send for Spine<B, BA, BU>

§

impl<B, BA, BU> !Sync for Spine<B, BA, BU>

§

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

§

impl<B, BA, BU> !UnwindSafe for Spine<B, BA, BU>

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<R, O, T> CopyOnto<ConsecutiveOffsetPairs<R, O>> for T
where R: Region<Index = (usize, usize)>, O: OffsetContainer<usize>, T: CopyOnto<R>,

source§

fn copy_onto( self, target: &mut ConsecutiveOffsetPairs<R, O> ) -> <ConsecutiveOffsetPairs<R, O> as Region>::Index

Copy self into the target container, returning an index that allows to look up the corresponding read item.
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<R, T> PushInto<FlatStack<R>> for T
where R: Region + Clone + 'static, T: CopyOnto<R>,

source§

fn push_into(self, target: &mut FlatStack<R>)

Push self into the target container.
source§

impl<T> PushInto<Vec<T>> for T

source§

fn push_into(self, target: &mut Vec<T>)

Push self into the target container.
source§

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

§

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>,

§

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.