From cf14b5cac86d9594a07795349f3efd2c84d401c3 Mon Sep 17 00:00:00 2001 From: Borodin Gregory Date: Sat, 16 Aug 2025 00:51:44 +0200 Subject: [PATCH 1/3] Upgrade hdfs-native to 0.12 --- Cargo.lock | 39 ++++++++++++++++++++++++--------------- Cargo.toml | 4 ++-- README.md | 3 ++- src/lib.rs | 8 ++++---- 4 files changed, 32 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 13b82b5..ba27b0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -324,7 +324,7 @@ checksum = "e5766087c2235fec47fafa4cfecc81e494ee679d0fd4a59887ea0919bfb0e4fc" dependencies = [ "cfg-if", "libc", - "socket2", + "socket2 0.5.10", "windows-sys 0.48.0", ] @@ -535,9 +535,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "hdfs-native" -version = "0.11.3" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b4cabd42d46aac490d01b80596dfd930a8316b4ee3e8b0c94a7cba888791c0f" +checksum = "23709a4e6b07f231c28608b9c84a873157221cae9674478ca7569ec5ac505517" dependencies = [ "aes", "base64", @@ -565,7 +565,7 @@ dependencies = [ "rand", "regex", "roxmltree", - "socket2", + "socket2 0.6.0", "thiserror", "tokio", "url", @@ -576,7 +576,7 @@ dependencies = [ [[package]] name = "hdfs-native-object-store" -version = "0.14.2" +version = "0.15.0" dependencies = [ "async-trait", "bytes", @@ -1049,9 +1049,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +checksum = "7231bd9b3d3d33c86b58adbac74b5ec0ad9f496b19d22801d773636feaa95f3d" dependencies = [ "bytes", "prost-derive", @@ -1059,9 +1059,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425" dependencies = [ "anyhow", "itertools", @@ -1072,9 +1072,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.13.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +checksum = "b9b4db3d6da204ed77bb26ba83b6122a73aeb2e87e25fbf7ad2e84c4ccbf8f72" dependencies = [ "prost", ] @@ -1295,6 +1295,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "socket2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1372,7 +1382,7 @@ dependencies = [ "mio", "pin-project-lite", "slab", - "socket2", + "socket2 0.5.10", "tokio-macros", "windows-sys 0.52.0", ] @@ -1595,11 +1605,10 @@ dependencies = [ [[package]] name = "which" -version = "7.0.3" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d643ce3fd3e5b54854602a080f34fb10ab75e0b813ee32d00ca2b44fa74762" +checksum = "d3fabb953106c3c8eea8306e4393700d7657561cb43122571b172bbfb7c7ba1d" dependencies = [ - "either", "env_home", "rustix", "winsafe", diff --git a/Cargo.toml b/Cargo.toml index 1c9758f..943b68d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hdfs-native-object-store" -version = "0.14.2" +version = "0.15.0" edition = "2021" authors = ["Adam Binford "] homepage = "https://github.com/datafusion-contrib/hdfs-native-object-store" @@ -15,7 +15,7 @@ async-trait = "0.1" bytes = "1" chrono = "0.4" futures = "0.3" -hdfs-native = "0.11" +hdfs-native = "0.12" object_store = "0.12.2" thiserror = "2" tokio = { version = "1", features = ["rt", "net", "io-util", "macros", "sync", "time"] } diff --git a/README.md b/README.md index 73f2e65..47dfb89 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Each release supports a certain minor release of both the `object_store` crate a |0.12.x|>=0.10, <0.12|0.10| |0.13.x|>=0.10, <0.12|0.11| |0.14.x|0.12|0.11| +|0.15.x|0.12|0.12| # Usage ```rust @@ -20,4 +21,4 @@ let store = HdfsObjectStore::with_url("hdfs://localhost:9000")?; ``` # Documentation -See [Documentation](https://docs.rs/hdfs-native-object-store). \ No newline at end of file +See [Documentation](https://docs.rs/hdfs-native-object-store). diff --git a/src/lib.rs b/src/lib.rs index 466767e..ae3ced1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,7 @@ use futures::{ stream::{BoxStream, StreamExt}, FutureExt, }; -use hdfs_native::{client::FileStatus, file::FileWriter, Client, HdfsError, WriteOptions}; +use hdfs_native::{client::FileStatus, file::FileWriter, Client, ClientBuilder, HdfsError, WriteOptions}; #[allow(deprecated)] use object_store::{ path::Path, GetOptions, GetResult, GetResultPayload, ListResult, MultipartUpload, ObjectMeta, @@ -62,7 +62,7 @@ impl HdfsObjectStore { /// # use std::sync::Arc; /// use hdfs_native::Client; /// # use hdfs_native_object_store::HdfsObjectStore; - /// let client = Client::new("hdfs://127.0.0.1:9000").unwrap(); + /// let client = ClientBuilder::new().with_url("hdfs://127.0.0.1:9000").build().unwrap(); /// let store = HdfsObjectStore::new(Arc::new(client)); /// ``` pub fn new(client: Arc) -> Self { @@ -80,7 +80,7 @@ impl HdfsObjectStore { /// # } /// ``` pub fn with_url(url: &str) -> Result { - Ok(Self::new(Arc::new(Client::new(url).to_object_store_err()?))) + Ok(Self::new(Arc::new(ClientBuilder::new().with_url(url).build().to_object_store_err()?))) } /// Creates a new HdfsObjectStore using the specified URL and Hadoop configs. @@ -101,7 +101,7 @@ impl HdfsObjectStore { /// ``` pub fn with_config(url: &str, config: HashMap) -> Result { Ok(Self::new(Arc::new( - Client::new_with_config(url, config).to_object_store_err()?, + ClientBuilder::new().with_url(url).with_config(config).build().to_object_store_err()?, ))) } From bcc7126fd612215e5ac193678b02347d51433174 Mon Sep 17 00:00:00 2001 From: Gregory Borodin Date: Sat, 16 Aug 2025 14:45:58 +0200 Subject: [PATCH 2/3] Fix doctrst --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index ae3ced1..95a2157 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,7 +60,7 @@ impl HdfsObjectStore { /// /// ```rust /// # use std::sync::Arc; - /// use hdfs_native::Client; + /// use hdfs_native::ClientBuilder; /// # use hdfs_native_object_store::HdfsObjectStore; /// let client = ClientBuilder::new().with_url("hdfs://127.0.0.1:9000").build().unwrap(); /// let store = HdfsObjectStore::new(Arc::new(client)); From bd752b940e5ecd2bdd8a6e08f3825df241d61a60 Mon Sep 17 00:00:00 2001 From: Borodin Gregory Date: Sat, 16 Aug 2025 17:07:08 +0200 Subject: [PATCH 3/3] cargo fmt --- src/lib.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 95a2157..711689e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,9 @@ use futures::{ stream::{BoxStream, StreamExt}, FutureExt, }; -use hdfs_native::{client::FileStatus, file::FileWriter, Client, ClientBuilder, HdfsError, WriteOptions}; +use hdfs_native::{ + client::FileStatus, file::FileWriter, Client, ClientBuilder, HdfsError, WriteOptions, +}; #[allow(deprecated)] use object_store::{ path::Path, GetOptions, GetResult, GetResultPayload, ListResult, MultipartUpload, ObjectMeta, @@ -80,7 +82,12 @@ impl HdfsObjectStore { /// # } /// ``` pub fn with_url(url: &str) -> Result { - Ok(Self::new(Arc::new(ClientBuilder::new().with_url(url).build().to_object_store_err()?))) + Ok(Self::new(Arc::new( + ClientBuilder::new() + .with_url(url) + .build() + .to_object_store_err()?, + ))) } /// Creates a new HdfsObjectStore using the specified URL and Hadoop configs. @@ -101,7 +108,11 @@ impl HdfsObjectStore { /// ``` pub fn with_config(url: &str, config: HashMap) -> Result { Ok(Self::new(Arc::new( - ClientBuilder::new().with_url(url).with_config(config).build().to_object_store_err()?, + ClientBuilder::new() + .with_url(url) + .with_config(config) + .build() + .to_object_store_err()?, ))) }