CernVM-FS  2.11.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
catalog::ClientCatalogManager Class Reference

#include <catalog_mgr_client.h>

Inheritance diagram for catalog::ClientCatalogManager:
Collaboration diagram for catalog::ClientCatalogManager:

Public Member Functions

 ClientCatalogManager (MountPoint *mountpoint)
 
virtual ~ClientCatalogManager ()
 
bool InitFixed (const shash::Any &root_hash, bool alternative_path)
 
shash::Any GetRootHash ()
 
bool IsRevisionBlacklisted ()
 
bool offline_mode () const
 
uint64_t all_inodes () const
 
uint64_t loaded_inodes () const
 
std::string repo_name () const
 
manifest::Manifestmanifest () const
 
int root_fd () const
 
- Public Member Functions inherited from catalog::AbstractCatalogManager< Catalog >
 AbstractCatalogManager (perf::Statistics *statistics)
 
virtual ~AbstractCatalogManager ()
 
void SetInodeAnnotation (InodeAnnotation *new_annotation)
 
virtual bool Init ()
 
LoadError Remount (const bool dry_run)
 
LoadError ChangeRoot (const shash::Any &root_hash)
 
void DetachNested ()
 
bool LookupPath (const PathString &path, const LookupOptions options, DirectoryEntry *entry)
 
bool LookupPath (const std::string &path, const LookupOptions options, DirectoryEntry *entry)
 
bool LookupXattrs (const PathString &path, XattrList *xattrs)
 
bool LookupNested (const PathString &path, PathString *mountpoint, shash::Any *hash, uint64_t *size)
 
bool ListCatalogSkein (const PathString &path, std::vector< PathString > *result_list)
 
bool Listing (const PathString &path, DirectoryEntryList *listing, const bool expand_symlink)
 
bool Listing (const PathString &path, DirectoryEntryList *listing)
 
bool Listing (const std::string &path, DirectoryEntryList *listing)
 
bool ListingStat (const PathString &path, StatEntryList *listing)
 
bool ListFileChunks (const PathString &path, const shash::Algorithms interpret_hashes_as, FileChunkList *chunks)
 
void SetOwnerMaps (const OwnerMap &uid_map, const OwnerMap &gid_map)
 
void SetCatalogWatermark (unsigned limit)
 
shash::Any GetNestedCatalogHash (const PathString &mountpoint)
 
Statistics statistics () const
 
uint64_t inode_gauge ()
 
bool volatile_flag () const
 
uint64_t GetRevision () const
 
uint64_t GetTTL () const
 
bool HasExplicitTTL () const
 
bool GetVOMSAuthz (std::string *authz) const
 
int GetNumCatalogs () const
 
std::string PrintHierarchy () const
 
std::string PrintAllMemStatistics () const
 
inode_t GetRootInode () const
 
CatalogGetRootCatalog () const
 
inode_t MangleInode (const inode_t inode) const
 
catalog::Counters LookupCounters (const PathString &path, std::string *subcatalog_path, shash::Any *hash)
 

Protected Member Functions

LoadError LoadCatalog (const PathString &mountpoint, const shash::Any &hash, std::string *catalog_path, shash::Any *catalog_hash)
 
void UnloadCatalog (const catalog::Catalog *catalog)
 
catalog::CatalogCreateCatalog (const PathString &mountpoint, const shash::Any &catalog_hash, catalog::Catalog *parent_catalog)
 
void ActivateCatalog (catalog::Catalog *catalog)
 
- Protected Member Functions inherited from catalog::AbstractCatalogManager< Catalog >
const std::vector< Catalog * > & GetCatalogs () const
 
CatalogMountCatalog (const PathString &mountpoint, const shash::Any &hash, Catalog *parent_catalog)
 
bool MountSubtree (const PathString &path, const Catalog *entry_point, bool can_listing, Catalog **leaf_catalog)
 
CatalogLoadFreeCatalog (const PathString &mountpoint, const shash::Any &hash)
 
bool AttachCatalog (const std::string &db_path, Catalog *new_catalog)
 
void DetachCatalog (Catalog *catalog)
 
void DetachSubtree (Catalog *catalog)
 
void DetachSiblings (const PathString &current_tree)
 
void DetachAll ()
 
bool IsAttached (const PathString &root_path, Catalog **attached_catalog) const
 
CatalogFindCatalog (const PathString &path) const
 
void ReadLock () const
 
void WriteLock () const
 
void Unlock () const
 
virtual void EnforceSqliteMemLimit ()
 
- Protected Member Functions inherited from SingleCopy
 SingleCopy ()
 

Private Member Functions

