Skip to content

Commit 51a510a

Browse files
authored
Upgrade hdfs-native to 0.12 (#22)
1 parent 95a0f4a commit 51a510a

File tree

4 files changed

+44
-23
lines changed

4 files changed

+44
-23
lines changed

Cargo.lock

Lines changed: 24 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hdfs-native-object-store"
3-
version = "0.14.2"
3+
version = "0.15.0"
44
edition = "2021"
55
authors = ["Adam Binford <[email protected]>"]
66
homepage = "https://github.com/datafusion-contrib/hdfs-native-object-store"
@@ -15,7 +15,7 @@ async-trait = "0.1"
1515
bytes = "1"
1616
chrono = "0.4"
1717
futures = "0.3"
18-
hdfs-native = "0.11"
18+
hdfs-native = "0.12"
1919
object_store = "0.12.2"
2020
thiserror = "2"
2121
tokio = { version = "1", features = ["rt", "net", "io-util", "macros", "sync", "time"] }

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Each release supports a certain minor release of both the `object_store` crate a
1212
|0.12.x|>=0.10, <0.12|0.10|
1313
|0.13.x|>=0.10, <0.12|0.11|
1414
|0.14.x|0.12|0.11|
15+
|0.15.x|0.12|0.12|
1516

1617
# Usage
1718
```rust
@@ -20,4 +21,4 @@ let store = HdfsObjectStore::with_url("hdfs://localhost:9000")?;
2021
```
2122

2223
# Documentation
23-
See [Documentation](https://docs.rs/hdfs-native-object-store).
24+
See [Documentation](https://docs.rs/hdfs-native-object-store).

src/lib.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ use futures::{
2525
stream::{BoxStream, StreamExt},
2626
FutureExt,
2727
};
28-
use hdfs_native::{client::FileStatus, file::FileWriter, Client, HdfsError, WriteOptions};
28+
use hdfs_native::{
29+
client::FileStatus, file::FileWriter, Client, ClientBuilder, HdfsError, WriteOptions,
30+
};
2931
#[allow(deprecated)]
3032
use object_store::{
3133
path::Path, GetOptions, GetResult, GetResultPayload, ListResult, MultipartUpload, ObjectMeta,
@@ -60,9 +62,9 @@ impl HdfsObjectStore {
6062
///
6163
/// ```rust
6264
/// # use std::sync::Arc;
63-
/// use hdfs_native::Client;
65+
/// use hdfs_native::ClientBuilder;
6466
/// # use hdfs_native_object_store::HdfsObjectStore;
65-
/// let client = Client::new("hdfs://127.0.0.1:9000").unwrap();
67+
/// let client = ClientBuilder::new().with_url("hdfs://127.0.0.1:9000").build().unwrap();
6668
/// let store = HdfsObjectStore::new(Arc::new(client));
6769
/// ```
6870
pub fn new(client: Arc<Client>) -> Self {
@@ -80,7 +82,12 @@ impl HdfsObjectStore {
8082
/// # }
8183
/// ```
8284
pub fn with_url(url: &str) -> Result<Self> {
83-
Ok(Self::new(Arc::new(Client::new(url).to_object_store_err()?)))
85+
Ok(Self::new(Arc::new(
86+
ClientBuilder::new()
87+
.with_url(url)
88+
.build()
89+
.to_object_store_err()?,
90+
)))
8491
}
8592

8693
/// Creates a new HdfsObjectStore using the specified URL and Hadoop configs.
@@ -101,7 +108,11 @@ impl HdfsObjectStore {
101108
/// ```
102109
pub fn with_config(url: &str, config: HashMap<String, String>) -> Result<Self> {
103110
Ok(Self::new(Arc::new(
104-
Client::new_with_config(url, config).to_object_store_err()?,
111+
ClientBuilder::new()
112+
.with_url(url)
113+
.with_config(config)
114+
.build()
115+
.to_object_store_err()?,
105116
)))
106117
}
107118

0 commit comments

Comments
 (0)