CernVM-FS  2.12.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 LabeledObject &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 Label &label, 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 ChecksumFd (int fd, shash::Any *id)
 
int OpenPinned (const LabeledObject &object)
 
bool Open2Mem (const LabeledObject &object, unsigned char **buffer, uint64_t *size)
 
bool CommitFromMem (const LabeledObject &object, const unsigned char *buffer, const uint64_t size)
 
QuotaManagerquota_mgr ()
 
void * SaveState (const int fd_progress)
 
int RestoreState (const int fd_progress, void *state)
 
void FreeState (const int fd_progress, void *state)
 
CacheManagerIds PeekState (void *state)
 

Static Public Member Functions

static CacheManagerCreate (CacheManager *upper_cache, CacheManager *lower_cache)
 

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

- Static Public Attributes inherited from CacheManager
static const uint64_t kSizeUnknown = uint64_t(-1)
 
static const int kLabelCatalog = 0x01
 
static const int kLabelPinned = 0x02
 
static const int kLabelVolatile = 0x04
 
static const int kLabelExternal = 0x08
 
static const int kLabelChunked = 0x10
 
static const int kLabelCertificate = 0x20
 
static const int kLabelMetainfo = 0x40
 
static const int kLabelHistory = 0x80
 
- 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 219 of file cache_tiered.cc.

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

Definition at line 82 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 169 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 182 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 Label label,
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 195 of file cache_tiered.cc.

Here is the call graph for this function:

int TieredCacheManager::Open ( const LabeledObject 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 59 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 156 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 213 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 204 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 147 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 73 of file cache_tiered.h.

Referenced by Open().

bool TieredCacheManager::lower_readonly_
private

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