CernVM-FS
2.12.0
|
#include <fetch.h>
Classes | |
struct | ThreadLocalStorage |
Public Member Functions | |
Fetcher (CacheManager *cache_mgr, download::DownloadManager *download_mgr, BackoffThrottle *backoff_throttle, perf::StatisticsTemplate statistics) | |
~Fetcher () | |
int | Fetch (const CacheManager::LabeledObject &object, const std::string &alt_url="") |
void | ReplaceCacheManager (CacheManager *new_cache_mgr) |
CacheManager * | cache_mgr () |
download::DownloadManager * | download_mgr () |
Private Types | |
typedef std::map< shash::Any, std::vector< int > * > | ThreadQueues |
Private Member Functions | |
FRIEND_TEST (T_Fetcher, GetTls) | |
FRIEND_TEST (T_Fetcher, SignalWaitingThreads) | |
ThreadLocalStorage * | GetTls () |
void | CleanupTls (ThreadLocalStorage *tls) |
void | SignalWaitingThreads (const int fd, const shash::Any &id, ThreadLocalStorage *tls) |
int | OpenSelect (const CacheManager::LabeledObject &object) |
Private Member Functions inherited from SingleCopy | |
SingleCopy () | |
Private Attributes | |
pthread_key_t | thread_local_storage_ |
ThreadQueues | queues_download_ |
pthread_mutex_t * | lock_queues_download_ |
std::vector< ThreadLocalStorage * > | tls_blocks_ |
pthread_mutex_t * | lock_tls_blocks_ |
CacheManager * | cache_mgr_ |
download::DownloadManager * | download_mgr_ |
BackoffThrottle * | backoff_throttle_ |
perf::Counter * | n_downloads |
perf::Counter * | n_invocations |
Friends | |
void * | TestGetTls (void *data) |
void * | TestFetchCollapse (void *data) |
void * | TestFetchCollapse2 (void *data) |
void | TLSDestructor (void *data) |
The Fetcher uses a cache manager and a download manager in order to provide a (virtual) file descriptor to a requested object, which is valid in the context of the cache manager. If the object is not in the cache, it is downloaded and stored in the cache.
Concurrent download requests for the same id are collapsed.
|
private |
cvmfs::Fetcher::Fetcher | ( | CacheManager * | cache_mgr, |
download::DownloadManager * | download_mgr, | ||
BackoffThrottle * | backoff_throttle, | ||
perf::StatisticsTemplate | statistics | ||
) |
cvmfs::Fetcher::~Fetcher | ( | ) |
|
inline |
Definition at line 127 of file fetch.h.
Referenced by catalog::ClientCatalogManager::GetNewRootCatalogContext(), catalog::ClientCatalogManager::LoadCatalogByHash(), catalog::ClientCatalogManager::StageNestedCatalogByHash(), catalog::ClientCatalogManager::UnloadCatalog(), and catalog::ClientCatalogManager::~ClientCatalogManager().
|
private |
Called when a thread exists, releases a ThreadLocalStorage object and removes the pointer to it from tls_blocks_.
Definition at line 51 of file fetch.cc.
Referenced by cvmfs::TLSDestructor(), and ~Fetcher().
|
inline |
Definition at line 128 of file fetch.h.
Referenced by catalog::ClientCatalogManager::GetNewRootCatalogContext().
int cvmfs::Fetcher::Fetch | ( | const CacheManager::LabeledObject & | object, |
const std::string & | alt_url = "" |
||
) |
Definition at line 81 of file fetch.cc.
Referenced by cvmfs::cvmfs_open(), cvmfs::cvmfs_read(), catalog::ClientCatalogManager::FetchCatalogByHash(), MountPoint::FetchHistory(), RepoMetainfoMagicXattr::FinalizeValue(), LibContext::Open(), cvmfs::Pin(), LibContext::Pread(), and catalog::ClientCatalogManager::StageNestedCatalogByHash().
|
private |
|
private |
|
private |
|
private |
|
inline |
Definition at line 124 of file fetch.h.
Referenced by RestoreState().
|
private |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
|
private |
Definition at line 193 of file fetch.h.
Referenced by cache_mgr(), OpenSelect(), ReplaceCacheManager(), and SignalWaitingThreads().
|
private |
Definition at line 194 of file fetch.h.
Referenced by download_mgr().
|
private |
Definition at line 184 of file fetch.h.
Referenced by Fetcher(), SignalWaitingThreads(), and ~Fetcher().
|
private |
Definition at line 191 of file fetch.h.
Referenced by Fetcher(), cvmfs::TLSDestructor(), and ~Fetcher().
|
private |
|
private |
|
private |
Definition at line 183 of file fetch.h.
Referenced by SignalWaitingThreads().
|
private |
Key to the thread's ThreadLocalStorage memory
Definition at line 181 of file fetch.h.
Referenced by Fetcher(), and ~Fetcher().
|
private |
All the threads register their thread local storage here, so that it can be cleaned up properly in the destructor of Fetcher.
Definition at line 190 of file fetch.h.
Referenced by cvmfs::TLSDestructor(), and ~Fetcher().