@@ -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) ]
3032use 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