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

#include <tmp-file-mgr.h>

Collaboration diagram for impala::TmpFileMgr:

Classes

class  File
 

Static Public Member Functions

static Status Init ()
 
static Status GetFile (int tmp_device_id, const TUniqueId &query_id, File **new_file)
 
static int num_tmp_devices ()
 

Static Private Attributes

static bool initialized_
 
static std::vector< std::string > tmp_dirs_
 The created tmp directories, atmost one per device. More...
 

Detailed Description

TmpFileMgr is a utility class that creates temporary directories on the local filesystem. TmpFileMgr::GetFile() is used to return a TmpFileMgr::File handle with a unique filename on a specified temp file device - the client owns the handle.

Definition at line 28 of file tmp-file-mgr.h.

Member Function Documentation

Status impala::TmpFileMgr::GetFile ( int  tmp_device_id,
const TUniqueId &  query_id,
File **  new_file 
)
static

Return a new File handle with a unique path for a query instance. The file path is within the (single) tmp directory on the specified device id. The caller owns the returned handle and is responsible for deleting it. The file is not created - creation is deferred until the first call to File::AllocateSpace().

Definition at line 88 of file tmp-file-mgr.cc.

References impala::OK, path(), and impala::PrintId().

Referenced by impala::BufferedBlockMgr::InitTmpFiles().

Status impala::TmpFileMgr::Init ( )
static

Creates the tmp directories configured by CM. If multiple directories are specified per disk, only one is created and used. Must be called after DiskInfo::Init().

Definition at line 47 of file tmp-file-mgr.cc.

References impala::AVAILABLE_SPACE_THRESHOLD_MB, impala::Status::ok(), path(), RETURN_IF_ERROR, and impala::TMP_SUB_DIR_NAME.

Referenced by impala::ImpalaServer::ImpalaServer(), and main().

static int impala::TmpFileMgr::num_tmp_devices ( )
inlinestatic

Total number of devices with tmp directories. This is the same as the number of tmp directories created.

Definition at line 87 of file tmp-file-mgr.h.

References tmp_dirs_.

Referenced by impala::BufferedBlockMgr::GetNumReservedBlocks(), and impala::BufferedBlockMgr::InitTmpFiles().

Member Data Documentation

bool impala::TmpFileMgr::initialized_
staticprivate

Definition at line 90 of file tmp-file-mgr.h.

vector< string > impala::TmpFileMgr::tmp_dirs_
staticprivate

The created tmp directories, atmost one per device.

Definition at line 93 of file tmp-file-mgr.h.

Referenced by num_tmp_devices().


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