Skip to content

Commit ef9e077

Browse files
authored
chore: update hdfs object store to 0.15 (#3681)
# Description Update HDFS object store to 0.15. Brings some bug fixes and more supported configs, and supports supplying a runtime for IO operations. # Related Issue(s) <!--- For example: - closes #106 ---> Closes #3680 # Documentation https://github.com/datafusion-contrib/hdfs-native-object-store/releases/tag/v0.15.0 https://github.com/Kimahriman/hdfs-native/releases/tag/v0.12.0 Signed-off-by: Adam Binford <[email protected]>
1 parent 3cbd326 commit ef9e077

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

crates/hdfs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rust-version.workspace = true
1313

1414
[dependencies]
1515
deltalake-core = { version = "0.28.0", path = "../core"}
16-
hdfs-native-object-store = "0.14"
16+
hdfs-native-object-store = "0.15"
1717

1818
# workspace dependecies
1919
object_store = { workspace = true }

crates/hdfs/src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use std::sync::Arc;
22

33
use deltalake_core::logstore::{
4-
default_logstore, logstore_factories, DeltaIOStorageBackend, LogStore, LogStoreFactory,
5-
StorageConfig,
4+
default_logstore, logstore_factories, LogStore, LogStoreFactory, StorageConfig,
65
};
76
use deltalake_core::logstore::{object_store_factories, ObjectStoreFactory, ObjectStoreRef};
87
use deltalake_core::{DeltaResult, Path};
9-
use hdfs_native_object_store::HdfsObjectStore;
8+
use hdfs_native_object_store::HdfsObjectStoreBuilder;
109
use url::Url;
1110

1211
#[derive(Clone, Default, Debug)]
@@ -18,15 +17,16 @@ impl ObjectStoreFactory for HdfsFactory {
1817
url: &Url,
1918
config: &StorageConfig,
2019
) -> DeltaResult<(ObjectStoreRef, Path)> {
21-
let mut store: ObjectStoreRef = Arc::new(HdfsObjectStore::with_config(
22-
url.as_str(),
23-
config.raw.clone(),
24-
)?);
20+
let mut builder = HdfsObjectStoreBuilder::new()
21+
.with_url(url.as_str())
22+
.with_config(&config.raw);
2523

26-
// HDFS doesn't have the spawnService, so we still wrap it in the old io storage backend (not as optimal though)
2724
if let Some(runtime) = &config.runtime {
28-
store = Arc::new(DeltaIOStorageBackend::new(store, runtime.clone()));
29-
};
25+
builder = builder.with_io_runtime(runtime.get_handle());
26+
}
27+
28+
let store = Arc::new(builder.build()?);
29+
3030
let prefix = Path::parse(url.path())?;
3131
Ok((store, prefix))
3232
}

0 commit comments

Comments
 (0)