Thrill
0.1
|
Encapsulate the configuration of one "disk". The disk is actually a file I/O object which block_manager uses to read/write blocks.
Definition at line 36 of file config.hpp.
#include <config.hpp>
Public Member Functions | |
disk_config () | |
default constructor More... | |
disk_config (const std::string &path, external_size_type size, const std::string &fileio) | |
initializing constructor, also parses fileio parameter More... | |
disk_config (const std::string &line) | |
initializing constructor, parse full line as in config files More... | |
std::string | fileio_string () const |
return formatted fileio name and optional configuration parameters More... | |
void | parse_fileio () |
parse the "io_impl" parameter into the optional parameter fields. More... | |
void | parse_line (const std::string &line) |
Public Attributes | |
Basic Disk Configuration Parameters | |
std::string | path |
the file path used by the io implementation More... | |
external_size_type | size |
file size to initially allocate More... | |
std::string | io_impl |
io implementation to access file More... | |
Optional Disk / File I/O Implementation Parameters | |
enum | direct_type { DIRECT_OFF = 0, DIRECT_TRY = 1, DIRECT_ON = 2 } |
bool | autogrow |
autogrow file if more disk space is needed, automatically set if size == 0. More... | |
bool | delete_on_exit |
delete file on program exit (default for autoconfigurated files) More... | |
enum foxxll::disk_config::direct_type | direct |
bool | flash |
marks flash drives (configuration entries with flash= instead of disk=) More... | |
int | queue |
unsigned int | device_id |
bool | raw_device |
turned on by syscall fileio when the path points to a raw block device More... | |
bool | unlink_on_open |
unlink file immediately after opening (available on most Unix) More... | |
int | queue_length |
desired queue length for linuxaio_file and linuxaio_queue More... | |
enum direct_type |
tristate variable: direct=0 -> force direct OFF, direct=1 -> try direct ON, if fails print warning and open without direct, direct=2 -> force direct ON, fail if unavailable.
Enumerator | |
---|---|
DIRECT_OFF | |
DIRECT_TRY | |
DIRECT_ON |
Definition at line 86 of file config.hpp.
disk_config | ( | ) |
default constructor
Definition at line 290 of file config.cpp.
disk_config | ( | const std::string & | path, |
external_size_type | size, | ||
const std::string & | fileio | ||
) |
initializing constructor, also parses fileio parameter
Definition at line 303 of file config.cpp.
References disk_config::parse_fileio().
|
explicit |
initializing constructor, parse full line as in config files
Definition at line 321 of file config.cpp.
References disk_config::parse_line().
std::string fileio_string | ( | ) | const |
return formatted fileio name and optional configuration parameters
Definition at line 547 of file config.cpp.
References disk_config::autogrow, file::DEFAULT_DEVICE_ID, file::DEFAULT_LINUXAIO_QUEUE, file::DEFAULT_QUEUE, disk_config::delete_on_exit, disk_config::device_id, disk_config::direct, disk_config::DIRECT_OFF, disk_config::DIRECT_ON, disk_config::DIRECT_TRY, disk_config::flash, FOXXLL_THROW, disk_config::io_impl, disk_config::queue, disk_config::queue_length, disk_config::raw_device, and disk_config::unlink_on_open.
Referenced by block_manager::block_manager().
void parse_fileio | ( | ) |
parse the "io_impl" parameter into the optional parameter fields.
Definition at line 403 of file config.cpp.
References disk_config::autogrow, disk_config::delete_on_exit, disk_config::device_id, disk_config::direct, disk_config::DIRECT_OFF, disk_config::DIRECT_ON, disk_config::DIRECT_TRY, FOXXLL_THROW, disk_config::io_impl, disk_config::queue, disk_config::queue_length, disk_config::raw_device, tlx::split(), and disk_config::unlink_on_open.
Referenced by disk_config::disk_config(), and disk_config::parse_line().
void parse_line | ( | const std::string & | line | ) |
parse a disk=<path>,<size>,<fileio> options line into disk_config, throws std::runtime_error on parse errors.
Definition at line 336 of file config.cpp.
References disk_config::autogrow, file::DEFAULT_DEVICE_ID, file::DEFAULT_QUEUE, disk_config::delete_on_exit, disk_config::device_id, disk_config::direct, disk_config::DIRECT_TRY, tlx::expand_environment_variables(), disk_config::flash, FOXXLL_THROW, disk_config::io_impl, disk_config::parse_fileio(), tlx::parse_si_iec_units(), disk_config::path, disk_config::queue, disk_config::size, tlx::split(), foxxll::to_str(), and disk_config::unlink_on_open.
Referenced by disk_config::disk_config(), and config::load_config_file().
bool autogrow |
autogrow file if more disk space is needed, automatically set if size == 0.
Definition at line 78 of file config.hpp.
Referenced by foxxll::create_file(), disk_config::fileio_string(), config::load_default_config(), disk_config::parse_fileio(), disk_config::parse_line(), and thrill::api::RunCheckUnlinkBinary().
bool delete_on_exit |
delete file on program exit (default for autoconfigurated files)
Definition at line 81 of file config.hpp.
Referenced by foxxll::create_file(), disk_config::fileio_string(), config::load_default_config(), disk_config::parse_fileio(), and disk_config::parse_line().
unsigned int device_id |
the selected physical device id (e.g. for calculating prefetching sequences). If -1 then the device id is chosen automatically.
Definition at line 97 of file config.hpp.
Referenced by foxxll::create_file(), disk_config::fileio_string(), disk_config::parse_fileio(), and disk_config::parse_line().
enum foxxll::disk_config::direct_type direct |
bool flash |
marks flash drives (configuration entries with flash= instead of disk=)
Definition at line 89 of file config.hpp.
Referenced by disk_config::fileio_string(), config::load_config_file(), and disk_config::parse_line().
std::string io_impl |
io implementation to access file
Definition at line 49 of file config.hpp.
Referenced by foxxll::create_file(), disk_config::fileio_string(), disk_config::parse_fileio(), and disk_config::parse_line().
std::string path |
the file path used by the io implementation
Definition at line 43 of file config.hpp.
Referenced by block_manager::block_manager(), foxxll::create_file(), and disk_config::parse_line().
int queue |
select request queue for disk. Use different queues for files on different disks. queue=-1 -> default queue (one for each disk).
Definition at line 93 of file config.hpp.
Referenced by block_manager::block_manager(), foxxll::create_file(), disk_config::fileio_string(), disk_config::parse_fileio(), and disk_config::parse_line().
int queue_length |
desired queue length for linuxaio_file and linuxaio_queue
Definition at line 106 of file config.hpp.
Referenced by foxxll::create_file(), disk_config::fileio_string(), and disk_config::parse_fileio().
bool raw_device |
turned on by syscall fileio when the path points to a raw block device
Definition at line 100 of file config.hpp.
Referenced by foxxll::create_file(), disk_config::fileio_string(), and disk_config::parse_fileio().
external_size_type size |
file size to initially allocate
Definition at line 46 of file config.hpp.
Referenced by block_manager::block_manager(), foxxll::create_file(), disk_block_allocator::disk_block_allocator(), and disk_config::parse_line().
bool unlink_on_open |
unlink file immediately after opening (available on most Unix)
Definition at line 103 of file config.hpp.
Referenced by foxxll::create_file(), disk_config::fileio_string(), disk_config::parse_fileio(), disk_config::parse_line(), and thrill::api::RunCheckUnlinkBinary().