Skip to content

Commit f417f9d

Browse files
committed
these dont need fancy guards
1 parent fc310cc commit f417f9d

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

crates/store/re_entity_db/src/entity_db.rs

+13-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ use re_log_types::{
1313
SetStoreInfo, StoreId, StoreInfo, StoreKind, Timeline,
1414
};
1515
use re_query::{
16-
QueryCache, QueryCacheHandle, StorageEngine, StorageEngineArcReadGuard, StorageEngineWriteGuard,
16+
QueryCache, QueryCacheHandle, StorageEngine, StorageEngineArcReadGuard, StorageEngineReadGuard,
17+
StorageEngineWriteGuard,
1718
};
1819

1920
use crate::{Error, TimesPerTimeline};
@@ -110,14 +111,20 @@ impl EntityDb {
110111
&self.tree
111112
}
112113

114+
/// Returns a read-only guard to the backing [`StorageEngine`].
115+
#[inline]
116+
pub fn storage_engine(&self) -> StorageEngineReadGuard<'_> {
117+
self.storage_engine.read()
118+
}
119+
113120
/// Returns a read-only guard to the backing [`StorageEngine`].
114121
///
115122
/// That guard can be cloned at will and has a static lifetime.
116123
///
117124
/// It is not possible to insert any more data in this [`EntityDb`] until the returned guard,
118125
/// and any clones, have been dropped.
119126
#[inline]
120-
pub fn storage_engine(&self) -> StorageEngineArcReadGuard {
127+
pub fn storage_engine_arc(&self) -> StorageEngineArcReadGuard {
121128
self.storage_engine.read_arc()
122129
}
123130

@@ -667,7 +674,7 @@ impl EntityDb {
667674
/// This excludes temporal data.
668675
pub fn subtree_stats_static(
669676
&self,
670-
engine: &StorageEngineArcReadGuard,
677+
engine: &StorageEngineReadGuard<'_>,
671678
entity_path: &EntityPath,
672679
) -> ChunkStoreChunkStats {
673680
re_tracing::profile_function!();
@@ -689,7 +696,7 @@ impl EntityDb {
689696
/// This excludes static data.
690697
pub fn subtree_stats_on_timeline(
691698
&self,
692-
engine: &StorageEngineArcReadGuard,
699+
engine: &StorageEngineReadGuard<'_>,
693700
entity_path: &EntityPath,
694701
timeline: &Timeline,
695702
) -> ChunkStoreChunkStats {
@@ -712,7 +719,7 @@ impl EntityDb {
712719
/// This includes static data.
713720
pub fn subtree_has_data_on_timeline(
714721
&self,
715-
engine: &StorageEngineArcReadGuard,
722+
engine: &StorageEngineReadGuard<'_>,
716723
timeline: &Timeline,
717724
entity_path: &EntityPath,
718725
) -> bool {
@@ -734,7 +741,7 @@ impl EntityDb {
734741
/// This ignores static data.
735742
pub fn subtree_has_temporal_data_on_timeline(
736743
&self,
737-
engine: &StorageEngineArcReadGuard,
744+
engine: &StorageEngineReadGuard<'_>,
738745
timeline: &Timeline,
739746
entity_path: &EntityPath,
740747
) -> bool {

crates/viewer/re_space_view_dataframe/src/space_view_class.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ mode sets the default time range to _everything_. You can override this in the s
129129
let view_query = view_query::Query::from_blueprint(ctx, query.space_view_id);
130130

131131
let query_engine = QueryEngine {
132-
engine: ctx.recording_engine(),
132+
engine: ctx.recording().storage_engine_arc(),
133133
};
134134

135135
let view_contents = query

crates/viewer/re_viewer_context/src/space_view/view_context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::sync::Arc;
33
use re_chunk::ArrowArray;
44
use re_chunk_store::LatestAtQuery;
55
use re_log_types::{EntityPath, TimePoint};
6-
use re_query::StorageEngineArcReadGuard;
6+
use re_query::StorageEngineReadGuard;
77
use re_types::{AsComponents, ComponentBatch, ComponentName};
88

99
use crate::{DataQueryResult, DataResult, QueryContext, SpaceViewId};
@@ -48,7 +48,7 @@ impl<'a> ViewContext<'a> {
4848

4949
/// The `StorageEngine` for the active recording.
5050
#[inline]
51-
pub fn recording_engine(&self) -> StorageEngineArcReadGuard {
51+
pub fn recording_engine(&self) -> StorageEngineReadGuard<'_> {
5252
self.viewer_ctx.recording_engine()
5353
}
5454

crates/viewer/re_viewer_context/src/viewer_context.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use parking_lot::RwLock;
33

44
use re_chunk_store::LatestAtQuery;
55
use re_entity_db::entity_db::EntityDb;
6-
use re_query::StorageEngineArcReadGuard;
6+
use re_query::StorageEngineReadGuard;
77

88
use crate::{
99
query_context::DataQueryResult, AppOptions, ApplicableEntities, ApplicationSelectionState,
@@ -96,13 +96,13 @@ impl<'a> ViewerContext<'a> {
9696

9797
/// The `StorageEngine` for the active recording.
9898
#[inline]
99-
pub fn recording_engine(&self) -> StorageEngineArcReadGuard {
99+
pub fn recording_engine(&self) -> StorageEngineReadGuard<'_> {
100100
self.store_context.recording.storage_engine()
101101
}
102102

103103
/// The `StorageEngine` for the active blueprint.
104104
#[inline]
105-
pub fn blueprint_engine(&self) -> StorageEngineArcReadGuard {
105+
pub fn blueprint_engine(&self) -> StorageEngineReadGuard<'_> {
106106
self.store_context.blueprint.storage_engine()
107107
}
108108

0 commit comments

Comments
 (0)