Struct HDFS

Source
pub struct HDFS<S: Read + Write, D: Read + Write> { /* private fields */ }

Implementations§

Source§

impl HDFS<BufStream<TcpStream>, BufStream<TcpStream>>

Source

pub fn connect<S: ToString>( name_node: impl ToNameNodes, user: impl Into<Option<S>>, ) -> Result<Self>

Source

pub fn connect_with(config: ClientConfig) -> Result<Self>

Source§

impl<S: Read + Write, D: Read + Write> HDFS<S, D>

Source

pub fn new( create_ipc: impl Fn() -> Result<HRpc<S>> + 'static, connect_datanode: impl Fn(&DatanodeIdProto, IOType) -> Result<D> + 'static, ) -> Result<Self>

Source

pub fn client_name(&self) -> &str

Source

pub fn get_rpc(&mut self) -> &mut HRpc<S>

Source

pub fn new_rpc(&mut self) -> Result<HRpc<S>, Error>

Source

pub fn open( &mut self, path: impl AsRef<Path>, ) -> Result<FileReader<D>, HDFSError>

open a file

Source

pub fn reader_options(&mut self) -> ReaderOptions

use reader option to custom file read options

Source

pub fn create( &mut self, path: impl AsRef<Path>, ) -> Result<FileWriter<S, D>, HDFSError>

create a file

Source

pub fn append( &mut self, path: impl AsRef<Path>, ) -> Result<FileWriter<S, D>, HDFSError>

open a existing file and append content to it

Source

pub fn writer_options(&mut self) -> WriterOptions

Source

pub fn create_dir(&mut self, path: impl AsRef<Path>) -> Result<(), HDFSError>

Source

pub fn create_dir_all( &mut self, path: impl AsRef<Path>, ) -> Result<(), HDFSError>

Source

pub fn read(&mut self, path: impl AsRef<Path>) -> Result<Vec<u8>, HDFSError>

read the entire contents of a file into a bytes vector.

Source

pub fn read_dir( &mut self, path: impl AsRef<Path>, ) -> Result<Vec<HdfsFileStatusProto>, HDFSError>

Source

pub fn remove_dir(&mut self, path: impl AsRef<Path>) -> Result<(), HDFSError>

Source

pub fn remove_dir_all( &mut self, path: impl AsRef<Path>, ) -> Result<(), HDFSError>

Source

pub fn remove_file(&mut self, path: impl AsRef<Path>) -> Result<(), HDFSError>

Source

pub fn rename( &mut self, from: impl AsRef<Path>, to: impl AsRef<Path>, ) -> Result<(), HDFSError>

Auto Trait Implementations§

§

impl<S, D> Freeze for HDFS<S, D>
where S: Freeze,

§

impl<S, D> !RefUnwindSafe for HDFS<S, D>

§

impl<S, D> !Send for HDFS<S, D>

§

impl<S, D> !Sync for HDFS<S, D>

§

impl<S, D> Unpin for HDFS<S, D>
where S: Unpin,

§

impl<S, D> !UnwindSafe for HDFS<S, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more