From 2e03a28ba55e0eac5785159dc47988b7e7c13a41 Mon Sep 17 00:00:00 2001 From: Nick Lanham Date: Tue, 15 Oct 2024 09:38:56 -0700 Subject: [PATCH] switch to has_ordered_listing --- kernel/src/engine/default/filesystem.rs | 12 ++++++------ kernel/src/engine/default/mod.rs | 2 +- kernel/src/snapshot.rs | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/kernel/src/engine/default/filesystem.rs b/kernel/src/engine/default/filesystem.rs index f37b4bd0f..ff335ce11 100644 --- a/kernel/src/engine/default/filesystem.rs +++ b/kernel/src/engine/default/filesystem.rs @@ -13,7 +13,7 @@ use crate::{DeltaResult, Error, FileMeta, FileSlice, FileSystemClient}; #[derive(Debug)] pub struct ObjectStoreFileSystemClient { inner: Arc, - is_local: bool, + has_ordered_listing: bool, table_root: Path, task_executor: Arc, readahead: usize, @@ -22,13 +22,13 @@ pub struct ObjectStoreFileSystemClient { impl ObjectStoreFileSystemClient { pub(crate) fn new( store: Arc, - is_local: bool, + has_ordered_listing: bool, table_root: Path, task_executor: Arc, ) -> Self { Self { inner: store, - is_local, + has_ordered_listing, table_root, task_executor, readahead: 10, @@ -80,8 +80,8 @@ impl FileSystemClient for ObjectStoreFileSystemClient { } }); - if self.is_local { - // LocalFileSystem doesn't return things in the order we require + if !self.has_ordered_listing { + // This FS doesn't return things in the order we require let mut fms: Vec = receiver.into_iter().try_collect()?; fms.sort_unstable(); Ok(Box::new(fms.into_iter().map(Ok))) @@ -191,7 +191,7 @@ mod tests { let prefix = Path::from(url.path()); let client = ObjectStoreFileSystemClient::new( store, - true, + false, // don't have ordered listing prefix, Arc::new(TokioBackgroundExecutor::new()), ); diff --git a/kernel/src/engine/default/mod.rs b/kernel/src/engine/default/mod.rs index 576e09acf..f31378b94 100644 --- a/kernel/src/engine/default/mod.rs +++ b/kernel/src/engine/default/mod.rs @@ -79,7 +79,7 @@ impl DefaultEngine { Self { file_system: Arc::new(ObjectStoreFileSystemClient::new( store.clone(), - is_local, + !is_local, prefix, task_executor.clone(), )), diff --git a/kernel/src/snapshot.rs b/kernel/src/snapshot.rs index 070129d6b..8f51fcdff 100644 --- a/kernel/src/snapshot.rs +++ b/kernel/src/snapshot.rs @@ -536,7 +536,7 @@ mod tests { let prefix = Path::from(url.path()); let client = ObjectStoreFileSystemClient::new( store, - true, + false, // don't have ordered listing prefix, Arc::new(TokioBackgroundExecutor::new()), ); @@ -596,7 +596,7 @@ mod tests { let client = ObjectStoreFileSystemClient::new( store, - true, // is_local + false, // don't have ordered listing Path::from("/"), Arc::new(TokioBackgroundExecutor::new()), ); @@ -641,7 +641,7 @@ mod tests { let client = ObjectStoreFileSystemClient::new( store, - true, + false, // don't have ordered listing Path::from("/"), Arc::new(TokioBackgroundExecutor::new()), );