CernVM-FS
2.12.0
|
#include <cache_stream.h>
Classes | |
struct | Counters |
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, size_t buffer_size, perf::Statistics *statistics) | |
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) |
const Counters & | counters () const |
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) |
Static Public Attributes | |
static const size_t | kDefaultBufferSize = 64 * 1024 * 1024 |
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 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_ |
UniquePtr< RingBuffer > | buffer_ |
SmallHashDynamic< shash::Any, RingBuffer::ObjectHandle_t > | buffered_objects_ |
pthread_mutex_t * | lock_buffer_ |
UniquePtr< Counters > | counters_ |
Additional Inherited Members | |
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 31 of file cache_stream.h.
StreamingCacheManager::StreamingCacheManager | ( | unsigned | max_open_fds, |
CacheManager * | cache_mgr, | ||
download::DownloadManager * | regular_download_mgr, | ||
download::DownloadManager * | external_download_mgr, | ||
size_t | buffer_size, | ||
perf::Statistics * | statistics | ||
) |
|
virtual |
Definition at line 261 of file cache_stream.cc.
|
inlinevirtual |
Implements CacheManager.
Definition at line 92 of file cache_stream.h.
|
virtual |
Implements CacheManager.
Definition at line 273 of file cache_stream.cc.
|
virtual |
Implements CacheManager.
Definition at line 340 of file cache_stream.cc.
|
inlinevirtual |
Implements CacheManager.
Definition at line 93 of file cache_stream.h.
|
inline |
Definition at line 113 of file cache_stream.h.
|
inlinevirtual |
Implements CacheManager.
Definition at line 83 of file cache_stream.h.
|
virtual |
Return a human readable description of the cache instance. Used in cvmfs_talk.
Implements CacheManager.
Definition at line 269 of file cache_stream.cc.
|
protectedvirtual |
Reimplemented from CacheManager.
Definition at line 436 of file cache_stream.cc.
|
protectedvirtual |
Reimplemented from CacheManager.
Definition at line 413 of file cache_stream.cc.
|
protectedvirtual |
Reimplemented from CacheManager.
Definition at line 406 of file cache_stream.cc.
|
virtual |
Implements CacheManager.
Definition at line 321 of file cache_stream.cc.
|
virtual |
Implements CacheManager.
Definition at line 305 of file cache_stream.cc.
|
inlinevirtual |
Implements CacheManager.
Definition at line 65 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 97 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 280 of file cache_stream.cc.
|
virtual |
Implements CacheManager.
Definition at line 397 of file cache_stream.cc.
int StreamingCacheManager::PlantFd | ( | int | fd_in_cache_mgr | ) |
Definition at line 300 of file cache_stream.cc.
Referenced by RestoreState().
|
virtual |
Implements CacheManager.
Definition at line 356 of file cache_stream.cc.
|
virtual |
Implements CacheManager.
Definition at line 381 of file cache_stream.cc.
|
inlinevirtual |
Implements CacheManager.
Definition at line 90 of file cache_stream.h.
|
private |
Depending on info.flags, selects either the regular or the external download manager
Definition at line 132 of file cache_stream.cc.
Referenced by Stream().
|
inline |
Definition at line 61 of file cache_stream.h.
Referenced by MountPoint::Create().
|
inline |
Definition at line 58 of file cache_stream.h.
Referenced by MountPoint::Create().
|
inlinevirtual |
Implements CacheManager.
Definition at line 79 of file cache_stream.h.
|
inlinevirtual |
Implements CacheManager.
Definition at line 95 of file cache_stream.h.
|
inlinevirtual |
Implements CacheManager.
Definition at line 80 of file cache_stream.h.
|
inlinevirtual |
Reimplemented from CacheManager.
Definition at line 100 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 141 of file cache_stream.cc.
Referenced by GetSize(), and Pread().
|
inlinevirtual |
Implements CacheManager.
Definition at line 86 of file cache_stream.h.
|
private |
A small in-memory cache to avoid frequent re-downloads if multiple blocks from the same chunk are read
Definition at line 168 of file cache_stream.h.
Referenced by Stream(), and StreamingCacheManager().
|
private |
Definition at line 169 of file cache_stream.h.
Referenced by Stream(), and StreamingCacheManager().
|
private |
Definition at line 159 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().
Definition at line 172 of file cache_stream.h.
Referenced by counters(), and Stream().
|
private |
Definition at line 161 of file cache_stream.h.
Referenced by SelectDownloadManager(), and SetExternalDownloadManager().
Definition at line 164 of file cache_stream.h.
Referenced by Close(), DoRestoreState(), DoSaveState(), Dup(), GetSize(), MoveOutBackingCacheMgr(), Open(), OpenFromTxn(), PlantFd(), Pread(), and Readahead().
|
static |
Definition at line 33 of file cache_stream.h.
Referenced by RestoreState(), and FileSystem::TriageCacheMgr().
|
private |
Definition at line 170 of file cache_stream.h.
Referenced by Stream(), StreamingCacheManager(), and ~StreamingCacheManager().
|
private |
Definition at line 163 of file cache_stream.h.
Referenced by Close(), Dup(), GetSize(), Open(), OpenFromTxn(), PlantFd(), Pread(), Readahead(), StreamingCacheManager(), and ~StreamingCacheManager().
|
private |
Definition at line 160 of file cache_stream.h.
Referenced by SelectDownloadManager(), and SetRegularDownloadManager().