CernVM-FS
2.12.0
|
#include <cache_stream.h>
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) |
CacheManager * | MoveOutBackingCacheMgr (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) |
QuotaManager * | quota_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::DownloadManager * | SelectDownloadManager (const FdInfo &info) |
int64_t | Stream (const FdInfo &info, void *buf, uint64_t size, uint64_t offset) |
Private Attributes | |
UniquePtr< CacheManager > | cache_mgr_ |
download::DownloadManager * | regular_download_mgr_ |
download::DownloadManager * | external_download_mgr_ |
pthread_mutex_t * | lock_fd_table_ |
FdTable< FdInfo > | fd_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 | |
QuotaManager * | quota_mgr_ |
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.
StreamingCacheManager::StreamingCacheManager | ( | unsigned | max_open_fds, |
CacheManager * | cache_mgr, | ||
download::DownloadManager * | regular_download_mgr, | ||
download::DownloadManager * | external_download_mgr | ||
) |
|
virtual |
Definition at line 147 of file cache_stream.cc.
|
inlinevirtual |
Implements CacheManager.
Definition at line 70 of file cache_stream.h.
|
virtual |
Implements CacheManager.
Definition at line 157 of file cache_stream.cc.
|
virtual |
Implements CacheManager.
Definition at line 224 of file cache_stream.cc.
|
inlinevirtual |
Implements CacheManager.
Definition at line 71 of file cache_stream.h.
|
inlinevirtual |
Implements CacheManager.
Definition at line 61 of file cache_stream.h.
|
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.
|
protectedvirtual |
Reimplemented from CacheManager.
Definition at line 318 of file cache_stream.cc.
|
protectedvirtual |
Reimplemented from CacheManager.
Definition at line 295 of file cache_stream.cc.
|
protectedvirtual |
Reimplemented from CacheManager.
Definition at line 288 of file cache_stream.cc.
|
virtual |
Implements CacheManager.
Definition at line 205 of file cache_stream.cc.
|
virtual |
Implements CacheManager.
Definition at line 189 of file cache_stream.cc.
|
inlinevirtual |
Implements CacheManager.
Definition at line 43 of file cache_stream.h.
|
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 | ) |
|
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.
|
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().
|
virtual |
Implements CacheManager.
Definition at line 240 of file cache_stream.cc.
|
virtual |
Implements CacheManager.
Definition at line 263 of file cache_stream.cc.
|
inlinevirtual |
Implements CacheManager.
Definition at line 68 of file cache_stream.h.
|
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().
|
inline |
Definition at line 39 of file cache_stream.h.
Referenced by MountPoint::Create().
|
inline |
Definition at line 36 of file cache_stream.h.
Referenced by MountPoint::Create().
|
inlinevirtual |
Implements CacheManager.
Definition at line 57 of file cache_stream.h.
|
inlinevirtual |
Implements CacheManager.
Definition at line 73 of file cache_stream.h.
|
inlinevirtual |
Implements CacheManager.
Definition at line 58 of file cache_stream.h.
|
inlinevirtual |
Reimplemented from CacheManager.
Definition at line 78 of file cache_stream.h.
|
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().
|
inlinevirtual |
Implements CacheManager.
Definition at line 64 of file cache_stream.h.
|
private |
Definition at line 135 of file cache_stream.h.
Referenced by AbortTxn(), AcquireQuotaManager(), Close(), CommitTxn(), CtrlTxn(), Describe(), DoFreeState(), DoRestoreState(), DoSaveState(), Dup(), GetSize(), LoadBreadcrumb(), MoveOutBackingCacheMgr(), Open(), OpenFromTxn(), Pread(), Readahead(), Reset(), SizeOfTxn(), Spawn(), StartTxn(), StoreBreadcrumb(), StreamingCacheManager(), and Write().
|
private |
Definition at line 137 of file cache_stream.h.
Referenced by SelectDownloadManager(), and SetExternalDownloadManager().
Definition at line 140 of file cache_stream.h.
Referenced by Close(), DoRestoreState(), DoSaveState(), Dup(), GetSize(), MoveOutBackingCacheMgr(), Open(), OpenFromTxn(), PlantFd(), Pread(), and Readahead().
|
private |
Definition at line 139 of file cache_stream.h.
Referenced by Close(), Dup(), GetSize(), Open(), OpenFromTxn(), PlantFd(), Pread(), Readahead(), StreamingCacheManager(), and ~StreamingCacheManager().
|
private |
Definition at line 136 of file cache_stream.h.
Referenced by SelectDownloadManager(), and SetRegularDownloadManager().