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

#include <disk-info.h>

Collaboration diagram for impala::DiskInfo:

Classes

struct  Disk
 

Static Public Member Functions

static void Init ()
 Initialize DiskInfo. Just be called before any other functions. More...
 
static int num_disks ()
 Returns the number of (logical) disks on the system. More...
 
static int disk_id (const char *path)
 
static const std::string & device_name (int disk_id)
 Returns the device name (e.g. sda) for disk_id. More...
 
static bool is_rotational (int disk_id)
 
static std::string DebugString ()
 

Static Private Member Functions

static void GetDeviceNames ()
 

Static Private Attributes

static bool initialized_
 
static std::vector< Diskdisks_
 All disks. More...
 
static std::map< dev_t, int > device_id_to_disk_id_
 mapping of dev_ts to disk ids More...
 
static std::map< std::string, int > disk_name_to_disk_id_
 mapping of devices names to disk ids More...
 
static int num_datanode_dirs_
 

Detailed Description

DiskInfo is an interface to query for the disk information at runtime. This contains information about the system as well as the specific data node configuration. This information is pulled from /proc/partitions. TODO: datanode information not implemented

Definition at line 32 of file disk-info.h.

Member Function Documentation

string impala::DiskInfo::DebugString ( )
static

Definition at line 127 of file disk-info.cc.

References disks_, initialized_, and num_disks().

Referenced by impala::Webserver::RootHandler(), and impala::TEST().

static const std::string& impala::DiskInfo::device_name ( int  disk_id)
inlinestatic

Returns the device name (e.g. sda) for disk_id.

Definition at line 64 of file disk-info.h.

References disk_id(), and disks_.

Referenced by impala::TEST().

int impala::DiskInfo::disk_id ( const char *  path)
static

Returns the 0-based disk index for 'path' (path must be a FS path, not hdfs path).

Definition at line 119 of file disk-info.cc.

References device_id_to_disk_id_.

Referenced by impala::TmpFileMgr::File::AllocateSpace(), device_name(), GetDeviceNames(), is_rotational(), and impala::TEST().

void impala::DiskInfo::GetDeviceNames ( )
staticprivate

Definition at line 49 of file disk-info.cc.

References device_id_to_disk_id_, disk_id(), disk_name_to_disk_id_, disks_, and impala::name.

Referenced by Init().

void impala::DiskInfo::Init ( )
static

Initialize DiskInfo. Just be called before any other functions.

Definition at line 114 of file disk-info.cc.

References GetDeviceNames(), and initialized_.

Referenced by main().

static bool impala::DiskInfo::is_rotational ( int  disk_id)
inlinestatic

Definition at line 70 of file disk-info.h.

References disk_id(), and disks_.

Referenced by impala::DiskIoMgr::Init().

static int impala::DiskInfo::num_disks ( )
inlinestatic

Returns the number of (logical) disks on the system.

Definition at line 38 of file disk-info.h.

References disks_, and initialized_.

Referenced by DebugString(), impala::DiskIoMgr::DiskIoMgr(), impala::HdfsScanNode::HdfsScanNode(), and impala::HdfsScanNode::Open().

Member Data Documentation

map< dev_t, int > impala::DiskInfo::device_id_to_disk_id_
staticprivate

mapping of dev_ts to disk ids

Definition at line 99 of file disk-info.h.

Referenced by disk_id(), and GetDeviceNames().

map< string, int > impala::DiskInfo::disk_name_to_disk_id_
staticprivate

mapping of devices names to disk ids

Definition at line 102 of file disk-info.h.

Referenced by GetDeviceNames().

vector< DiskInfo::Disk > impala::DiskInfo::disks_
staticprivate

All disks.

Definition at line 96 of file disk-info.h.

Referenced by DebugString(), device_name(), GetDeviceNames(), is_rotational(), and num_disks().

bool impala::DiskInfo::initialized_
staticprivate

Definition at line 79 of file disk-info.h.

Referenced by DebugString(), Init(), and num_disks().

int impala::DiskInfo::num_datanode_dirs_
staticprivate

Definition at line 104 of file disk-info.h.


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