LoadError LoadCatalogCas (const shash::Any &hash, const std::string &name, const std::string &alt_catalog_path, std::string *catalog_path)
 

Private Attributes

std::map< PathString, shash::Anyloaded_catalogs_
 
std::map< PathString, shash::Anymounted_catalogs_
 
UniquePtr< manifest::Manifestmanifest_
 
std::string repo_name_
 
cvmfs::Fetcherfetcher_
 
signature::SignatureManagersignature_mgr_
 
std::string workspace_
 
bool offline_mode_
 
uint64_t all_inodes_
 
uint64_t loaded_inodes_
 
bool fixed_alt_root_catalog_
 
BackoffThrottle backoff_throttle_
 
perf::Countern_certificate_hits_
 
perf::Countern_certificate_misses_
 
int root_fd_
 

Friends

class CachedManifestEnsemble
 

Additional Inherited Members

- Public Types inherited from catalog::AbstractCatalogManager< Catalog >
typedef std::vector< Catalog * > CatalogList
 
typedef Catalog catalog_t
 
- Static Public Attributes inherited from catalog::AbstractCatalogManager< Catalog >
static const inode_t kInodeOffset
 

Detailed Description

A catalog manager that uses a Fetcher to get file catalgs in the form of (virtual) file descriptors from a cache manager. Sqlite has a path based interface. This catalog manager returns <FILE DESCRIPTOR> as a path and thus requires a sqlite vfs that supports this syntax, such as the cvmfs default vfs for clients.

This class uses the Fetcher in order to get access to the download manager and the cache manager, too. It requires a download manager and a signature manager as it calls manifest::Fetch in order to get the manifest of new and updated root catalogs. It requires the cache manager to get access to the Unpin() method of the corresponding quota manager; loaded catalogs need to be unpinned when the class is destructed.

Definition at line 49 of file catalog_mgr_client.h.

Constructor & Destructor Documentation

catalog::ClientCatalogManager::ClientCatalogManager ( MountPoint mountpoint)
explicit

Definition at line 38 of file catalog_mgr_client.cc.

Here is the call graph for this function:

catalog::ClientCatalogManager::~ClientCatalogManager ( )
virtual

Definition at line 58 of file catalog_mgr_client.cc.

Here is the call graph for this function:

Member Function Documentation

void catalog::ClientCatalogManager::ActivateCatalog ( catalog::Catalog catalog)
protectedvirtual

Triggered when the catalog is attached (db file opened)

Reimplemented from catalog::AbstractCatalogManager< Catalog >.

Definition at line 29 of file catalog_mgr_client.cc.

Here is the call graph for this function:

uint64_t catalog::ClientCatalogManager::all_inodes ( ) const
inline

Definition at line 64 of file catalog_mgr_client.h.

Referenced by cvmfs::cvmfs_statfs().

Here is the caller graph for this function:

Catalog * catalog::ClientCatalogManager::CreateCatalog ( const PathString mountpoint,
const shash::Any catalog_hash,
catalog::Catalog parent_catalog 
)
protectedvirtual

Create a new Catalog object. Every derived class has to implement this and return a newly created (derived) Catalog structure of it's desired type.

Parameters
mountpointthe future mountpoint of the catalog to create
catalog_hashthe content hash of the catalog database
parent_catalogthe parent of the catalog to create
Returns
a newly created (derived) Catalog

Implements catalog::AbstractCatalogManager< Catalog >.

Definition at line 69 of file catalog_mgr_client.cc.

shash::Any catalog::ClientCatalogManager::GetRootHash ( )

Definition at line 80 of file catalog_mgr_client.cc.

Referenced by RootHashMagicXattr::PrepareValueFenced().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::ClientCatalogManager::InitFixed ( const shash::Any root_hash,
bool  alternative_path 
)

Specialized initialization that uses a fixed root hash.

Definition at line 91 of file catalog_mgr_client.cc.

Referenced by MountPoint::CreateCatalogManager().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::ClientCatalogManager::IsRevisionBlacklisted ( )

Checks if the current repository revision is blacklisted. The format of the blacklist lines is '<REPO N' where REPO is the repository name, N is the revision number, and the two parts are separated by whitespace. Any revision of REPO less than N is blacklisted. Note: no extra characters are allowed after N, not even whitespace.

Returns
true if it is blacklisted, false otherwise

Definition at line 304 of file catalog_mgr_client.cc.

Referenced by MountPoint::CreateCatalogManager().

Here is the call graph for this function:

Here is the caller graph for this function:

LoadError catalog::ClientCatalogManager::LoadCatalog ( const PathString mountpoint,
const shash::Any hash,
std::string *  catalog_path,
shash::Any catalog_hash 
)
protectedvirtual

