CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lru::Md5PathCache Class Reference

#include <lru_md.h>

Inheritance diagram for lru::Md5PathCache:
Collaboration diagram for lru::Md5PathCache:

Public Member Functions

 Md5PathCache (unsigned int cache_size, perf::Statistics *statistics)
 
bool Insert (const shash::Md5 &hash, const catalog::DirectoryEntry &dirent)
 
bool InsertNegative (const shash::Md5 &hash)
 
bool Lookup (const shash::Md5 &hash, catalog::DirectoryEntry *dirent, bool update_lru=true)
 
bool Forget (const shash::Md5 &hash)
 
void Drop ()
 
- Public Member Functions inherited from lru::LruCache< shash::Md5, catalog::DirectoryEntry >
 LruCache (const unsigned cache_size, const shash::Md5 &empty_key, uint32_t(*hasher)(const shash::Md5 &key), perf::StatisticsTemplate statistics)
 
virtual ~LruCache ()
 
virtual void Update (const shash::Md5 &key)
 
virtual bool UpdateValue (const shash::Md5 &key, const catalog::DirectoryEntry &value)
 
void Pause ()
 
void Resume ()
 
bool IsFull () const
 
bool IsEmpty () const
 
Counters counters ()
 
virtual void FilterBegin ()
 
virtual void FilterGet (shash::Md5 *key, catalog::DirectoryEntry *value)
 
virtual bool FilterNext ()
 
virtual void FilterDelete ()
 
virtual void FilterEnd ()
 

Private Attributes

catalog::DirectoryEntry dirent_negative_
 

Additional Inherited Members

- Static Public Member Functions inherited from lru::LruCache< shash::Md5, catalog::DirectoryEntry >
static double GetEntrySize ()
 
- Protected Attributes inherited from lru::LruCache< shash::Md5, catalog::DirectoryEntry >
Counters counters_
 

Detailed Description

Definition at line 109 of file lru_md.h.

Constructor & Destructor Documentation

lru::Md5PathCache::Md5PathCache ( unsigned int  cache_size,
perf::Statistics statistics 
)
inlineexplicit

Definition at line 113 of file lru_md.h.

Member Function Documentation

void lru::Md5PathCache::Drop ( )
inlinevirtual

Clears all elements from the cache. All memory of internal data structures will be freed but data of cache entries may stay in use, we do not call delete on any user data.

Reimplemented from lru::LruCache< shash::Md5, catalog::DirectoryEntry >.

Definition at line 152 of file lru_md.h.

Referenced by FuseRemounter::TryFinish().

Here is the call graph for this function:

Here is the caller graph for this function:

bool lru::Md5PathCache::Forget ( const shash::Md5 key)
inlinevirtual

Forgets about a specific cache entry

Parameters
keythe key to delete from the cache
Returns
true if key was deleted, false if key was not in the cache

Reimplemented from lru::LruCache< shash::Md5, catalog::DirectoryEntry >.

Definition at line 146 of file lru_md.h.

Here is the call graph for this function:

bool lru::Md5PathCache::Insert ( const shash::Md5 key,
const catalog::DirectoryEntry value 
)
inlinevirtual

Insert a new key-value pair to the list. If the cache is already full, the least recently used object is removed; afterwards the new object is inserted. If the object is already present it is updated and moved back to the end of the list

Parameters
keythe key where the value is saved
valuethe value of the cache entry
Returns
true on insert, false on update

Reimplemented from lru::LruCache< shash::Md5, catalog::DirectoryEntry >.

Definition at line 121 of file lru_md.h.

Referenced by LibContext::GetDirentForPath(), cvmfs::GetDirentForPath(), and InsertNegative().

Here is the call graph for this function:

Here is the caller graph for this function:

bool lru::Md5PathCache::InsertNegative ( const shash::Md5 hash)
inline

Definition at line 129 of file lru_md.h.

Referenced by LibContext::GetDirentForPath(), and cvmfs::GetDirentForPath().

Here is the call graph for this function:

Here is the caller graph for this function:

bool lru::Md5PathCache::Lookup ( const shash::Md5 key,
catalog::DirectoryEntry value,
bool  update_lru = true 
)
inlinevirtual

Retrieve an element from the cache. If the element was found, it will be marked as 'recently used' and returned

Parameters
keythe key to perform a lookup on
value(out) here the result is saved (not touch in case of miss)
Returns
true on successful lookup, false if key was not found

Reimplemented from lru::LruCache< shash::Md5, catalog::DirectoryEntry >.

Definition at line 136 of file lru_md.h.

Referenced by LibContext::GetDirentForPath(), and cvmfs::GetDirentForPath().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

catalog::DirectoryEntry lru::Md5PathCache::dirent_negative_
private

Definition at line 158 of file lru_md.h.

Referenced by InsertNegative(), and Md5PathCache().


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