Skip to content

Commit

Permalink
propagate changes
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Apr 18, 2024
1 parent 0222aa1 commit afd56dd
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 53 deletions.
32 changes: 0 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/re_entity_db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ re_log_encoding = { workspace = true, features = ["decoder"] }
re_log_types.workspace = true
re_query.workspace = true
re_query2.workspace = true
re_query_cache.workspace = true
re_query_cache2 = { workspace = true, features = ["to_archetype"] }
re_smart_channel.workspace = true
re_tracing.workspace = true
Expand Down
14 changes: 0 additions & 14 deletions crates/re_entity_db/src/entity_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ pub struct EntityDb {
/// Stores all components for all entities for all timelines.
data_store: DataStore,

/// Query caches for the data in [`Self::data_store`].
query_caches: re_query_cache::Caches,

/// The active promise resolver for this DB.
resolver: re_query2::PromiseResolver,

Expand All @@ -135,7 +132,6 @@ impl EntityDb {
InstanceKey::name(),
DataStoreConfig::default(),
);
let query_caches = re_query_cache::Caches::new(&data_store);
let query_caches2 = re_query_cache2::Caches::new(&data_store);
Self {
data_source: None,
Expand All @@ -146,7 +142,6 @@ impl EntityDb {
times_per_timeline: Default::default(),
tree: crate::EntityTree::root(),
data_store,
query_caches,
resolver: re_query2::PromiseResolver::default(),
query_caches2,
stats: IngestionStatistics::new(store_id),
Expand Down Expand Up @@ -196,11 +191,6 @@ impl EntityDb {
self.store_info().map(|ri| &ri.application_id)
}

#[inline]
pub fn query_caches(&self) -> &re_query_cache::Caches {
&self.query_caches
}

#[inline]
pub fn query_caches2(&self) -> &re_query_cache2::Caches {
&self.query_caches2
Expand Down Expand Up @@ -463,7 +453,6 @@ impl EntityDb {
// and/or pending clears.
let original_store_events = &[store_event];
self.times_per_timeline.on_events(original_store_events);
self.query_caches.on_events(original_store_events);
self.query_caches2.on_events(original_store_events);
let clear_cascade = self.tree.on_store_additions(original_store_events);

Expand All @@ -473,7 +462,6 @@ impl EntityDb {
// notified of, again!
let new_store_events = self.on_clear_cascade(clear_cascade);
self.times_per_timeline.on_events(&new_store_events);
self.query_caches.on_events(&new_store_events);
self.query_caches2.on_events(&new_store_events);
let clear_cascade = self.tree.on_store_additions(&new_store_events);

Expand Down Expand Up @@ -630,14 +618,12 @@ impl EntityDb {
times_per_timeline,
tree,
data_store: _,
query_caches,
resolver: _,
query_caches2,
stats: _,
} = self;

times_per_timeline.on_events(store_events);
query_caches.on_events(store_events);
query_caches2.on_events(store_events);

let store_events = store_events.iter().collect_vec();
Expand Down
12 changes: 12 additions & 0 deletions crates/re_query_cache2/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,18 @@ impl Caches {
range_per_cache_key: Default::default(),
}
}

#[inline]
pub fn clear(&self) {
let Self {
store_id: _,
latest_at_per_cache_key,
range_per_cache_key,
} = self;

latest_at_per_cache_key.write().clear();
range_per_cache_key.write().clear();
}
}

impl StoreSubscriber for Caches {
Expand Down
1 change: 0 additions & 1 deletion crates/re_space_view_spatial/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ re_format.workspace = true
re_log_types.workspace = true
re_log.workspace = true
re_query.workspace = true
re_query_cache.workspace = true
re_query_cache2.workspace = true
re_renderer = { workspace = true, features = [
"import-gltf",
Expand Down
1 change: 0 additions & 1 deletion crates/re_space_view_text_log/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ re_data_ui.workspace = true
re_entity_db.workspace = true
re_log_types.workspace = true
re_log.workspace = true
re_query_cache.workspace = true
re_query_cache2.workspace = true
re_renderer.workspace = true
re_tracing.workspace = true
Expand Down
1 change: 0 additions & 1 deletion crates/re_space_view_time_series/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ re_format.workspace = true
re_log.workspace = true
re_log_types.workspace = true
re_query.workspace = true
re_query_cache.workspace = true
re_query_cache2.workspace = true
re_renderer.workspace = true
re_space_view.workspace = true
Expand Down
1 change: 0 additions & 1 deletion crates/re_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ re_log_encoding = { workspace = true, features = [
] }
re_log_types.workspace = true
re_memory.workspace = true
re_query_cache.workspace = true
re_query_cache2.workspace = true
re_renderer = { workspace = true, default-features = false }
re_smart_channel.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ impl App {
#[cfg(not(target_arch = "wasm32"))]
UICommand::ClearPrimaryCache => {
if let Some(ctx) = store_context {
ctx.recording.query_caches().clear();
ctx.recording.query_caches2().clear();
}
}
#[cfg(not(target_arch = "wasm32"))]
Expand Down
1 change: 0 additions & 1 deletion crates/re_viewer_context/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ re_data_store.workspace = true
re_entity_db = { workspace = true, features = ["serde"] }
re_log_types.workspace = true
re_log.workspace = true
re_query_cache.workspace = true
re_query_cache2.workspace = true
re_query.workspace = true
re_query2.workspace = true
Expand Down

0 comments on commit afd56dd

Please sign in to comment.