Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduces `StoreEvent`, an event that describes the atomic unit of change in the Rerun `DataStore`: a row has been added to or removed from the store. `StoreEvent`s are fired on both the insertion and garbage collection paths, enabling listeners to build arbitrary, always up-to-date views & trigger systems. ```rust /// The atomic unit of change in the Rerun [`DataStore`]. /// /// A [`StoreEvent`] describes the changes caused by the addition or deletion of a /// [`re_log_types::DataRow`] in the store. /// /// Methods that mutate the [`DataStore`], such as [`DataStore::insert_row`] and [`DataStore::gc`], /// return [`StoreEvent`]s that describe the changes. /// /// Refer to field-level documentation for more details and check out [`StoreDiff`] for a precise /// definition of what an event involves. #[derive(Debug, Clone, PartialEq)] pub struct StoreEvent { /// Which [`DataStore`] sent this event? pub store_id: StoreId, /// What was the store's generation when it sent that event? pub store_generation: StoreGeneration, /// Monotonically increasing ID of the event. /// /// This is on a per-store basis. /// /// When handling a [`StoreEvent`], if this is the first time you process this [`StoreId`] and /// the associated `event_id` is not `1`, it means you registered late and missed some updates. pub event_id: u64, /// What actually changed? /// /// Refer to [`StoreDiff`] for more information. pub diff: StoreDiff, } /// Describes an atomic change in the Rerun [`DataStore`]: a row has been added or deleted. /// /// From a query model standpoint, the [`DataStore`] _always_ operates one row at a time: /// - The contents of a row (i.e. its columns) are immutable past insertion, by virtue of /// [`RowId`]s being unique and non-reusable. /// - Similarly, garbage collection always removes _all the data_ associated with a row in one go: /// there cannot be orphaned columns. When a row is gone, all data associated with it is gone too. /// /// Refer to field-level documentation for more information. #[derive(Debug, Clone, PartialEq)] pub struct StoreDiff { /// Addition or deletion? /// /// The store's internals are opaque and don't necessarily reflect the query model (e.g. there /// might be data in the store that cannot by reached by any query). /// /// A [`StoreDiff`] answers a logical question: "does there exist a query path which can return /// data from that row?". pub kind: StoreDiffKind, /// What's the row's [`RowId`]? /// /// [`RowId`]s are guaranteed to be unique within a single [`DataStore`]. /// /// Put another way, the same [`RowId`] can only appear twice in a [`StoreDiff`] event: /// one addition and (optionally) one deletion (in that order!). pub row_id: RowId, /// The [`TimePoint`] associated with that row. /// /// Since insertions and deletions both work on a row-level basis, this is guaranteed to be the /// same value for both the insertion and deletion events (if any). pub timepoint: TimePoint, /// The [`EntityPath`] associated with that row. /// /// Since insertions and deletions both work on a row-level basis, this is guaranteed to be the /// same value for both the insertion and deletion events (if any). pub entity_path: EntityPath, /// All the [`DataCell`]s associated with that row. /// /// Since insertions and deletions both work on a row-level basis, this is guaranteed to be the /// same set of values for both the insertion and deletion events (if any). pub cells: IntMap<ComponentName, DataCell>, } ``` --- `DataStore` changelog PR series: - #4202 - #4203 - #4205 - #4206 - #4208 - #4209
- Loading branch information
8263309
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.25
.arrow_mono_strings2/insert
2529475251
ns/iter (± 8749539
)1982567456
ns/iter (± 6930605
)1.28
arrow_batch_points2/insert
1574266
ns/iter (± 6633
)1228434
ns/iter (± 5466
)1.28
arrow_batch_strings2/insert
1608494
ns/iter (± 14770
)1244321
ns/iter (± 11847
)1.29
This comment was automatically generated by workflow using github-action-benchmark.