#include <I_Store.h>
Public Member Functions | |
void | spread_alloc (Store &s, unsigned int blocks, bool mmapable=true) |
void | alloc (Store &s, unsigned int blocks, bool only_one=false, bool mmapable=true) |
Span * | alloc_one (unsigned int blocks, bool mmapable) |
void | try_realloc (Store &s, Store &diff) |
void | free (Store &s) |
void | add (Span *s) |
void | add (Store &s) |
void | dup (Store &s) |
void | sort () |
void | extend (unsigned i) |
unsigned int | total_blocks (unsigned after=0) |
int | write (int fd, char *name) |
int | read (int fd, char *name) |
int | clear (char *filename, bool clear_dirs=true) |
void | normalize () |
void | delete_all () |
int | remove (char *pathname) |
Store () | |
~Store () | |
const char * | read_config (int fd=-1) |
int | write_config_data (int fd) |
Data Fields | |
unsigned | n_disks |
Span ** | disk |
Static Public Attributes | |
static char const | VOLUME_KEY [] = "volume" |
Additional configuration key values. | |
static char const | HASH_BASE_STRING_KEY [] = "id" |
Definition at line 131 of file I_Store.h.
Store::~Store | ( | ) |
Definition at line 226 of file Store.cc.
References delete_all().
void Store::add | ( | Span * | s | ) |
Definition at line 65 of file Store.cc.
References disk, extend(), and n_disks.
Referenced by add(), MultiCacheBase::open(), HostDBCache::start(), and try_alloc().
void Store::add | ( | Store & | s | ) |
void Store::alloc | ( | Store & | s, | |
unsigned int | blocks, | |||
bool | only_one = false , |
|||
bool | mmapable = true | |||
) |
Definition at line 962 of file Store.cc.
References disk, n_disks, and try_alloc().
Referenced by alloc_one().
Span* Store::alloc_one | ( | unsigned int | blocks, | |
bool | mmapable | |||
) | [inline] |
int Store::clear | ( | char * | filename, | |
bool | clear_dirs = true | |||
) |
Definition at line 1163 of file Store.cc.
References Span::blocks, disk, Span::file_pathname, n_disks, Span::nth(), Span::offset, Span::path(), PATH_NAME_MAX, Span::paths(), SocketManager::pwrite(), socketManager, and STORE_BLOCK_SIZE.
Referenced by MultiCacheBase::open().
void Store::delete_all | ( | ) |
Definition at line 215 of file Store.cc.
References ats_free(), disk, and n_disks.
Referenced by add(), cmd_check_internal(), cmd_clear(), stealStore(), and ~Store().
void Store::dup | ( | Store & | s | ) |
Definition at line 1153 of file Store.cc.
References ats_malloc(), disk, Span::dup(), and n_disks.
Referenced by MultiCacheBase::mmap_data(), and MultiCacheBase::open().
void Store::extend | ( | unsigned | i | ) | [inline] |
Definition at line 163 of file I_Store.h.
References ats_realloc(), disk, and n_disks.
Referenced by add(), read_config(), and try_realloc().
void Store::free | ( | Store & | s | ) |
Definition at line 88 of file Store.cc.
References disk, ink_release_assert, and n_disks.
Referenced by MultiCacheBase::initialize().
void Store::normalize | ( | ) |
int Store::read | ( | int | fd, | |
char * | name | |||
) |
Definition at line 1082 of file Store.cc.
References ats_malloc(), disk, ink_file_fd_readline(), n_disks, PATH_NAME_MAX, and Span::read().
Referenced by MultiCacheBase::read_config().
const char * Store::read_config | ( | int | fd = -1 |
) |
Definition at line 277 of file Store.cc.
References ats_free(), Debug, disk, extend(), Layout::get(), SimpleTokenizer::getNext(), HASH_BASE_STRING_KEY, Span::hash_base_string_set(), Span::init(), ink_atoi(), ink_atoi64(), ink_file_fd_readline(), ParseRules::is_digit(), ParseRules::is_space(), SimpleTokenizer::OVERWRITE_INPUT_STRING, REC_SIGNAL_SYSTEM_ERROR, RecConfigReadConfigPath(), RecSignalWarning(), Layout::relative(), sort(), VOLUME_KEY, and Span::volume_number_set().
Referenced by cmd_check_internal(), cmd_clear(), cmd_list(), initialize_store(), ink_cache_init(), storageConfigFile::parseFile(), and stealStore().
int Store::remove | ( | char * | pathname | ) |
void Store::sort | ( | ) |
Definition at line 107 of file Store.cc.
References Span::blocks, disk, Span::disk_id, Span::end(), n_disks, Span::offset, and Span::pathname.
Referenced by MultiCacheBase::open(), and read_config().
void Store::spread_alloc | ( | Store & | s, | |
unsigned int | blocks, | |||
bool | mmapable = true | |||
) |
Definition at line 874 of file Store.cc.
References disk, n_disks, total_blocks(), and try_alloc().
Referenced by MultiCacheBase::initialize(), and MultiCacheBase::open().
unsigned int Store::total_blocks | ( | unsigned | after = 0 |
) | [inline] |
Definition at line 175 of file I_Store.h.
References disk, n_disks, and Span::total_blocks().
Referenced by MultiCacheBase::initialize(), MultiCacheBase::mmap_region(), MultiCacheBase::open(), and spread_alloc().
Definition at line 909 of file Store.cc.
References Span::blocks, disk, extend(), n_disks, normalize(), and Span::offset.
Referenced by MultiCacheBase::open(), and stealStore().
int Store::write | ( | int | fd, | |
char * | name | |||
) |
Definition at line 1004 of file Store.cc.
References disk, ink_file_fd_writestring(), n_disks, and Span::write().
Referenced by MultiCacheBase::write_config().
int Store::write_config_data | ( | int | fd | ) |
Definition at line 444 of file Store.cc.
References Span::blocks, disk, ink_file_fd_writestring(), n_disks, PATH_NAME_MAX, and Span::pathname.
Referenced by cmd_list().
Definition at line 197 of file I_Store.h.
Referenced by add(), alloc(), alloc_one(), clear(), delete_all(), dup(), extend(), free(), MultiCacheBase::mmap_data(), MultiCacheBase::mmap_region(), normalize(), read(), read_config(), remove(), sort(), spread_alloc(), CacheProcessor::start_internal(), stealStore(), store_verify(), total_blocks(), try_realloc(), write(), and write_config_data().
char const Store::HASH_BASE_STRING_KEY = "id" [static] |
Definition at line 213 of file I_Store.h.
Referenced by read_config().
unsigned Store::n_disks |
Definition at line 196 of file I_Store.h.
Referenced by add(), alloc(), alloc_one(), clear(), delete_all(), dup(), extend(), free(), ink_cache_init(), MultiCacheBase::mmap_data(), MultiCacheBase::mmap_region(), normalize(), MultiCacheBase::open(), read(), remove(), sort(), spread_alloc(), CacheProcessor::start_internal(), stealStore(), store_verify(), total_blocks(), try_realloc(), write(), and write_config_data().
char const Store::VOLUME_KEY = "volume" [static] |
Additional configuration key values.
Definition at line 212 of file I_Store.h.
Referenced by read_config().