Load the catalog and return a file name and the catalog hash. Derived class can decide if it wants to use the hash or the path. Both the input as well as the output hash can be 0.

Implements catalog::AbstractCatalogManager< Catalog >.

Definition at line 110 of file catalog_mgr_client.cc.

Here is the call graph for this function:

LoadError catalog::ClientCatalogManager::LoadCatalogCas ( const shash::Any hash,
const std::string &  name,
const std::string &  alt_catalog_path,
std::string *  catalog_path 
)
private

Definition at line 255 of file catalog_mgr_client.cc.

Referenced by LoadCatalog().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t catalog::ClientCatalogManager::loaded_inodes ( ) const
inline

Definition at line 65 of file catalog_mgr_client.h.

Referenced by cvmfs::cvmfs_statfs().

Here is the caller graph for this function:

manifest::Manifest* catalog::ClientCatalogManager::manifest ( ) const
inline

Definition at line 67 of file catalog_mgr_client.h.

Referenced by RepoMetainfoMagicXattr::PrepareValueFenced().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::ClientCatalogManager::offline_mode ( ) const
inline

Definition at line 63 of file catalog_mgr_client.h.

Referenced by FuseRemounter::Spawn().

Here is the caller graph for this function:

std::string catalog::ClientCatalogManager::repo_name ( ) const
inline

Definition at line 66 of file catalog_mgr_client.h.

Referenced by catalog::CachedManifestEnsemble::FetchCertificate().

Here is the caller graph for this function:

int catalog::ClientCatalogManager::root_fd ( ) const
inline

Definition at line 68 of file catalog_mgr_client.h.

Referenced by RestoreState().

Here is the caller graph for this function:

void catalog::ClientCatalogManager::UnloadCatalog ( const catalog::Catalog catalog)
protectedvirtual

Reimplemented from catalog::AbstractCatalogManager< Catalog >.

Definition at line 282 of file catalog_mgr_client.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class CachedManifestEnsemble
friend

Definition at line 51 of file catalog_mgr_client.h.

Member Data Documentation

uint64_t catalog::ClientCatalogManager::all_inodes_
private

Definition at line 100 of file catalog_mgr_client.h.

Referenced by all_inodes().

BackoffThrottle catalog::ClientCatalogManager::backoff_throttle_
private

Definition at line 103 of file catalog_mgr_client.h.

cvmfs::Fetcher* catalog::ClientCatalogManager::fetcher_
private
bool catalog::ClientCatalogManager::fixed_alt_root_catalog_
private

fixed root hash but alternative url

Definition at line 102 of file catalog_mgr_client.h.

Referenced by InitFixed(), and LoadCatalog().

std::map<PathString, shash::Any> catalog::ClientCatalogManager::loaded_catalogs_
private

Required for unpinning

Definition at line 90 of file catalog_mgr_client.h.

Referenced by CreateCatalog(), and LoadCatalog().

uint64_t catalog::ClientCatalogManager::loaded_inodes_
private

Definition at line 101 of file catalog_mgr_client.h.

Referenced by loaded_inodes(), and UnloadCatalog().

UniquePtr<manifest::Manifest> catalog::ClientCatalogManager::manifest_
private

Definition at line 93 of file catalog_mgr_client.h.

Referenced by LoadCatalog(), and manifest().

std::map<PathString, shash::Any> catalog::ClientCatalogManager::mounted_catalogs_
private
perf::Counter* catalog::ClientCatalogManager::n_certificate_hits_
private
perf::Counter* catalog::ClientCatalogManager::n_certificate_misses_
private
bool catalog::ClientCatalogManager::offline_mode_
private

cached copy used because there is no network

Definition at line 99 of file catalog_mgr_client.h.

Referenced by LoadCatalog(), and offline_mode().

std::string catalog::ClientCatalogManager::repo_name_
private

Definition at line 95 of file catalog_mgr_client.h.

Referenced by IsRevisionBlacklisted(), LoadCatalog(), and repo_name().

int catalog::ClientCatalogManager::root_fd_
private

File descriptor of first loaded catalog; used for mapping the root catalog file descriptor when restoring the cache manager after a fuse module reload

Definition at line 111 of file catalog_mgr_client.h.

Referenced by LoadCatalogCas(), and root_fd().

signature::SignatureManager* catalog::ClientCatalogManager::signature_mgr_
private

Definition at line 97 of file catalog_mgr_client.h.

Referenced by IsRevisionBlacklisted(), and LoadCatalog().

std::string catalog::ClientCatalogManager::workspace_
private

Definition at line 98 of file catalog_mgr_client.h.


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