@@ -25,7 +25,9 @@ use futures::{
25
25
stream:: { BoxStream , StreamExt } ,
26
26
FutureExt ,
27
27
} ;
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
+ } ;
29
31
#[ allow( deprecated) ]
30
32
use object_store:: {
31
33
path:: Path , GetOptions , GetResult , GetResultPayload , ListResult , MultipartUpload , ObjectMeta ,
@@ -60,9 +62,9 @@ impl HdfsObjectStore {
60
62
///
61
63
/// ```rust
62
64
/// # use std::sync::Arc;
63
- /// use hdfs_native::Client ;
65
+ /// use hdfs_native::ClientBuilder ;
64
66
/// # 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();
66
68
/// let store = HdfsObjectStore::new(Arc::new(client));
67
69
/// ```
68
70
pub fn new ( client : Arc < Client > ) -> Self {
@@ -80,7 +82,12 @@ impl HdfsObjectStore {
80
82
/// # }
81
83
/// ```
82
84
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
+ ) ) )
84
91
}
85
92
86
93
/// Creates a new HdfsObjectStore using the specified URL and Hadoop configs.
@@ -101,7 +108,11 @@ impl HdfsObjectStore {
101
108
/// ```
102
109
pub fn with_config ( url : & str , config : HashMap < String , String > ) -> Result < Self > {
103
110
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 ( ) ?,
105
116
) ) )
106
117
}
107
118
0 commit comments