Expand description
§Traces
A “trace” describes how a collection of key-value pairs changes over time.
A “batch” is a mostly immutable trace. This module provides traits and
structures for expressing traces in DBSP as collections of (key, val, time, diff) tuples.
The base trait for a trace is BatchReader, which allows a trace to be
read in sorted order by key and value. BatchReader provides Cursor to
step through a batch’s tuples without modifying them.
The Batch trait extends BatchReader with types and methods for
creating new traces from ordered tuples (Batch::Builder) or unordered
tuples (Batch::Batcher), or by merging traces of like types.
The Trace trait, which also extends BatchReader, adds methods to
append new batches. New tuples must not have times earlier than any of the
tuples already in the trace.
§Time within traces
See the time module documentation for a description of logical times.
Traces are sorted by key and value. They are not sorted with respect to
time: reading a trace might obtain out of order and duplicate times among
the (time, diff) pairs associated with a key and value.
Re-exports§
pub use crate::storage::file::Deserializable;pub use crate::storage::file::Deserializer;pub use crate::storage::file::Rkyv;pub use crate::storage::file::Serializer;pub use spine_async::BatchReaderWithSnapshot;pub use spine_async::ListMerger;pub use spine_async::MergerType;pub use spine_async::Spine;pub use spine_async::SpineSnapshot;pub use spine_async::WithSnapshot;pub use ord::FallbackIndexedWSet;pub use ord::FallbackIndexedWSetBuilder;pub use ord::FallbackIndexedWSetFactories;pub use ord::FallbackKeyBatch;pub use ord::FallbackKeyBatchFactories;pub use ord::FallbackValBatch;pub use ord::FallbackValBatchFactories;pub use ord::FallbackWSet;pub use ord::FallbackWSetBuilder;pub use ord::FallbackWSetFactories;pub use ord::FileIndexedWSet;pub use ord::FileIndexedWSetFactories;pub use ord::FileKeyBatch;pub use ord::FileKeyBatchFactories;pub use ord::FileValBatch;pub use ord::FileValBatchFactories;pub use ord::FileWSet;pub use ord::FileWSetFactories;pub use ord::OrdIndexedWSet;pub use ord::OrdIndexedWSetBuilder;pub use ord::OrdIndexedWSetFactories;pub use ord::OrdKeyBatch;pub use ord::OrdKeyBatchFactories;pub use ord::OrdValBatch;pub use ord::OrdValBatchFactories;pub use ord::OrdWSet;pub use ord::OrdWSetBuilder;pub use ord::OrdWSetFactories;pub use ord::VecIndexedWSet;pub use ord::VecIndexedWSetFactories;pub use ord::VecKeyBatch;pub use ord::VecKeyBatchFactories;pub use ord::VecValBatch;pub use ord::VecValBatchFactories;pub use ord::VecWSet;pub use ord::VecWSetFactories;pub use cursor::Cursor;pub use cursor::MergeCursor;pub use filter::Filter;pub use filter::GroupFilter;pub use layers::Trie;
Modules§
- cursor
- Traits and types for navigating ordered sequences of
(key, val, time, diff)tuples. - filter
- Filtering predicates for traces.
- layers
- ord
- spine_
async - Implementation of a
Tracewhich merges batches in the background.
Structs§
- Tuple
Builder - Batch builder that accepts a full tuple at a time.
Enums§
- Batch
Location - Where a batch is stored.
Traits§
- Batch
- A
BatchReaderplus features for constructing new batches. - Batch
Factories - Batch
Reader - A set of
(key, value, time, diff)tuples whose contents may be read in order by key and value. - Batch
Reader Factories - Batcher
- Functionality for collecting and batching updates.
- Builder
- Functionality for building batches from ordered update sequences.
- DBData
- Trait for data stored in batches.
- DBWeight
- Trait for data types used as weights.
- Trace
- A set of
(key, val, time, diff)tuples that can be read and extended.
Functions§
- deserialize_
indexed_ wset - eq_
batch - Compares two batches for equality. This works regardless of whether the batches are the same type, as long as their key, value, and weight types can be compared for equality.
- merge_
batches - Merges all of the batches in
batches, applyingkey_filterandvalue_filter, and returns the merged result. - merge_
batches_ by_ reference - Merges all of the batches in
batches, applyingkey_filterandvalue_filter, and returns the merged result. - serialize_
indexed_ wset - unaligned_
deserialize - Trait for data that can be serialized and deserialized with
rkyv.