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

#include <cache_tiered.h>

Inheritance diagram for TieredCacheManager:
Collaboration diagram for TieredCacheManager:

Classes

struct  SavedState
 

Public Member Functions

virtual CacheManagerIds id ()
 
virtual std::string Describe ()
 
void SetLowerReadOnly ()
 
virtual ~TieredCacheManager ()
 
virtual bool AcquireQuotaManager (QuotaManager *quota_mgr)
 
virtual int Open (const BlessedObject &object)
 
virtual int64_t GetSize (int fd)
 
virtual int Close (int fd)
 
virtual int64_t Pread (int fd, void *buf, uint64_t size, uint64_t offset)
 
virtual int Dup (int fd)
 
virtual int Readahead (int fd)
 
virtual uint32_t SizeOfTxn ()
 
virtual int StartTxn (const shash::Any &id, uint64_t size, void *txn)
 
virtual void CtrlTxn (const ObjectInfo &object_info, const int flags, void *txn)
 
virtual int64_t Write (const void *buf, uint64_t size, void *txn)
 
virtual int Reset (void *txn)
 
virtual int OpenFromTxn (void *txn)
 
virtual int AbortTxn (void *txn)
 
virtual int CommitTxn (void *txn)
 
virtual void Spawn ()
 
virtual manifest::Breadcrumb LoadBreadcrumb (const std::string &fqrn)
 
virtual bool StoreBreadcrumb (const manifest::Manifest &manifest)
 
- Public Member Functions inherited from CacheManager
virtual ~CacheManager ()
 
int OpenPinned (const shash::Any &id, const std::string &description, bool is_catalog)
 
int ChecksumFd (int fd, shash::Any *id)
 
bool Open2Mem (const shash::Any &id, const std::string &description, unsigned char **buffer, uint64_t *size)
 
bool CommitFromMem (const shash::Any &id, const unsigned char *buffer, const uint64_t size, const std::string &description)
 
QuotaManagerquota_mgr ()
 
void * SaveState (const int fd_progress)
 
int RestoreState (const int fd_progress, void *state)
 
void FreeState (const int fd_progress, void *state)
 

Static Public Member Functions

static CacheManagerCreate (CacheManager *upper_cache, CacheManager *lower_cache)
 
- Static Public Member Functions inherited from CacheManager
static BlessedObject Bless (const shash::Any &id)
 
static BlessedObject Bless (const shash::Any &id, const ObjectInfo &info)
 
static BlessedObject Bless (const shash::Any &id, ObjectType type)
 
static BlessedObject Bless (const shash::Any &id, const std::string &description)
 
static BlessedObject Bless (const shash::Any &id, ObjectType type, const std::string &description)
 

Protected Member Functions

virtual void * DoSaveState ()
 
virtual int DoRestoreState (void *data)
 
virtual bool DoFreeState (void *data)
 
- Protected Member Functions inherited from CacheManager
 CacheManager ()
 

Private Member Functions

 FRIEND_TEST (T_MountPoint, TieredCacheMgr)
 
 FRIEND_TEST (T_MountPoint, TieredComplex)
 
 TieredCacheManager (CacheManager *upper_cache, CacheManager *lower_cache)
 

Private Attributes

CacheManagerupper_
 
CacheManagerlower_
 
bool lower_readonly_
 

Static Private Attributes

static const unsigned kCopyBufferSize = 64 * 1024
 

Additional Inherited Members

- Public Types inherited from CacheManager
enum  ObjectType { kTypeRegular = 0, kTypeCatalog, kTypePinned, kTypeVolatile }
 
- Static Public Attributes inherited from CacheManager
static const uint64_t kSizeUnknown = uint64_t(-1)
 
- Protected Attributes inherited from CacheManager
QuotaManagerquota_mgr_
 

Detailed Description

This file is part of the CernVM File System.

This provides a framework for a cache with an upper and a lower branch. Cache manager implementation that provides a hierarchical cache. Given an "upper" and "lower" cache manager object:

  • Reads are done first from the upper cache
  • On upper cache miss, then this tries the lower cache. If there's a lower cache hit, then the file is written to the upper cache.
  • Writes are done to both caches simultaneously.

The quota manager is only applied to the upper cache.

Definition at line 26 of file cache_tiered.h.

Constructor & Destructor Documentation

TieredCacheManager::~TieredCacheManager ( )
virtual

Definition at line 222 of file cache_tiered.cc.

TieredCacheManager::TieredCacheManager ( CacheManager upper_cache,
CacheManager lower_cache 
)
inlineprivate

Definition at line 84 of file cache_tiered.h.

Referenced by Create().

Here is the caller graph for this function:

Member Function Documentation

int TieredCacheManager::AbortTxn ( void *  txn)
virtual

Implements CacheManager.

Definition at line 172 of file cache_tiered.cc.

Here is the call graph for this function:

virtual bool TieredCacheManager::AcquireQuotaManager ( QuotaManager quota_mgr)
inlinevirtual

Implements CacheManager.

Definition at line 39 of file cache_tiered.h.

Here is the call graph for this function:

virtual int TieredCacheManager::Close ( int  fd)
inlinevirtual

Implements CacheManager.

Definition at line 47 of file cache_tiered.h.

Here is the call graph for this function:

