pub struct Rebuild { /* private fields */ }Expand description
Full filter, quick filter and sort of the whole snapshot.
A large snapshot is split across threads: each thread takes rows in
chunks, keeps the visible ones and sorts them, and the sorted runs are
merged. Every row has its own insertion sequence, the last sort key, so
the order is the same on any number of threads. By default a rebuild
leaves two cores to the UI thread and ingest and uses at most eight
(Self::with_max_threads changes that). On wasm and for small
snapshots it runs on the calling thread alone.
Implementations§
Source§impl Rebuild
impl Rebuild
Sourcepub fn with_max_threads(self, threads: usize) -> Self
pub fn with_max_threads(self, threads: usize) -> Self
Splits a rebuild across at most threads threads, the calling one
included: 1 rebuilds on the calling thread alone, and 0 counts as
1. Each thread still takes at least 8192 rows, so a small snapshot
stays on one thread whatever the count. The count is used as given:
neither the cores of the machine nor the default’s limit of eight cap
it. On wasm a rebuild always runs on the calling thread.
The default is the available cores less two (for the UI thread and ingest), at least one and at most eight.
Sourcepub fn max_threads(&self) -> usize
pub fn max_threads(&self) -> usize
The most threads one rebuild uses, the calling one included: the
count given to Self::with_max_threads, or the default budget.
Always 1 on wasm.
Trait Implementations§
Source§impl<R: GridRow> ProjectionEngine<R> for Rebuild
impl<R: GridRow> ProjectionEngine<R> for Rebuild
Source§fn rebuild(&self, snapshot: &StoreSnapshot<R>, spec: &ViewSpec<R>) -> Projection
fn rebuild(&self, snapshot: &StoreSnapshot<R>, spec: &ViewSpec<R>) -> Projection
snapshot for spec.Source§fn compact(
&self,
previous: &Projection,
snapshot: &StoreSnapshot<R>,
) -> Projection
fn compact( &self, previous: &Projection, snapshot: &StoreSnapshot<R>, ) -> Projection
previous was built. Removing rows never
reorders the rest and never makes a filtered-out row visible, so this
is an O(n) filter, with no sorting. With groups it also recounts
them, drops the emptied ones and lays the lines out again with each
group’s expansion; the aggregate job (Self::aggregate) refreshes
the aggregates.Source§fn aggregate(
&self,
previous: &Projection,
snapshot: &StoreSnapshot<R>,
spec: &ViewSpec<R>,
) -> Projection
fn aggregate( &self, previous: &Projection, snapshot: &StoreSnapshot<R>, spec: &ViewSpec<R>, ) -> Projection
previous with fresh aggregates and row counts from
snapshot. Neither reorders nor drops rows: Self::compact drops
removed ones. Groups combine their subgroups in key order, as a
rebuild does, so over the same order the result is the rebuild’s.Source§fn expand(
&self,
previous: &Projection,
snapshot: &StoreSnapshot<R>,
spec: &ViewSpec<R>,
) -> Projection
fn expand( &self, previous: &Projection, snapshot: &StoreSnapshot<R>, spec: &ViewSpec<R>, ) -> Projection
previous laid out for spec.expansion(). The
snapshot resolves the keys of tree rows: a tree is expanded by key.impl Copy for Rebuild
Auto Trait Implementations§
impl Freeze for Rebuild
impl RefUnwindSafe for Rebuild
impl Send for Rebuild
impl Sync for Rebuild
impl Unpin for Rebuild
impl UnsafeUnpin for Rebuild
impl UnwindSafe for Rebuild
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().