Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 8 additions & 21 deletions crates/store/re_entity_db/src/entity_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use re_query::{
};
use re_smart_channel::SmartChannelSource;

use crate::{Error, TimesPerTimeline, ingestion_statistics::IngestionStatistics};
use crate::{Error, ingestion_statistics::IngestionStatistics};

// ----------------------------------------------------------------------------

Expand Down Expand Up @@ -86,17 +86,9 @@ pub struct EntityDb {
/// In many places we just store the hashes, so we need a way to translate back.
entity_path_from_hash: IntMap<EntityPathHash, EntityPath>,

/// The global-scope time tracker.
///
/// For each timeline, keeps track of what times exist, recursively across all
/// entities/components.
///
/// Used for time control.
///
/// TODO(#7084): Get rid of [`TimesPerTimeline`] and implement time-stepping with [`crate::TimeHistogram`] instead.
times_per_timeline: TimesPerTimeline,

/// A time histogram of all entities, for every timeline.
///
/// Used for time control and gap detection.
time_histogram_per_timeline: crate::TimeHistogramPerTimeline,

/// A tree-view (split on path components) of the entities.
Expand Down Expand Up @@ -146,7 +138,6 @@ impl EntityDb {
last_modified_at: web_time::Instant::now(),
latest_row_id: None,
entity_path_from_hash: Default::default(),
times_per_timeline: Default::default(),
tree: crate::EntityTree::root(),
time_histogram_per_timeline: Default::default(),
storage_engine,
Expand Down Expand Up @@ -460,9 +451,6 @@ impl EntityDb {
self.storage_engine().store().timelines()
}

pub fn times_per_timeline(&self) -> &TimesPerTimeline {
&self.times_per_timeline
}

pub fn has_any_data_on_timeline(&self, timeline: &TimelineName) -> bool {
self.time_histogram_per_timeline
Expand All @@ -483,6 +471,11 @@ impl EntityDb {
self.time_histogram_per_timeline.get(timeline)
}

/// Histogram of all entities and events
pub fn time_histogram_per_timeline(&self) -> &crate::TimeHistogramPerTimeline {
&self.time_histogram_per_timeline
}

#[inline]
pub fn num_rows(&self) -> u64 {
self.storage_engine.read().store().stats().total().num_rows
Expand Down Expand Up @@ -600,7 +593,6 @@ impl EntityDb {

{
// Update our internal views by notifying them of resulting [`ChunkStoreEvent`]s.
self.times_per_timeline.on_events(&store_events);
self.time_histogram_per_timeline.on_events(&store_events);
self.tree.on_store_additions(&store_events);

Expand Down Expand Up @@ -675,7 +667,6 @@ impl EntityDb {
);

Self::on_store_deletions(
&mut self.times_per_timeline,
&mut self.time_histogram_per_timeline,
&mut self.tree,
engine,
Expand All @@ -699,7 +690,6 @@ impl EntityDb {

let store_events = engine.store().drop_time_range(timeline, drop_range);
Self::on_store_deletions(
&mut self.times_per_timeline,
&mut self.time_histogram_per_timeline,
&mut self.tree,
engine,
Expand All @@ -721,7 +711,6 @@ impl EntityDb {

let store_events = engine.store().drop_entity_path(entity_path);
Self::on_store_deletions(
&mut self.times_per_timeline,
&mut self.time_histogram_per_timeline,
&mut self.tree,
engine,
Expand Down Expand Up @@ -749,14 +738,12 @@ impl EntityDb {
// NOTE: Parameters deconstructed instead of taking `self`, because borrowck cannot understand
// partial borrows on methods.
fn on_store_deletions(
times_per_timeline: &mut TimesPerTimeline,
time_histogram_per_timeline: &mut crate::TimeHistogramPerTimeline,
tree: &mut crate::EntityTree,
mut engine: StorageEngineWriteGuard<'_>,
store_events: &[ChunkStoreEvent],
) {
engine.cache().on_events(store_events);
times_per_timeline.on_events(store_events);
time_histogram_per_timeline.on_events(store_events);

let engine = engine.downgrade();
Expand Down
2 changes: 0 additions & 2 deletions crates/store/re_entity_db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ mod ingestion_statistics;
mod instance_path;
mod store_bundle;
mod time_histogram_per_timeline;
mod times_per_timeline;
mod versioned_instance_path;

pub use self::{
Expand All @@ -20,7 +19,6 @@ pub use self::{
instance_path::{InstancePath, InstancePathHash},
store_bundle::{StoreBundle, StoreLoadError},
time_histogram_per_timeline::{TimeHistogram, TimeHistogramPerTimeline},
times_per_timeline::{TimeCounts, TimelineStats, TimesPerTimeline},
versioned_instance_path::{VersionedInstancePath, VersionedInstancePathHash},
};

Expand Down
4 changes: 2 additions & 2 deletions crates/store/re_entity_db/src/time_histogram_per_timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ impl ChunkStoreSubscriber for TimeHistogramPerTimeline {
.collect_vec();
match event.kind {
ChunkStoreDiffKind::Addition => {
self.add(&times, event.num_components() as _);
self.add(&times, 1);
}
ChunkStoreDiffKind::Deletion => {
self.remove(&times, event.num_components() as _);
self.remove(&times, 1);
}
}
}
Expand Down
163 changes: 0 additions & 163 deletions crates/store/re_entity_db/src/times_per_timeline.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ table TimePanelBlueprint (
/// What timeline the panel is on.
timeline: rerun.blueprint.components.TimelineName ("attr.rerun.component_optional", nullable, order: 2000);

/// What time the time cursor should be on.
time: rerun.blueprint.components.TimeInt ("attr.rerun.component_optional", nullable, order: 2100);

/// A time playback speed multiplier.
playback_speed: rerun.blueprint.components.PlaybackSpeed ("attr.rerun.component_optional", nullable, order: 2200);

Expand Down
Loading
Loading