CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PluginRamCache Class Reference
Inheritance diagram for PluginRamCache:
Collaboration diagram for PluginRamCache:

Public Member Functions

 ~PluginRamCache ()
 
void DropBreadcrumbs ()
 

Static Public Member Functions

static PluginRamCacheCreate (const string &mem_size_str)
 
static PluginRamCacheGetInstance ()
 
static int ram_chrefcnt (struct cvmcache_hash *id, int32_t change_by)
 
static int ram_obj_info (struct cvmcache_hash *id, struct cvmcache_object_info *info)
 
static int ram_pread (struct cvmcache_hash *id, uint64_t offset, uint32_t *size, unsigned char *buffer)
 
static int ram_start_txn (struct cvmcache_hash *id, uint64_t txn_id, struct cvmcache_object_info *info)
 
static int ram_write_txn (uint64_t txn_id, unsigned char *buffer, uint32_t size)
 
static int ram_commit_txn (uint64_t txn_id)
 
static int ram_abort_txn (uint64_t txn_id)
 
static int ram_info (struct cvmcache_info *info)
 
static int ram_shrink (uint64_t shrink_to, uint64_t *used)
 
static int ram_listing_begin (uint64_t lst_id, enum cvmcache_object_type type)
 
static int ram_listing_next (int64_t listing_id, struct cvmcache_object_info *item)
 
static int ram_listing_end (int64_t listing_id)
 
static int ram_breadcrumb_store (const char *fqrn, const cvmcache_breadcrumb *breadcrumb)
 
static int ram_breadcrumb_load (const char *fqrn, cvmcache_breadcrumb *breadcrumb)
 
- Static Public Member Functions inherited from Callbackable< MallocHeap::BlockPtr >
static CallbackTNMakeClosure (typename BoundClosure< MallocHeap::BlockPtr, DelegateT, ClosureDataT >::CallbackMethod method, DelegateT *delegate, const ClosureDataT &closure_data)
 
static CallbackTNMakeCallback (typename BoundCallback< MallocHeap::BlockPtr, DelegateT >::CallbackMethod method, DelegateT *delegate)
 
static CallbackTNMakeCallback (typename Callback< MallocHeap::BlockPtr >::CallbackFunction function)
 

Private Member Functions

 PluginRamCache (uint64_t mem_size)
 
bool TryFreeSpace (uint64_t bytes_required)
 
void OnBlockMove (const MallocHeap::BlockPtr &ptr)
 
void DoShrink (uint64_t shrink_to)
 
void CheckHighPinWatermark ()
 
bool IsInDangerZone ()
 

Static Private Member Functions

static PluginRamCacheMe ()
 

Private Attributes

struct cvmcache_info cache_info_
 
perf::Statistics statistics_
 
SmallHashDynamic< uint64_t,
ObjectHeader * > 
transactions_
 
SmallHashDynamic< uint64_t,
Listing * > 
listings_
 
lru::LruCache< ComparableHash,
ObjectHeader * > * 
objects_all_
 
lru::LruCache< ComparableHash,
ObjectHeader * > * 
objects_volatile_
 
map< std::string,
cvmcache_breadcrumb
breadcrumbs_
 
MallocHeapstorage_
 
bool in_danger_zone_
 

Static Private Attributes

static const uint64_t kMinSize = 100 * 1024 * 1024
 
static const double kShrinkFactor = 0.75
 
static const double kObjectExpandFactor = 1.5
 
static const double kSlotFraction = 0.04
 
static const double kDangerZoneThreshold = 0.7
 
static PluginRamCacheinstance_ = NULL
 

Additional Inherited Members

- Public Types inherited from Callbackable< MallocHeap::BlockPtr >
typedef CallbackBase
< MallocHeap::BlockPtr
CallbackTN
 

Detailed Description

Implements all the cache plugin callbacks. Singelton.

Definition at line 158 of file cvmfs_cache_ram.cc.

Constructor & Destructor Documentation

PluginRamCache::~PluginRamCache ( )
inline

Definition at line 178 of file cvmfs_cache_ram.cc.

PluginRamCache::PluginRamCache ( uint64_t  mem_size)
inlineexplicitprivate

Definition at line 479 of file cvmfs_cache_ram.cc.

Here is the call graph for this function:

Member Function Documentation

void PluginRamCache::CheckHighPinWatermark ( )
inlineprivate

Definition at line 599 of file cvmfs_cache_ram.cc.

Here is the call graph for this function:

static PluginRamCache* PluginRamCache::Create ( const string &  mem_size_str)
inlinestatic

Definition at line 160 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void PluginRamCache::DoShrink ( uint64_t  shrink_to)
inlineprivate

Definition at line 560 of file cvmfs_cache_ram.cc.

Here is the call graph for this function:

void PluginRamCache::DropBreadcrumbs ( )
inline

Definition at line 185 of file cvmfs_cache_ram.cc.

Referenced by DropBreadcrumbs().

Here is the caller graph for this function:

static PluginRamCache* PluginRamCache::GetInstance ( )
inlinestatic

Definition at line 173 of file cvmfs_cache_ram.cc.

Referenced by DropBreadcrumbs().

Here is the call graph for this function:

Here is the caller graph for this function:

bool PluginRamCache::IsInDangerZone ( )
inlineprivate

