@@ -56,9 +56,9 @@ pub fn lakefs_logstore(
5656/// Default [`LogStore`] implementation
5757#[ derive( Debug , Clone ) ]
5858pub ( crate ) struct LakeFSLogStore {
59- pub ( crate ) storage : DefaultObjectStoreRegistry ,
59+ pub ( crate ) prefixed_registry : DefaultObjectStoreRegistry ,
6060 root_registry : DefaultObjectStoreRegistry ,
61- pub ( crate ) config : LogStoreConfig ,
61+ config : LogStoreConfig ,
6262 pub ( crate ) client : LakeFSClient ,
6363}
6464
@@ -67,20 +67,23 @@ impl LakeFSLogStore {
6767 ///
6868 /// # Arguments
6969 ///
70- /// * `storage` - A shared reference to an [`object_store::ObjectStore`] with "/" pointing at delta table root (i.e. where `_delta_log` is located).
70+ /// * `prefixed_store` - A shared reference to an [`object_store::ObjectStore`]
71+ /// with "/" pointing at delta table root (i.e. where `_delta_log` is located).
72+ /// * `root_store` - A shared reference to an [`object_store::ObjectStore`] with "/"
73+ /// pointing at root of the storage system.
7174 /// * `location` - A url corresponding to the storage location of `storage`.
7275 pub fn new (
73- storage : ObjectStoreRef ,
76+ prefixed_store : ObjectStoreRef ,
7477 root_store : ObjectStoreRef ,
7578 config : LogStoreConfig ,
7679 client : LakeFSClient ,
7780 ) -> Self {
78- let registry = DefaultObjectStoreRegistry :: new ( ) ;
79- registry . register_store ( & config. location , storage ) ;
81+ let prefixed_registry = DefaultObjectStoreRegistry :: new ( ) ;
82+ prefixed_registry . register_store ( & config. location , prefixed_store ) ;
8083 let root_registry = DefaultObjectStoreRegistry :: new ( ) ;
8184 root_registry. register_store ( & config. location , root_store) ;
8285 Self {
83- storage : registry ,
86+ prefixed_registry ,
8487 root_registry,
8588 config,
8689 client,
@@ -112,7 +115,7 @@ impl LakeFSLogStore {
112115 }
113116
114117 fn register_object_store ( & self , url : & Url , store : ObjectStoreRef ) {
115- self . storage . register_store ( url, store) ;
118+ self . prefixed_registry . register_store ( url, store) ;
116119 }
117120
118121 fn register_root_object_store ( & self , url : & Url , store : ObjectStoreRef ) {
@@ -131,7 +134,7 @@ impl LakeFSLogStore {
131134 let transaction_url = Url :: parse ( & string_url) . unwrap ( ) ;
132135 Ok ( (
133136 string_url,
134- self . storage . get_store ( & transaction_url) ?,
137+ self . prefixed_registry . get_store ( & transaction_url) ?,
135138 self . root_registry . get_store ( & transaction_url) ?,
136139 ) )
137140 }
@@ -236,7 +239,11 @@ impl LogStore for LakeFSLogStore {
236239 }
237240
238241 async fn read_commit_entry ( & self , version : i64 ) -> DeltaResult < Option < Bytes > > {
239- read_commit_entry ( & self . storage . get_store ( & self . config . location ) ?, version) . await
242+ read_commit_entry (
243+ & self . prefixed_registry . get_store ( & self . config . location ) ?,
244+ version,
245+ )
246+ . await
240247 }
241248
242249 /// Tries to commit a prepared commit file. Returns [`TransactionError`]
@@ -355,7 +362,10 @@ impl LogStore for LakeFSLogStore {
355362 let ( _, store, _) = self . get_transaction_objectstore ( id) . unwrap_or_else ( |_| panic ! ( "The object_store registry inside LakeFSLogstore didn't have a store for operation_id {id} Something went wrong." ) ) ;
356363 store
357364 }
358- _ => self . storage . get_store ( & self . config . location ) . unwrap ( ) ,
365+ _ => self
366+ . prefixed_registry
367+ . get_store ( & self . config . location )
368+ . unwrap ( ) ,
359369 }
360370 }
361371
0 commit comments