Skip to main content

UpdatesTyped

Struct UpdatesTyped 

Source
pub struct UpdatesTyped<U: Update> {
    pub keys: Lists<ContainerOf<U::Key>>,
    pub vals: Lists<ContainerOf<U::Val>>,
    pub times: Lists<ContainerOf<U::Time>>,
    pub diffs: Lists<ContainerOf<U::Diff>>,
}
Expand description

Trie-structured update storage using columnar containers.

Four nested layers of Lists:

  • keys: lists of keys (outer lists are independent groups)
  • vals: per-key, lists of vals
  • times: per-val, lists of times
  • diffs: per-time, lists of diffs (singletons when consolidated)

A flat unsorted input has stride 1 at every level (one key per entry, one val per key, one time per val, one diff per time). A fully consolidated trie has a single outer key list, all lists sorted and deduplicated, and singleton diff lists.

Fields§

§keys: Lists<ContainerOf<U::Key>>

Outer key list (one entry per group of keys at the trie root).

§vals: Lists<ContainerOf<U::Val>>

Per-key list of vals.

§times: Lists<ContainerOf<U::Time>>

Per-val list of times.

§diffs: Lists<ContainerOf<U::Diff>>

Per-time list of diffs (one diff per time after consolidation).

Implementations§

Source§

impl<U: Update> UpdatesTyped<U>

Source

pub fn view(&self) -> UpdatesView<'_, U>

Borrow the four columns as a single UpdatesView.

Source§

impl<U: Update> UpdatesTyped<U>

Source

pub fn extend_from_keys( &mut self, other: UpdatesView<'_, U>, key_range: Range<usize>, )

Copies other[key_range] into self, keys and all.

Source

pub fn form_unsorted<'a>( unsorted: impl Iterator<Item = Ref<'a, Tuple<U>>>, ) -> Self

Forms a consolidated UpdatesTyped trie from unsorted (key, val, time, diff) refs.

Source

pub fn form<'a>(sorted: impl Iterator<Item = Ref<'a, Tuple<U>>>) -> Self

Forms a consolidated UpdatesTyped trie from sorted (key, val, time, diff) refs.

Source

pub fn consolidate(self) -> Self

Consolidates into canonical trie form: single outer key list, all lists sorted and deduplicated, diff lists are singletons (or absent if cancelled).

Source

pub fn filter_zero(self) -> Self

Drop entries whose diff list is empty (cancelled), rebuilding the trie.

Source

pub fn len(&self) -> usize

The number of leaf-level diff entries (total updates).

Source§

impl<U: Update> UpdatesTyped<U>

Source

pub fn iter( &self, ) -> impl Iterator<Item = (Ref<'_, U::Key>, Ref<'_, U::Val>, Ref<'_, U::Time>, Ref<'_, U::Diff>)>

Iterate all (key, val, time, diff) entries as refs.

Trait Implementations§

Source§

impl<U: Update> Accountable for UpdatesTyped<U>

Source§

fn record_count(&self) -> i64

The number of records Read more
Source§

fn is_empty(&self) -> bool

Determine if this contains any updates, corresponding to update_count() == 0. It is a correctness error for this to be anything other than self.record_count() == 0.
Source§

impl<U: Update> Clone for UpdatesTyped<U>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<U: Update> ContainerBytes for UpdatesTyped<U>

Source§

fn from_bytes(_bytes: Bytes) -> Self

Wrap bytes as Self.
Source§

fn length_in_bytes(&self) -> usize

The number of bytes required to serialize the data.
Source§

fn into_bytes<W: Write>(&self, _writer: &mut W)

Writes the binary representation into writer.
Source§

impl<U: Update> Debug for UpdatesTyped<U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<U: Update> Default for UpdatesTyped<U>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<U: Update, B> From<UpdatesTyped<U>> for Updates<U, B>

Source§

fn from(owned: UpdatesTyped<U>) -> Self

Converts to this type from the input type.
Source§

impl<KP, VP, TP, DP, U: Update> Push<(KP, VP, TP, DP)> for UpdatesTyped<U>
where ContainerOf<U::Key>: Push<KP>, ContainerOf<U::Val>: Push<VP>, ContainerOf<U::Time>: Push<TP>, ContainerOf<U::Diff>: Push<DP>,

Push a single flat update as a stride-1 entry.

Each field is independently typed — columnar refs, &Owned, owned values, or any other type the column container accepts via its Push impl.

Source§

fn push(&mut self, (key, val, time, diff): (KP, VP, TP, DP))

Pushes an item onto self.
Source§

fn extend(&mut self, iter: impl IntoIterator<Item = T>)

Pushes elements of an iterator onto self.
Source§

impl<U: Update> PushInto<((<U as ColumnarUpdate>::Key, <U as ColumnarUpdate>::Val), <U as ColumnarUpdate>::Time, <U as ColumnarUpdate>::Diff)> for UpdatesTyped<U>

PushInto for the ((K, V), T, R) shape that reduce_trace uses.

Source§

fn push_into( &mut self, ((key, val), time, diff): ((U::Key, U::Val), U::Time, U::Diff), )

Push item into self.
Source§

impl<U: Update> PushInto<UpdatesTyped<U>> for MergeBatcher<U>

Source§

fn push_into(&mut self, chunk: UpdatesTyped<U>)

Push item into self.

Auto Trait Implementations§

§

impl<U> Freeze for UpdatesTyped<U>

§

impl<U> RefUnwindSafe for UpdatesTyped<U>

§

impl<U> Send for UpdatesTyped<U>

§

impl<U> Sync for UpdatesTyped<U>

§

impl<U> Unpin for UpdatesTyped<U>

§

impl<U> UnsafeUnpin for UpdatesTyped<U>

§

impl<U> UnwindSafe for UpdatesTyped<U>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<C> Container for C
where C: Accountable + Default + 'static,