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

#include <lru_md.h>

Inheritance diagram for lru::PathCache:
Collaboration diagram for lru::PathCache:

Public Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from lru::LruCache< fuse_ino_t, PathString >
static double GetEntrySize ()
 
- Protected Attributes inherited from lru::LruCache< fuse_ino_t, PathString >
Counters counters_
 

Detailed Description

Definition at line 76 of file lru_md.h.

Constructor & Destructor Documentation

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

Definition at line 78 of file lru_md.h.

Member Function Documentation

void lru::PathCache::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< fuse_ino_t, PathString >.

Definition at line 102 of file lru_md.h.

Referenced by TalkManager::MainResponder(), and FuseRemounter::TryFinish().

Here is the call graph for this function:

Here is the caller graph for this function:

bool lru::PathCache::Insert ( const fuse_ino_t &  key,
const PathString 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< fuse_ino_t, PathString >.

Definition at line 84 of file lru_md.h.

Referenced by cvmfs::GetPathForInode().

Here is the call graph for this function:

Here is the caller graph for this function:

bool lru::PathCache::Lookup ( const fuse_ino_t &  key,
PathString 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< fuse_ino_t, PathString >.

Definition at line 92 of file lru_md.h.

Referenced by cvmfs::GetPathForInode().

Here is the call graph for this function:

Here is the caller graph for this function:


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