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>
impl<B: Batch> Spine<B>
Sourcepub fn with_effort(
effort: usize,
operator: OperatorInfo,
logger: Option<Logger>,
activator: Option<Activator>,
) -> Self
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.
Sourcepub fn introduce_batch(&mut self, batch: Option<B>, batch_index: usize)
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.
Sourcepub fn apply_fuel(&mut self, fuel: &mut isize)
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 + Clone + 'static> Trace for Spine<B>
impl<B: Batch + Clone + 'static> Trace for Spine<B>
Source§fn exert(&mut self)
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 new(
info: OperatorInfo,
logging: Option<Logger>,
activator: Option<Activator>,
) -> Self
fn new( info: OperatorInfo, logging: Option<Logger>, activator: Option<Activator>, ) -> Self
Source§fn set_exert_logic(&mut self, logic: ExertionLogic)
fn set_exert_logic(&mut self, logic: ExertionLogic)
Source§impl<B: Batch + Clone + 'static> TraceReader for Spine<B>
impl<B: Batch + Clone + 'static> TraceReader for Spine<B>
Source§type Cursor = CursorList<<B as BatchReader>::Cursor>
type Cursor = CursorList<<B as BatchReader>::Cursor>
Source§fn cursor_through(
&mut self,
upper: AntichainRef<'_, Self::Time>,
) -> Option<(Self::Cursor, Self::Storage)>
fn cursor_through( &mut self, upper: AntichainRef<'_, Self::Time>, ) -> Option<(Self::Cursor, Self::Storage)>
upper
. Read moreSource§fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, B::Time>)
fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, B::Time>)
Source§fn get_logical_compaction(&mut self) -> AntichainRef<'_, B::Time>
fn get_logical_compaction(&mut self) -> AntichainRef<'_, B::Time>
Source§fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, B::Time>)
fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, B::Time>)
Source§fn get_physical_compaction(&mut self) -> AntichainRef<'_, B::Time>
fn get_physical_compaction(&mut self) -> AntichainRef<'_, B::Time>
Source§fn map_batches<F: FnMut(&Self::Batch)>(&self, f: F)
fn map_batches<F: FnMut(&Self::Batch)>(&self, f: F)
Source§fn cursor(&mut self) -> (Self::Cursor, Self::Storage)
fn cursor(&mut self) -> (Self::Cursor, Self::Storage)
Source§fn read_upper(&mut self, target: &mut Antichain<Self::Time>)
fn read_upper(&mut self, target: &mut Antichain<Self::Time>)
Source§impl<B: Batch> WithLayout for Spine<B>
impl<B: Batch> WithLayout for Spine<B>
Source§type Layout = <B as WithLayout>::Layout
type Layout = <B as WithLayout>::Layout
Auto Trait Implementations§
impl<B> Freeze for Spine<B>
impl<B> !RefUnwindSafe for Spine<B>
impl<B> !Send for Spine<B>
impl<B> !Sync for Spine<B>
impl<B> Unpin for Spine<B>
impl<B> !UnwindSafe for Spine<B>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<L> LayoutExt for Lwhere
L: WithLayout,
impl<L> LayoutExt for Lwhere
L: WithLayout,
Source§type KeyOwn = <<<L as WithLayout>::Layout as Layout>::KeyContainer as BatchContainer>::Owned
type KeyOwn = <<<L as WithLayout>::Layout as Layout>::KeyContainer as BatchContainer>::Owned
Source§type Key<'a> = <<<L as WithLayout>::Layout as Layout>::KeyContainer as BatchContainer>::ReadItem<'a>
type Key<'a> = <<<L as WithLayout>::Layout as Layout>::KeyContainer as BatchContainer>::ReadItem<'a>
Source§type ValOwn = <<<L as WithLayout>::Layout as Layout>::ValContainer as BatchContainer>::Owned
type ValOwn = <<<L as WithLayout>::Layout as Layout>::ValContainer as BatchContainer>::Owned
Source§type Val<'a> = <<<L as WithLayout>::Layout as Layout>::ValContainer as BatchContainer>::ReadItem<'a>
type Val<'a> = <<<L as WithLayout>::Layout as Layout>::ValContainer as BatchContainer>::ReadItem<'a>
Source§type Time = <<<L as WithLayout>::Layout as Layout>::TimeContainer as BatchContainer>::Owned
type Time = <<<L as WithLayout>::Layout as Layout>::TimeContainer as BatchContainer>::Owned
Source§type TimeGat<'a> = <<<L as WithLayout>::Layout as Layout>::TimeContainer as BatchContainer>::ReadItem<'a>
type TimeGat<'a> = <<<L as WithLayout>::Layout as Layout>::TimeContainer as BatchContainer>::ReadItem<'a>
Source§type Diff = <<<L as WithLayout>::Layout as Layout>::DiffContainer as BatchContainer>::Owned
type Diff = <<<L as WithLayout>::Layout as Layout>::DiffContainer as BatchContainer>::Owned
Source§type DiffGat<'a> = <<<L as WithLayout>::Layout as Layout>::DiffContainer as BatchContainer>::ReadItem<'a>
type DiffGat<'a> = <<<L as WithLayout>::Layout as Layout>::DiffContainer as BatchContainer>::ReadItem<'a>
Source§type KeyContainer = <<L as WithLayout>::Layout as Layout>::KeyContainer
type KeyContainer = <<L as WithLayout>::Layout as Layout>::KeyContainer
Source§type ValContainer = <<L as WithLayout>::Layout as Layout>::ValContainer
type ValContainer = <<L as WithLayout>::Layout as Layout>::ValContainer
Source§type TimeContainer = <<L as WithLayout>::Layout as Layout>::TimeContainer
type TimeContainer = <<L as WithLayout>::Layout as Layout>::TimeContainer
Source§type DiffContainer = <<L as WithLayout>::Layout as Layout>::DiffContainer
type DiffContainer = <<L as WithLayout>::Layout as Layout>::DiffContainer
Source§fn owned_key(key: <L as LayoutExt>::Key<'_>) -> <L as LayoutExt>::KeyOwn
fn owned_key(key: <L as LayoutExt>::Key<'_>) -> <L as LayoutExt>::KeyOwn
Source§fn owned_val(val: <L as LayoutExt>::Val<'_>) -> <L as LayoutExt>::ValOwn
fn owned_val(val: <L as LayoutExt>::Val<'_>) -> <L as LayoutExt>::ValOwn
Source§fn owned_time(time: <L as LayoutExt>::TimeGat<'_>) -> <L as LayoutExt>::Time
fn owned_time(time: <L as LayoutExt>::TimeGat<'_>) -> <L as LayoutExt>::Time
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
.