int TieredCacheManager::CommitTxn ( void *  txn)
virtual

Implements CacheManager.

Definition at line 185 of file cache_tiered.cc.

Here is the call graph for this function:

CacheManager * TieredCacheManager::Create ( CacheManager upper_cache,
CacheManager lower_cache 
)
static

Definition at line 124 of file cache_tiered.cc.

Referenced by FileSystem::SetupTieredCacheMgr().

Here is the call graph for this function:

Here is the caller graph for this function:

void TieredCacheManager::CtrlTxn ( const ObjectInfo object_info,
const int  flags,
void *  txn 
)
virtual

Implements CacheManager.

Definition at line 137 of file cache_tiered.cc.

Here is the call graph for this function:

std::string TieredCacheManager::Describe ( )
virtual

This file is part of the CernVM File System.

Implements CacheManager.

Definition at line 17 of file cache_tiered.cc.

Here is the call graph for this function:

bool TieredCacheManager::DoFreeState ( void *  data)
protectedvirtual

Reimplemented from CacheManager.

Definition at line 24 of file cache_tiered.cc.

Here is the call graph for this function:

int TieredCacheManager::DoRestoreState ( void *  data)
protectedvirtual

Reimplemented from CacheManager.

Definition at line 33 of file cache_tiered.cc.

Here is the call graph for this function:

void * TieredCacheManager::DoSaveState ( )
protectedvirtual

Reimplemented from CacheManager.

Definition at line 43 of file cache_tiered.cc.

Here is the call graph for this function:

virtual int TieredCacheManager::Dup ( int  fd)
inlinevirtual

Implements CacheManager.

Definition at line 50 of file cache_tiered.h.

Here is the call graph for this function:

TieredCacheManager::FRIEND_TEST ( T_MountPoint  ,
TieredCacheMgr   
)
private
TieredCacheManager::FRIEND_TEST ( T_MountPoint  ,
TieredComplex   
)
private
virtual int64_t TieredCacheManager::GetSize ( int  fd)
inlinevirtual

Implements CacheManager.

Definition at line 46 of file cache_tiered.h.

Here is the call graph for this function:

virtual CacheManagerIds TieredCacheManager::id ( )
inlinevirtual

Implements CacheManager.

Definition at line 31 of file cache_tiered.h.

manifest::Breadcrumb TieredCacheManager::LoadBreadcrumb ( const std::string &  )
virtual

While not strictly necessary, cache managers often have a directory associated with them. This directory is currently used to find the cached manifest copy, the cvmfschecksum.$reponame file. This is important to make pre-loaded alien caches work, even in a tiered setup.

Reimplemented from CacheManager.

Definition at line 198 of file cache_tiered.cc.

Here is the call graph for this function:

int TieredCacheManager::Open ( const BlessedObject object)
virtual

Opening an object might get it from a third-party source, e.g. when the tiered cache manager issues a copy-up operation. In this case it is beneficial to register the object with the accurate meta-data, in the same way it is done during transactions.

Implements CacheManager.

Definition at line 51 of file cache_tiered.cc.

Here is the call graph for this function:

virtual int TieredCacheManager::OpenFromTxn ( void *  txn)
inlinevirtual

Implements CacheManager.

Definition at line 61 of file cache_tiered.h.

Here is the call graph for this function:

virtual int64_t TieredCacheManager::Pread ( int  fd,
void *  buf,
uint64_t  size,
uint64_t  offset 
)
inlinevirtual

Implements CacheManager.

Definition at line 48 of file cache_tiered.h.

Here is the call graph for this function:

virtual int TieredCacheManager::Readahead ( int  fd)
inlinevirtual

Implements CacheManager.

Definition at line 51 of file cache_tiered.h.

Here is the call graph for this function:

int TieredCacheManager::Reset ( void *  txn)
virtual

Implements CacheManager.

Definition at line 159 of file cache_tiered.cc.

Here is the call graph for this function:

void TieredCacheManager::SetLowerReadOnly ( )
inline

Definition at line 36 of file cache_tiered.h.

virtual uint32_t TieredCacheManager::SizeOfTxn ( )
inlinevirtual

Implements CacheManager.

Definition at line 53 of file cache_tiered.h.

Here is the call graph for this function:

void TieredCacheManager::Spawn ( )
virtual

Implements CacheManager.

Definition at line 216 of file cache_tiered.cc.

Here is the call graph for this function:

int TieredCacheManager::StartTxn ( const shash::Any id,
uint64_t  size,
void *  txn 
)
virtual

Implements CacheManager.

Definition at line 108 of file cache_tiered.cc.

Here is the call graph for this function:

bool TieredCacheManager::StoreBreadcrumb ( const manifest::Manifest manifest)
virtual

Reimplemented from CacheManager.

Definition at line 207 of file cache_tiered.cc.

Here is the call graph for this function:

int64_t TieredCacheManager::Write ( const void *  buf,
uint64_t  size,
void *  txn 
)
virtual

Implements CacheManager.

Definition at line 150 of file cache_tiered.cc.

Here is the call graph for this function:

Member Data Documentation

const unsigned TieredCacheManager::kCopyBufferSize = 64 * 1024
staticprivate

Definition at line 75 of file cache_tiered.h.

Referenced by Open().

bool TieredCacheManager::lower_readonly_
private

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