Struct hdfs::HdfsFs
[−]
[src]
pub struct HdfsFs<'a> { // some fields omitted }
Hdfs Filesystem
It is basically thread safe because the native API for hdfsFs is thread-safe.
Methods
impl<'a> HdfsFs<'a>
fn url(&self) -> &str
Get HDFS namenode url
fn raw(&self) -> *const hdfsFS
Get a raw pointer of JNI API's HdfsFs
fn append(&self, path: &str) -> Result<HdfsFile, HdfsErr>
Open a file for append
fn chmod(&self, path: &str, mode: i16) -> bool
set permission
fn chown(&self, path: &str, owner: &str, group: &str) -> bool
fn create(&self, path: &str) -> Result<HdfsFile, HdfsErr>
fn create_with_overwrite(&self, path: &str, overwrite: bool) -> Result<HdfsFile, HdfsErr>
fn create_with_params(&'a self, path: &str, overwrite: bool, buf_size: i32, replica_num: i16, block_size: i32) -> Result<HdfsFile, HdfsErr>
fn default_blocksize(&self) -> Result<usize, HdfsErr>
Get the default blocksize.
fn block_size(&self, path: &str) -> Result<usize, HdfsErr>
Get the default blocksize at the filesystem indicated by a given path.
fn capacity(&self) -> Result<usize, HdfsErr>
Return the raw capacity of the filesystem.
fn delete(&self, path: &str, recursive: bool) -> Result<bool, HdfsErr>
Delete file.
fn exist(&self, path: &str) -> bool
Checks if a given path exsits on the filesystem
fn get_hosts(&self, path: &str, start: usize, length: usize) -> Result<BlockHosts, HdfsErr>
Get hostnames where a particular block (determined by pos & blocksize) of a file is stored. The last element in the array is NULL. Due to replication, a single block could be present on multiple hosts.
fn mkdir(&self, path: &str) -> Result<bool, HdfsErr>
create a directory
fn open(&self, path: &str) -> Result<HdfsFile, HdfsErr>
open a file to read
fn open_with_bufsize(&self, path: &str, buf_size: i32) -> Result<HdfsFile, HdfsErr>
open a file to read with a buffer size
fn set_replication(&self, path: &str, num: i16) -> Result<bool, HdfsErr>
Set the replication of the specified file to the supplied value
fn rename(&self, old_path: &str, new_path: &str) -> Result<bool, HdfsErr>
Rename file.
fn used(&self) -> Result<usize, HdfsErr>
Return the total raw size of all files in the filesystem.