Skip to content

Commit 474532b

Browse files
nipunn1313Convex, Inc.
authored andcommitted
Move all_component_paths method to BootstrapComponentsModel (#31369)
GitOrigin-RevId: 1e76da661dd06e7c2f63595c1d8b28ed440b6791
1 parent 2935a62 commit 474532b

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

crates/application/src/system_table_cleanup/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ use common::{
4343
};
4444
use database::{
4545
query::PaginationOptions,
46+
BootstrapComponentsModel,
4647
Database,
4748
ResolvedQuery,
4849
SystemMetadataModel,
@@ -211,7 +212,7 @@ impl<RT: Runtime> SystemTableCleanupWorker<RT> {
211212
let mut tx = self.database.begin(Identity::system()).await?;
212213
let ts = tx.begin_timestamp();
213214
let table_mapping = tx.table_mapping().clone();
214-
let component_paths = tx.all_component_paths();
215+
let component_paths = BootstrapComponentsModel::new(&mut tx).all_component_paths();
215216
let mut table_model = TableModel::new(&mut tx);
216217
for (namespace, map) in table_mapping.iter_active_namespaces() {
217218
let component_id = ComponentId::from(*namespace);

crates/database/src/bootstrap_model/components/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ impl<'a, RT: Runtime> BootstrapComponentsModel<'a, RT> {
132132
.resolve_path(path, &mut self.tx.reads)
133133
}
134134

135+
pub fn all_component_paths(&mut self) -> BTreeMap<ComponentId, ComponentPath> {
136+
self.tx
137+
.component_registry
138+
.all_component_paths(&mut self.tx.reads)
139+
}
140+
135141
#[minitrace::trace]
136142
pub async fn load_all_components(
137143
&mut self,

crates/database/src/database.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ impl<RT: Runtime> Database<RT> {
16471647
(
16481648
tx.begin_timestamp(),
16491649
tx.table_mapping().clone(),
1650-
tx.all_component_paths(),
1650+
BootstrapComponentsModel::new(&mut tx).all_component_paths(),
16511651
)
16521652
};
16531653
let repeatable_persistence = RepeatablePersistence::new(

crates/database/src/transaction.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,6 @@ impl<RT: Runtime> Transaction<RT> {
244244
self.index.index_registry().persistence_version()
245245
}
246246

247-
pub fn all_component_paths(&mut self) -> BTreeMap<ComponentId, ComponentPath> {
248-
self.component_registry.all_component_paths(&mut self.reads)
249-
}
250-
251247
pub fn table_mapping(&mut self) -> &TableMapping {
252248
self.take_table_mapping_dep();
253249
self.metadata.table_mapping()

0 commit comments

Comments
 (0)