Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::FileSystemUtil Class Reference

#include <filesystem-util.h>

Collaboration diagram for impala::FileSystemUtil:

Static Public Member Functions

static Status CreateDirectories (const std::vector< std::string > &directories)
 
static Status CreateFile (const std::string &file_path)
 Create a file at the specified path. More...
 
static Status ResizeFile (const std::string &file_path, int64_t trunc_len)
 Resize a file to a specified length - uses unistd truncate(). More...
 
static Status RemovePaths (const std::vector< std::string > &directories)
 Remove the specified paths and their enclosing files/directories. More...
 
static Status VerifyIsDirectory (const std::string &directory_path)
 
static Status GetSpaceAvailable (const std::string &directory_path, uint64_t *available_bytes)
 

Detailed Description

Utility class for common local file system operations such as file creation and deletion. This class should NOT be used to read or write data (DiskIoMgr is used for that). Errors are indicated by the status code RUNTIME_ERROR, and are not handled via exceptions.

Definition at line 26 of file filesystem-util.h.

Member Function Documentation

Status impala::FileSystemUtil::CreateDirectories ( const std::vector< std::string > &  directories)
static

Create the specified directories. The directories and their contents are destroyed if they already exist.

Definition at line 33 of file filesystem-util.cc.

References impala::OK.

Status impala::FileSystemUtil::CreateFile ( const std::string &  file_path)
static

Create a file at the specified path.

Definition at line 66 of file filesystem-util.cc.

References impala::GetStrErrMsg(), and impala::OK.

Referenced by impala::TmpFileMgr::File::AllocateSpace().

Status impala::FileSystemUtil::GetSpaceAvailable ( const std::string &  directory_path,
uint64_t available_bytes 
)
static

Returns the space available on the file system containing 'directory_path' in 'available_bytes'

Definition at line 114 of file filesystem-util.cc.

References impala::OK, and impala::space.

Status impala::FileSystemUtil::RemovePaths ( const std::vector< std::string > &  directories)
static

Remove the specified paths and their enclosing files/directories.

Definition at line 53 of file filesystem-util.cc.

References impala::OK.

Referenced by impala::TmpFileMgr::File::Remove().

Status impala::FileSystemUtil::ResizeFile ( const std::string &  file_path,
int64_t  trunc_len 
)
static

Resize a file to a specified length - uses unistd truncate().

Definition at line 85 of file filesystem-util.cc.

References impala::GetStrErrMsg(), and impala::OK.

Referenced by impala::TmpFileMgr::File::AllocateSpace().

Status impala::FileSystemUtil::VerifyIsDirectory ( const std::string &  directory_path)
static

Verify that the specified path is an existing directory. Returns Status::OK if it is, or a runtime error with a message otherwise.

Definition at line 96 of file filesystem-util.cc.

References impala::OK.


The documentation for this class was generated from the following files: