Struct hdrs::ClientBuilder
source · pub struct ClientBuilder { /* private fields */ }
Expand description
The builder of connecting to hdfs clusters.
§Examples
use hdrs::{Client, ClientBuilder};
let fs = ClientBuilder::new("default")
.with_user("default")
.with_kerberos_ticket_cache_path("/tmp/krb5_111")
.connect();
Implementations§
source§impl ClientBuilder
impl ClientBuilder
sourcepub fn new(name_node: &str) -> ClientBuilder
pub fn new(name_node: &str) -> ClientBuilder
Create a ClientBuilder with name node
Returns an [hdrs::ClientBuilder
]
§Notes
The NameNode to use.
If the string given is profile name like ‘default’, the related NameNode configuration will be used (from the XML configuration files).
If the string starts with a protocol type such as file://
or
hdfs://
, this protocol type will be used. If not, the hdfs://
protocol type will be used. You may specify a NameNode port in the
usual way by passing a string of the format hdfs://<hostname>:<port>
.
§Examples
use hdrs::{Client, ClientBuilder};
let builder = ClientBuilder::new("default");
sourcepub fn with_user(self, user: &str) -> ClientBuilder
pub fn with_user(self, user: &str) -> ClientBuilder
Set the user for existing ClientBuilder
§Examples
use hdrs::{Client, ClientBuilder};
let client = ClientBuilder::new("default").with_user("default").connect();
sourcepub fn with_kerberos_ticket_cache_path(
self,
kerberos_ticket_cache_path: &str
) -> ClientBuilder
pub fn with_kerberos_ticket_cache_path( self, kerberos_ticket_cache_path: &str ) -> ClientBuilder
Set the krb5 ticket cache path for existing ClientBuilder
§Examples
use hdrs::{Client, ClientBuilder};
let mut client = ClientBuilder::new("default")
.with_kerberos_ticket_cache_path("/tmp/krb5_1001")
.connect();
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more