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

#include <cache_stream.h>

Inheritance diagram for StreamingCacheManager:
Collaboration diagram for StreamingCacheManager:

Classes

struct  FdInfo
 
struct  SavedState
 

Public Member Functions

 StreamingCacheManager (unsigned max_open_fds, CacheManager *cache_mgr, download::DownloadManager *regular_download_mgr, download::DownloadManager *external_download_mgr)
 
virtual ~StreamingCacheManager ()
 
void SetRegularDownloadManager (download::DownloadManager *download_mgr)
 
void SetExternalDownloadManager (download::DownloadManager *download_mgr)
 
virtual CacheManagerIds id ()
 
virtual std::string Describe ()
 
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)
 
CacheManagerMoveOutBackingCacheMgr (int *root_fd)
 
int PlantFd (int fd_in_cache_mgr)
 
- 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)
 

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

download::DownloadManagerSelectDownloadManager (const FdInfo &info)
 
int64_t Stream (const FdInfo &info, void *buf, uint64_t size, uint64_t offset)
 

Private Attributes

UniquePtr< CacheManagercache_mgr_
 
download::DownloadManagerregular_download_mgr_
 
download::DownloadManagerexternal_download_mgr_
 
pthread_mutex_t * lock_fd_table_
 
FdTable< FdInfofd_table_
 

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

Cache manager that streams regular files using a download manager and stores file catalogs in an underlying cache manager.

Definition at line 25 of file cache_stream.h.

Constructor & Destructor Documentation

StreamingCacheManager::StreamingCacheManager ( unsigned  max_open_fds,
CacheManager cache_mgr,
download::DownloadManager regular_download_mgr,
download::DownloadManager external_download_mgr 
)

Definition at line 128 of file cache_stream.cc.

Here is the call graph for this function:

StreamingCacheManager::~StreamingCacheManager ( )
virtual

Definition at line 147 of file cache_stream.cc.

Member Function Documentation

virtual int StreamingCacheManager::AbortTxn ( void *  txn)
inlinevirtual

Implements CacheManager.

Definition at line 70 of file cache_stream.h.

bool StreamingCacheManager::AcquireQuotaManager ( QuotaManager quota_mgr)
virtual

Implements CacheManager.

Definition at line 157 of file cache_stream.cc.

int StreamingCacheManager::Close ( int  fd)
virtual

Implements CacheManager.

Definition at line 224 of file cache_stream.cc.

Here is the call graph for this function:

virtual int StreamingCacheManager::CommitTxn ( void *  txn)
inlinevirtual

Implements CacheManager.

Definition at line 71 of file cache_stream.h.

virtual void StreamingCacheManager::CtrlTxn ( const Label label,
const int  flags,
void *  txn 
)
inlinevirtual

Implements CacheManager.

Definition at line 61 of file cache_stream.h.

std::string StreamingCacheManager::Describe ( )
virtual

Return a human readable description of the cache instance. Used in cvmfs_talk.

Implements CacheManager.

Definition at line 153 of file cache_stream.cc.

bool StreamingCacheManager::DoFreeState ( void *  data)
protectedvirtual

Reimplemented from CacheManager.

Definition at line 318 of file cache_stream.cc.

int StreamingCacheManager::DoRestoreState ( void *  data)
protectedvirtual

Reimplemented from CacheManager.

Definition at line 295 of file cache_stream.cc.

Here is the call graph for this function:

void * StreamingCacheManager::DoSaveState ( )
protectedvirtual

Reimplemented from CacheManager.

Definition at line 288 of file cache_stream.cc.

int StreamingCacheManager::Dup ( int  fd)
virtual

Implements CacheManager.

Definition at line 205 of file cache_stream.cc.

Here is the call graph for this function:

int64_t StreamingCacheManager::GetSize ( int  fd)
virtual

Implements CacheManager.

Definition at line 189 of file cache_stream.cc.

Here is the call graph for this function:

virtual CacheManagerIds StreamingCacheManager::id ( )
inlinevirtual

Implements CacheManager.

Definition at line 43 of file cache_stream.h.

virtual manifest::Breadcrumb StreamingCacheManager::LoadBreadcrumb ( const std::string &  )
inlinevirtual

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 75 of file cache_stream.h.

CacheManager * StreamingCacheManager::MoveOutBackingCacheMgr ( int *  root_fd)

Definition at line 326 of file cache_stream.cc.

Here is the call graph for this function:

int StreamingCacheManager::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 164 of file cache_stream.cc.

int StreamingCacheManager::OpenFromTxn ( void *  txn)
virtual

Implements CacheManager.

Definition at line 279 of file cache_stream.cc.

int StreamingCacheManager::PlantFd ( int  fd_in_cache_mgr)

Definition at line 184 of file cache_stream.cc.

Referenced by RestoreState().

Here is the caller graph for this function:

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

Implements CacheManager.

Definition at line 240 of file cache_stream.cc.

Here is the call graph for this function:

int StreamingCacheManager::Readahead ( int  fd)
virtual

Implements CacheManager.

Definition at line 263 of file cache_stream.cc.

Here is the call graph for this function:

virtual int StreamingCacheManager::Reset ( void *  txn)
inlinevirtual

Implements CacheManager.

Definition at line 68 of file cache_stream.h.

download::DownloadManager * StreamingCacheManager::SelectDownloadManager ( const FdInfo info)
private

Depending on info.flags, selects either the regular or the external download manager

Definition at line 90 of file cache_stream.cc.

Referenced by Stream().

Here is the call graph for this function:

Here is the caller graph for this function:

void StreamingCacheManager::SetExternalDownloadManager ( download::DownloadManager download_mgr)
inline

Definition at line 39 of file cache_stream.h.

Referenced by MountPoint::Create().

Here is the caller graph for this function:

void StreamingCacheManager::SetRegularDownloadManager ( download::DownloadManager download_mgr)
inline

Definition at line 36 of file cache_stream.h.

Referenced by MountPoint::Create().

Here is the caller graph for this function:

virtual uint32_t StreamingCacheManager::SizeOfTxn ( )
inlinevirtual

Implements CacheManager.

Definition at line 57 of file cache_stream.h.

virtual void StreamingCacheManager::Spawn ( )
inlinevirtual

Implements CacheManager.

Definition at line 73 of file cache_stream.h.

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

Implements CacheManager.

Definition at line 58 of file cache_stream.h.

virtual bool StreamingCacheManager::StoreBreadcrumb ( const manifest::Manifest manifest)
inlinevirtual

Reimplemented from CacheManager.

Definition at line 78 of file cache_stream.h.

int64_t StreamingCacheManager::Stream ( const FdInfo info,
void *  buf,
uint64_t  size,
uint64_t  offset 
)
private

Streams an object using the download manager. The complete object is read and its size is returned (-errno on error). The given section of the object is copied into the provided buffer, which may be NULL if only the size of the object is relevant.

Definition at line 98 of file cache_stream.cc.

Referenced by GetSize(), and Pread().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements CacheManager.

Definition at line 64 of file cache_stream.h.

Member Data Documentation

download::DownloadManager* StreamingCacheManager::external_download_mgr_
private

Definition at line 137 of file cache_stream.h.

Referenced by SelectDownloadManager(), and SetExternalDownloadManager().

FdTable<FdInfo> StreamingCacheManager::fd_table_
private
pthread_mutex_t* StreamingCacheManager::lock_fd_table_
private
download::DownloadManager* StreamingCacheManager::regular_download_mgr_
private

Definition at line 136 of file cache_stream.h.

Referenced by SelectDownloadManager(), and SetRegularDownloadManager().


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