Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <tmp-file-mgr.h>
Public Member Functions | |
Status | AllocateSpace (int64_t write_size, int64_t *offset) |
Status | Remove () |
const std::string & | path () const |
int | disk_id () const |
Private Member Functions | |
File (const std::string &path) | |
Private Attributes | |
std::string | path_ |
Path of the physical file in the filesystem. More... | |
int | disk_id_ |
The id of the disk on which the physical file lies. More... | |
int64_t | current_offset_ |
Offset to which the next block will be written. More... | |
int64_t | current_size_ |
Static Private Attributes | |
static const std::string | TMP_SUB_DIR_NAME |
static const uint64_t | AVAILABLE_SPACE_THRESHOLD_MB |
Friends | |
class | TmpFileMgr |
TmpFileMgr::File is a handle to a physical file in a temporary directory. Clients can allocate file space and remove files using AllocateSpace() and Remove(). Creation of the file is deferred until the first call to AllocateSpace().
Definition at line 33 of file tmp-file-mgr.h.
|
private |
Definition at line 104 of file tmp-file-mgr.cc.
Status impala::TmpFileMgr::File::AllocateSpace | ( | int64_t | write_size, |
int64_t * | offset | ||
) |
Allocates 'write_size' bytes in this file for a new block of data. The file size is increased by a call to truncate() if necessary. The physical file is created on the first call to AllocateSpace().
Definition at line 110 of file tmp-file-mgr.cc.
References impala::FileSystemUtil::CreateFile(), impala::DiskInfo::disk_id(), impala::Status::OK, impala::FileSystemUtil::ResizeFile(), and RETURN_IF_ERROR.
Referenced by impala::BufferedBlockMgr::WriteUnpinnedBlock().
|
inline |
Definition at line 45 of file tmp-file-mgr.h.
References disk_id_.
Referenced by impala::BufferedBlockMgr::WriteUnpinnedBlock().
|
inline |
Definition at line 44 of file tmp-file-mgr.h.
References path_.
Referenced by impala::BufferedBlockMgr::WriteUnpinnedBlock().
Status impala::TmpFileMgr::File::Remove | ( | ) |
Delete the physical file on disk, if one was created. It is not valid to read or write to a file after calling Remove().
Definition at line 132 of file tmp-file-mgr.cc.
References impala::Status::OK, and impala::FileSystemUtil::RemovePaths().
Referenced by impala::BufferedBlockMgr::~BufferedBlockMgr().
|
friend |
Definition at line 48 of file tmp-file-mgr.h.
|
staticprivate |
Space (in MB) that must ideally be available for writing on a scratch directory. A warning is issued if available space is less than this threshold.
Definition at line 56 of file tmp-file-mgr.h.
|
private |
Offset to which the next block will be written.
Definition at line 67 of file tmp-file-mgr.h.
|
private |
Current file size. Modified by AllocateSpace(). Is always >= current offset. Size is 0 before the file is created.
Definition at line 71 of file tmp-file-mgr.h.
|
private |
The id of the disk on which the physical file lies.
Definition at line 64 of file tmp-file-mgr.h.
Referenced by disk_id().
|
private |
Path of the physical file in the filesystem.
Definition at line 61 of file tmp-file-mgr.h.
Referenced by path().
|
staticprivate |
The name of the sub-directory that Impala created within each configured scratch directory.
Definition at line 52 of file tmp-file-mgr.h.