Skip to content

Commit

Permalink
switch to has_ordered_listing
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklan committed Oct 15, 2024
1 parent 5198a39 commit 2e03a28
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions kernel/src/engine/default/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{DeltaResult, Error, FileMeta, FileSlice, FileSystemClient};
#[derive(Debug)]
pub struct ObjectStoreFileSystemClient<E: TaskExecutor> {
inner: Arc<DynObjectStore>,
is_local: bool,
has_ordered_listing: bool,
table_root: Path,
task_executor: Arc<E>,
readahead: usize,
Expand All @@ -22,13 +22,13 @@ pub struct ObjectStoreFileSystemClient<E: TaskExecutor> {
impl<E: TaskExecutor> ObjectStoreFileSystemClient<E> {
pub(crate) fn new(
store: Arc<DynObjectStore>,
is_local: bool,
has_ordered_listing: bool,
table_root: Path,
task_executor: Arc<E>,
) -> Self {
Self {
inner: store,
is_local,
has_ordered_listing,
table_root,
task_executor,
readahead: 10,
Expand Down Expand Up @@ -80,8 +80,8 @@ impl<E: TaskExecutor> FileSystemClient for ObjectStoreFileSystemClient<E> {
}
});

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<FileMeta> = receiver.into_iter().try_collect()?;
fms.sort_unstable();
Ok(Box::new(fms.into_iter().map(Ok)))
Expand Down Expand Up @@ -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()),
);
Expand Down
2 changes: 1 addition & 1 deletion kernel/src/engine/default/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<E: TaskExecutor> DefaultEngine<E> {
Self {
file_system: Arc::new(ObjectStoreFileSystemClient::new(
store.clone(),
is_local,
!is_local,
prefix,
task_executor.clone(),
)),
Expand Down
6 changes: 3 additions & 3 deletions kernel/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
);
Expand Down Expand Up @@ -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()),
);
Expand Down Expand Up @@ -641,7 +641,7 @@ mod tests {

let client = ObjectStoreFileSystemClient::new(
store,
true,
false, // don't have ordered listing
Path::from("/"),
Arc::new(TokioBackgroundExecutor::new()),
);
Expand Down

0 comments on commit 2e03a28

Please sign in to comment.