pub struct Client { /* private fields */ }Expand description
A blocking HDFS client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn get_file_info(&self, path: &str) -> Result<FileStatus>
pub fn get_file_info(&self, path: &str) -> Result<FileStatus>
Retrieve the file status for the file at path.
Sourcepub fn list_status(
&self,
path: &str,
recursive: bool,
) -> Result<Vec<FileStatus>>
pub fn list_status( &self, path: &str, recursive: bool, ) -> Result<Vec<FileStatus>>
Retrieve all file statuses under path.
Sourcepub fn list_status_iter(
&self,
path: &str,
recursive: bool,
) -> ListStatusIterator ⓘ
pub fn list_status_iter( &self, path: &str, recursive: bool, ) -> ListStatusIterator ⓘ
Retrieve a blocking iterator of all files in directories located at path.
Sourcepub fn read(&self, path: &str) -> Result<FileReader>
pub fn read(&self, path: &str) -> Result<FileReader>
Opens a file reader for the file at path.
Sourcepub fn create(
&self,
src: &str,
write_options: impl AsRef<WriteOptions>,
) -> Result<FileWriter>
pub fn create( &self, src: &str, write_options: impl AsRef<WriteOptions>, ) -> Result<FileWriter>
Opens a new file for writing.
Sourcepub fn append(&self, src: &str) -> Result<FileWriter>
pub fn append(&self, src: &str) -> Result<FileWriter>
Opens an existing file for appending.
Sourcepub fn mkdirs(
&self,
path: &str,
permission: u32,
create_parent: bool,
) -> Result<()>
pub fn mkdirs( &self, path: &str, permission: u32, create_parent: bool, ) -> Result<()>
Create a new directory at path with the given permission.
Sourcepub fn delete(&self, path: &str, recursive: bool) -> Result<bool>
pub fn delete(&self, path: &str, recursive: bool) -> Result<bool>
Delete the file or directory at path.
Sourcepub fn trash(&self, path: &str) -> Result<Option<String>>
pub fn trash(&self, path: &str) -> Result<Option<String>>
Move a file or directory at path into the user’s trash.
Sourcepub fn set_times(&self, path: &str, mtime: u64, atime: u64) -> Result<()>
pub fn set_times(&self, path: &str, mtime: u64, atime: u64) -> Result<()>
Set modified and access times for a file.
Sourcepub fn set_owner(
&self,
path: &str,
owner: Option<&str>,
group: Option<&str>,
) -> Result<()>
pub fn set_owner( &self, path: &str, owner: Option<&str>, group: Option<&str>, ) -> Result<()>
Optionally set the owner and group for a file.
Sourcepub fn set_permission(&self, path: &str, permission: u32) -> Result<()>
pub fn set_permission(&self, path: &str, permission: u32) -> Result<()>
Set permissions for a file.
Sourcepub fn set_replication(&self, path: &str, replication: u32) -> Result<bool>
pub fn set_replication(&self, path: &str, replication: u32) -> Result<bool>
Set replication for a file.
Sourcepub fn get_content_summary(&self, path: &str) -> Result<ContentSummary>
pub fn get_content_summary(&self, path: &str) -> Result<ContentSummary>
Get a content summary for a file or directory rooted at path.
Sourcepub fn modify_acl_entries(
&self,
path: &str,
acl_spec: Vec<AclEntry>,
) -> Result<()>
pub fn modify_acl_entries( &self, path: &str, acl_spec: Vec<AclEntry>, ) -> Result<()>
Update ACL entries for file or directory at path.
Sourcepub fn remove_acl_entries(
&self,
path: &str,
acl_spec: Vec<AclEntry>,
) -> Result<()>
pub fn remove_acl_entries( &self, path: &str, acl_spec: Vec<AclEntry>, ) -> Result<()>
Remove specific ACL entries for file or directory at path.
Sourcepub fn remove_default_acl(&self, path: &str) -> Result<()>
pub fn remove_default_acl(&self, path: &str) -> Result<()>
Remove all default ACL entries for file or directory at path.
Sourcepub fn remove_acl(&self, path: &str) -> Result<()>
pub fn remove_acl(&self, path: &str) -> Result<()>
Remove all ACL entries for file or directory at path.
Sourcepub fn set_acl(&self, path: &str, acl_spec: Vec<AclEntry>) -> Result<()>
pub fn set_acl(&self, path: &str, acl_spec: Vec<AclEntry>) -> Result<()>
Override ACL entries for file or directory at path.
Sourcepub fn get_acl_status(&self, path: &str) -> Result<AclStatus>
pub fn get_acl_status(&self, path: &str) -> Result<AclStatus>
Get ACL status for the file or directory at path.
Sourcepub fn glob_status(&self, pattern: &str) -> Result<Vec<FileStatus>>
pub fn glob_status(&self, pattern: &str) -> Result<Vec<FileStatus>>
Get all file statuses matching the glob pattern.