From afd56dd75c9adcda8af5e02709b20fe19283fea2 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 16 Apr 2024 15:10:42 +0200 Subject: [PATCH] propagate changes --- Cargo.lock | 32 --------------------- crates/re_entity_db/Cargo.toml | 1 - crates/re_entity_db/src/entity_db.rs | 14 --------- crates/re_query_cache2/src/cache.rs | 12 ++++++++ crates/re_space_view_spatial/Cargo.toml | 1 - crates/re_space_view_text_log/Cargo.toml | 1 - crates/re_space_view_time_series/Cargo.toml | 1 - crates/re_viewer/Cargo.toml | 1 - crates/re_viewer/src/app.rs | 2 +- crates/re_viewer_context/Cargo.toml | 1 - 10 files changed, 13 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d3a6042231fe..e8e900ecc500 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4352,7 +4352,6 @@ dependencies = [ "re_log_types", "re_query", "re_query2", - "re_query_cache", "re_query_cache2", "re_smart_channel", "re_tracing", @@ -4546,32 +4545,6 @@ dependencies = [ "unindent", ] -[[package]] -name = "re_query_cache" -version = "0.16.0-alpha.1+dev" -dependencies = [ - "ahash", - "criterion", - "indent", - "itertools 0.12.0", - "mimalloc", - "parking_lot", - "paste", - "rand", - "re_data_store", - "re_format", - "re_log", - "re_log_types", - "re_query", - "re_tracing", - "re_types", - "re_types_core", - "seq-macro", - "similar-asserts", - "static_assertions", - "web-time", -] - [[package]] name = "re_query_cache2" version = "0.16.0-alpha.1+dev" @@ -4814,7 +4787,6 @@ dependencies = [ "re_log", "re_log_types", "re_query", - "re_query_cache", "re_query_cache2", "re_renderer", "re_space_view", @@ -4883,7 +4855,6 @@ dependencies = [ "re_entity_db", "re_log", "re_log_types", - "re_query_cache", "re_query_cache2", "re_renderer", "re_tracing", @@ -4905,7 +4876,6 @@ dependencies = [ "re_log", "re_log_types", "re_query", - "re_query_cache", "re_query_cache2", "re_renderer", "re_space_view", @@ -5121,7 +5091,6 @@ dependencies = [ "re_log_encoding", "re_log_types", "re_memory", - "re_query_cache", "re_query_cache2", "re_renderer", "re_smart_channel", @@ -5183,7 +5152,6 @@ dependencies = [ "re_log_types", "re_query", "re_query2", - "re_query_cache", "re_query_cache2", "re_renderer", "re_smart_channel", diff --git a/crates/re_entity_db/Cargo.toml b/crates/re_entity_db/Cargo.toml index c4d703bfd23b..6c14e6fe8adc 100644 --- a/crates/re_entity_db/Cargo.toml +++ b/crates/re_entity_db/Cargo.toml @@ -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 diff --git a/crates/re_entity_db/src/entity_db.rs b/crates/re_entity_db/src/entity_db.rs index eb31fe3406b1..ebe7b9e986e7 100644 --- a/crates/re_entity_db/src/entity_db.rs +++ b/crates/re_entity_db/src/entity_db.rs @@ -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, @@ -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, @@ -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), @@ -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 @@ -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); @@ -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); @@ -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(); diff --git a/crates/re_query_cache2/src/cache.rs b/crates/re_query_cache2/src/cache.rs index 3004a400239c..0a49ea69824f 100644 --- a/crates/re_query_cache2/src/cache.rs +++ b/crates/re_query_cache2/src/cache.rs @@ -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 { diff --git a/crates/re_space_view_spatial/Cargo.toml b/crates/re_space_view_spatial/Cargo.toml index 601f98ce87db..320679726d1a 100644 --- a/crates/re_space_view_spatial/Cargo.toml +++ b/crates/re_space_view_spatial/Cargo.toml @@ -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", diff --git a/crates/re_space_view_text_log/Cargo.toml b/crates/re_space_view_text_log/Cargo.toml index 11f7623e747c..4bf65720831c 100644 --- a/crates/re_space_view_text_log/Cargo.toml +++ b/crates/re_space_view_text_log/Cargo.toml @@ -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 diff --git a/crates/re_space_view_time_series/Cargo.toml b/crates/re_space_view_time_series/Cargo.toml index 0d9d8ec44a4c..93fb9226a1d1 100644 --- a/crates/re_space_view_time_series/Cargo.toml +++ b/crates/re_space_view_time_series/Cargo.toml @@ -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 diff --git a/crates/re_viewer/Cargo.toml b/crates/re_viewer/Cargo.toml index 80aed6108bea..2d2e6fc4685a 100644 --- a/crates/re_viewer/Cargo.toml +++ b/crates/re_viewer/Cargo.toml @@ -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 diff --git a/crates/re_viewer/src/app.rs b/crates/re_viewer/src/app.rs index d8250e89d5e1..d19bf1afb40d 100644 --- a/crates/re_viewer/src/app.rs +++ b/crates/re_viewer/src/app.rs @@ -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"))] diff --git a/crates/re_viewer_context/Cargo.toml b/crates/re_viewer_context/Cargo.toml index 791e22e9bfa7..cad50412200e 100644 --- a/crates/re_viewer_context/Cargo.toml +++ b/crates/re_viewer_context/Cargo.toml @@ -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