Public Member Functions | Data Fields | Static Public Attributes

Store Struct Reference

#include <I_Store.h>

Collaboration diagram for Store:
Collaboration graph
[legend]

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)
Spanalloc_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"

Detailed Description

Definition at line 131 of file I_Store.h.


Constructor & Destructor Documentation

Store::Store (  ) 

Definition at line 51 of file Store.cc.

Store::~Store (  ) 

Definition at line 226 of file Store.cc.

References delete_all().


Member Function Documentation

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  ) 

Definition at line 72 of file Store.cc.

References add(), delete_all(), disk, and n_disks.

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]

Definition at line 142 of file I_Store.h.

References alloc(), disk, and n_disks.

int Store::clear ( char *  filename,
bool  clear_dirs = true 
)
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 (  ) 

Definition at line 831 of file Store.cc.

References disk, and n_disks.

Referenced by try_realloc().

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  ) 
int Store::remove ( char *  pathname  ) 

Definition at line 253 of file Store.cc.

References disk, and n_disks.

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]
void Store::try_realloc ( Store s,
Store diff 
)

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().


Field Documentation

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
char const Store::VOLUME_KEY = "volume" [static]

Additional configuration key values.

Definition at line 212 of file I_Store.h.

Referenced by read_config().


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