pub struct Spine<B>where
B: Batch,{ /* private fields */ }Expand description
Persistence optimized trace implementation based on collection and merging immutable batches of updates.
This spine works asynchronously. The batches exposed to cursors are maintained separately from the batches currently being merged by an asynchronous thread. When one or more merges complete, the spine fetches the new (smaller) collection of batches from the thread in the next step. (It could fetch them earlier, but it might be unfriendly to expose potentially one form of data to a given cursor and then a different form to the next one within a single step.)
Implementations§
Source§impl<B> Spine<B>where
B: Batch,
impl<B> Spine<B>where
B: Batch,
Sourcepub fn with_effort(factories: &B::Factories, _effort: usize) -> Self
pub fn with_effort(factories: &B::Factories, _effort: usize) -> 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.
pub fn complete_merges(&mut self)
Trait Implementations§
Source§impl<B> Archive for Spine<B>where
B: Batch,
impl<B> Archive for Spine<B>where
B: Batch,
Source§impl<B> BatchReader for Spine<B>where
B: Batch,
impl<B> BatchReader for Spine<B>where
B: Batch,
Source§type Key = <B as BatchReader>::Key
type Key = <B as BatchReader>::Key
Source§type Val = <B as BatchReader>::Val
type Val = <B as BatchReader>::Val
Source§type Time = <B as BatchReader>::Time
type Time = <B as BatchReader>::Time
Source§type R = <B as BatchReader>::R
type R = <B as BatchReader>::R
type Factories = <B as BatchReader>::Factories
Source§type Cursor<'s> = SpineCursor<B>
type Cursor<'s> = SpineCursor<B>
fn factories(&self) -> Self::Factories
Source§fn approximate_byte_size(&self) -> usize
fn approximate_byte_size(&self) -> usize
Source§fn filter_stats(&self) -> BloomFilterStats
fn filter_stats(&self) -> BloomFilterStats
BloomFilterStats::default().Source§fn sample_keys<RG>(
&self,
rng: &mut RG,
sample_size: usize,
sample: &mut DynVec<Self::Key>,
)
fn sample_keys<RG>( &self, rng: &mut RG, sample_size: usize, sample: &mut DynVec<Self::Key>, )
Source§async fn fetch<KR>(
&self,
keys: &KR,
) -> Option<Box<dyn CursorFactory<Self::Key, Self::Val, Self::Time, Self::R>>>
async fn fetch<KR>( &self, keys: &KR, ) -> Option<Box<dyn CursorFactory<Self::Key, Self::Val, Self::Time, Self::R>>>
keys. May also return
None, the default implementation, if the batch doesn’t want to
implement this method. In particular, a batch for which access through
a cursor is fast should return None to avoid the expense of copying
data. Read moreSource§fn push_cursor(
&self,
) -> Box<dyn PushCursor<Self::Key, Self::Val, Self::Time, Self::R> + Send + '_>
fn push_cursor( &self, ) -> Box<dyn PushCursor<Self::Key, Self::Val, Self::Time, Self::R> + Send + '_>
Source§fn merge_cursor(
&self,
key_filter: Option<Filter<Self::Key>>,
value_filter: Option<GroupFilter<Self::Val>>,
) -> Box<dyn MergeCursor<Self::Key, Self::Val, Self::Time, Self::R> + Send + '_>
fn merge_cursor( &self, key_filter: Option<Filter<Self::Key>>, value_filter: Option<GroupFilter<Self::Val>>, ) -> Box<dyn MergeCursor<Self::Key, Self::Val, Self::Time, Self::R> + Send + '_>
Source§fn merge_cursor_with_snapshot<'a, S>(
&'a self,
key_filter: Option<Filter<Self::Key>>,
value_filter: Option<GroupFilter<Self::Val>>,
snapshot: &'a Option<Arc<S>>,
) -> Box<dyn MergeCursor<Self::Key, Self::Val, Self::Time, Self::R> + Send + 'a>
fn merge_cursor_with_snapshot<'a, S>( &'a self, key_filter: Option<Filter<Self::Key>>, value_filter: Option<GroupFilter<Self::Val>>, snapshot: &'a Option<Arc<S>>, ) -> Box<dyn MergeCursor<Self::Key, Self::Val, Self::Time, Self::R> + Send + 'a>
merge_cursor, but invoked in the context of a spine merger.
Takes the current spine snapshot as an extra argument and uses it to evaluate value_filter precisely.Source§fn consuming_cursor(
&mut self,
key_filter: Option<Filter<Self::Key>>,
value_filter: Option<GroupFilter<Self::Val>>,
) -> Box<dyn MergeCursor<Self::Key, Self::Val, Self::Time, Self::R> + Send + '_>
fn consuming_cursor( &mut self, key_filter: Option<Filter<Self::Key>>, value_filter: Option<GroupFilter<Self::Val>>, ) -> Box<dyn MergeCursor<Self::Key, Self::Val, Self::Time, Self::R> + Send + '_>
Source§fn location(&self) -> BatchLocation
fn location(&self) -> BatchLocation
Source§fn cache_stats(&self) -> CacheStats
fn cache_stats(&self) -> CacheStats
Source§fn maybe_contains_key(&self, _hash: u64) -> bool
fn maybe_contains_key(&self, _hash: u64) -> bool
Source§fn partition_keys(&self, num_partitions: usize, bounds: &mut DynVec<Self::Key>)
fn partition_keys(&self, num_partitions: usize, bounds: &mut DynVec<Self::Key>)
fn keys(&self) -> Option<&DynVec<Self::Key>>
Source§impl<B> From<&Spine<B>> for SpineSnapshot<B>
impl<B> From<&Spine<B>> for SpineSnapshot<B>
Source§impl<B> NumEntries for Spine<B>where
B: Batch,
impl<B> NumEntries for Spine<B>where
B: Batch,
Source§const CONST_NUM_ENTRIES: Option<usize> = None
const CONST_NUM_ENTRIES: Option<usize> = None
Some(n) if Self has constant size or None otherwise.Source§fn num_entries_shallow(&self) -> usize
fn num_entries_shallow(&self) -> usize
self.Source§fn num_entries_deep(&self) -> usize
fn num_entries_deep(&self) -> usize
self. Read moreSource§impl<B> SizeOf for Spine<B>where
B: Batch,
impl<B> SizeOf for Spine<B>where
B: Batch,
Source§fn size_of_children(&self, context: &mut Context)
fn size_of_children(&self, context: &mut Context)
Source§fn size_of_with_context(&self, context: &mut Context)
fn size_of_with_context(&self, context: &mut Context)
Context,
including both the size of the value itself and all of its childrenSource§impl<B> Trace for Spine<B>where
B: Batch,
impl<B> Trace for Spine<B>where
B: Batch,
Source§fn set_frontier(&mut self, frontier: &B::Time)
fn set_frontier(&mut self, frontier: &B::Time)
ts
in the trace can be safely replaced with ts.join(frontier) without
affecting the output of the circuit. By applying this replacement,
updates to the same (key, value) pairs applied during different steps
can be merged or discarded. Read moreSource§fn consolidate(self) -> Option<B>
fn consolidate(self) -> Option<B>
Source§fn insert_arc(&mut self, batch: Arc<Self::Batch>)
fn insert_arc(&mut self, batch: Arc<Self::Batch>)
insert.Source§fn clear_dirty_flag(&mut self)
fn clear_dirty_flag(&mut self)
false. Read moreSource§fn retain_keys(&mut self, filter: Filter<Self::Key>)
fn retain_keys(&mut self, filter: Filter<Self::Key>)
Source§fn retain_values(&mut self, filter: GroupFilter<Self::Val>)
fn retain_values(&mut self, filter: GroupFilter<Self::Val>)
fn key_filter(&self) -> &Option<Filter<Self::Key>>
fn value_filter(&self) -> &Option<GroupFilter<Self::Val>>
Source§fn save(
&mut self,
base: &StoragePath,
persistent_id: &str,
files: &mut Vec<Arc<dyn FileCommitter>>,
) -> Result<(), Error>
fn save( &mut self, base: &StoragePath, persistent_id: &str, files: &mut Vec<Arc<dyn FileCommitter>>, ) -> Result<(), Error>
base, using pid as a file name
prefix. Adds the files that were written to files so that they can be
committed later.Source§fn restore(
&mut self,
base: &StoragePath,
persistent_id: &str,
) -> Result<(), Error>
fn restore( &mut self, base: &StoragePath, persistent_id: &str, ) -> Result<(), Error>
base with pid as the
prefix.Source§fn metadata(&self, meta: &mut OperatorMeta)
fn metadata(&self, meta: &mut OperatorMeta)
Source§impl<B> WithSnapshot for Spine<B>where
B: Batch,
impl<B> WithSnapshot for Spine<B>where
B: Batch,
type Batch = B
Source§fn ro_snapshot(&self) -> SpineSnapshot<B>
fn ro_snapshot(&self) -> SpineSnapshot<B>
fn into_ro_snapshot(self) -> SpineSnapshot<Self::Batch>
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> UnsafeUnpin for Spine<B>
impl<B> !UnwindSafe for Spine<B>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be unsized. Read moreSource§type MetadataResolver = ()
type MetadataResolver = ()
Source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata,
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )
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,
Source§impl<T> CustomError for T
impl<T> CustomError for T
Source§impl<T> DeserializableDyn for Twhere
T: ArchivedDBData,
impl<T> DeserializableDyn for Twhere
T: ArchivedDBData,
Source§unsafe fn deserialize_from_bytes_with(
&mut self,
bytes: &[u8],
pos: usize,
deserializer: &mut Deserializer,
)
unsafe fn deserialize_from_bytes_with( &mut self, bytes: &[u8], pos: usize, deserializer: &mut Deserializer, )
self from the given slice and offset. Read moreSource§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<Z> IndexedZSetReader for Z
impl<Z> IndexedZSetReader for Z
Source§fn iter(&self) -> IndexedZSetIterator<'_, Self> ⓘ
fn iter(&self) -> IndexedZSetIterator<'_, Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SerializeDyn for Twhere
T: ArchivedDBData,
impl<T> SerializeDyn for Twhere
T: ArchivedDBData,
fn serialize( &self, serializer: &mut CompositeSerializer<FBufSerializer<FBuf>, FallbackScratch<HeapScratch<65536>, AllocScratch>, SharedSerializeMap>, ) -> Result<usize, <CompositeSerializer<FBufSerializer<FBuf>, FallbackScratch<HeapScratch<65536>, AllocScratch>, SharedSerializeMap> as Fallible>::Error>
Source§impl<T, S> SerializeUnsized<S> for T
impl<T, S> SerializeUnsized<S> for T
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.