Definition at line 608 of file cvmfs_cache_ram.cc.

static PluginRamCache* PluginRamCache::Me ( )
inlinestaticprivate

Definition at line 476 of file cvmfs_cache_ram.cc.

void PluginRamCache::OnBlockMove ( const MallocHeap::BlockPtr ptr)
inlineprivate

Definition at line 541 of file cvmfs_cache_ram.cc.

Referenced by PluginRamCache().

Here is the call graph for this function:

Here is the caller graph for this function:

static int PluginRamCache::ram_abort_txn ( uint64_t  txn_id)
inlinestatic

Definition at line 363 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int PluginRamCache::ram_breadcrumb_load ( const char *  fqrn,
cvmcache_breadcrumb breadcrumb 
)
inlinestatic

Definition at line 456 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the caller graph for this function:

static int PluginRamCache::ram_breadcrumb_store ( const char *  fqrn,
const cvmcache_breadcrumb breadcrumb 
)
inlinestatic

Definition at line 447 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the caller graph for this function:

static int PluginRamCache::ram_chrefcnt ( struct cvmcache_hash id,
int32_t  change_by 
)
inlinestatic

Definition at line 189 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the caller graph for this function:

static int PluginRamCache::ram_commit_txn ( uint64_t  txn_id)
inlinestatic

Definition at line 324 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int PluginRamCache::ram_info ( struct cvmcache_info info)
inlinestatic

Definition at line 373 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the caller graph for this function:

static int PluginRamCache::ram_listing_begin ( uint64_t  lst_id,
enum cvmcache_object_type  type 
)
inlinestatic

Definition at line 390 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int PluginRamCache::ram_listing_end ( int64_t  listing_id)
inlinestatic

Definition at line 435 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int PluginRamCache::ram_listing_next ( int64_t  listing_id,
struct cvmcache_object_info item 
)
inlinestatic

Definition at line 420 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int PluginRamCache::ram_obj_info ( struct cvmcache_hash id,
struct cvmcache_object_info info 
)
inlinestatic

Definition at line 216 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int PluginRamCache::ram_pread ( struct cvmcache_hash id,
uint64_t  offset,
uint32_t *  size,
unsigned char *  buffer 
)
inlinestatic

Definition at line 235 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int PluginRamCache::ram_shrink ( uint64_t  shrink_to,
uint64_t *  used 
)
inlinestatic

Definition at line 379 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the caller graph for this function:

static int PluginRamCache::ram_start_txn ( struct cvmcache_hash id,
uint64_t  txn_id,
struct cvmcache_object_info info 
)
inlinestatic

Definition at line 254 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int PluginRamCache::ram_write_txn ( uint64_t  txn_id,
unsigned char *  buffer,
uint32_t  size 
)
inlinestatic

Definition at line 286 of file cvmfs_cache_ram.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

bool PluginRamCache::TryFreeSpace ( uint64_t  bytes_required)
inlineprivate

Returns true if memory compaction took place and pointers might have been invalidated.

Definition at line 522 of file cvmfs_cache_ram.cc.

Member Data Documentation

map<std::string, cvmcache_breadcrumb> PluginRamCache::breadcrumbs_
private

Definition at line 621 of file cvmfs_cache_ram.cc.

struct cvmcache_info PluginRamCache::cache_info_
private

Definition at line 615 of file cvmfs_cache_ram.cc.

bool PluginRamCache::in_danger_zone_
private

Definition at line 623 of file cvmfs_cache_ram.cc.

PluginRamCache * PluginRamCache::instance_ = NULL
staticprivate

Definition at line 475 of file cvmfs_cache_ram.cc.

const double PluginRamCache::kDangerZoneThreshold = 0.7
staticprivate

Definition at line 473 of file cvmfs_cache_ram.cc.

const uint64_t PluginRamCache::kMinSize = 100 * 1024 * 1024
staticprivate

Definition at line 469 of file cvmfs_cache_ram.cc.

const double PluginRamCache::kObjectExpandFactor = 1.5
staticprivate

Definition at line 471 of file cvmfs_cache_ram.cc.

const double PluginRamCache::kShrinkFactor = 0.75
staticprivate

Definition at line 470 of file cvmfs_cache_ram.cc.

const double PluginRamCache::kSlotFraction = 0.04
staticprivate

Definition at line 472 of file cvmfs_cache_ram.cc.

SmallHashDynamic<uint64_t, Listing *> PluginRamCache::listings_
private

Definition at line 618 of file cvmfs_cache_ram.cc.

lru::LruCache<ComparableHash, ObjectHeader *>* PluginRamCache::objects_all_
private

Definition at line 619 of file cvmfs_cache_ram.cc.

lru::LruCache<ComparableHash, ObjectHeader *>* PluginRamCache::objects_volatile_
private

Definition at line 620 of file cvmfs_cache_ram.cc.

perf::Statistics PluginRamCache::statistics_
private

Definition at line 616 of file cvmfs_cache_ram.cc.

MallocHeap* PluginRamCache::storage_
private

Definition at line 622 of file cvmfs_cache_ram.cc.

SmallHashDynamic<uint64_t, ObjectHeader *> PluginRamCache::transactions_
private

Definition at line 617 of file cvmfs_cache_ram.cc.


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