CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
catalog::AbstractCatalogManager< CatalogT > Class Template Referenceabstract

#include <catalog.h>

Inheritance diagram for catalog::AbstractCatalogManager< CatalogT >:
Collaboration diagram for catalog::AbstractCatalogManager< CatalogT >:

Public Types

typedef std::vector< CatalogT * > CatalogList
 
typedef CatalogT catalog_t
 

Public Member Functions

 AbstractCatalogManager (perf::Statistics *statistics)
 
virtual ~AbstractCatalogManager ()
 
void SetInodeAnnotation (InodeAnnotation *new_annotation)
 
virtual bool Init ()
 
LoadReturn RemountDryrun ()
 
LoadReturn Remount ()
 
LoadReturn 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 GetTimestamp () 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
 
CatalogT * GetRootCatalog () const
 
inode_t MangleInode (const inode_t inode) const
 
catalog::Counters LookupCounters (const PathString &path, std::string *subcatalog_path, shash::Any *hash)
 

Static Public Attributes

static const inode_t kInodeOffset = 255
 

Protected Member Functions

virtual LoadReturn GetNewRootCatalogContext (CatalogContext *result)=0
 
virtual LoadReturn LoadCatalogByHash (CatalogContext *ctlg_context)=0
 
virtual void UnloadCatalog (const CatalogT *catalog)
 
virtual void ActivateCatalog (CatalogT *catalog)
 
const std::vector< CatalogT * > & GetCatalogs () const
 
virtual void StageNestedCatalogByHash (const shash::Any &, const PathString &)
 
void StageNestedCatalogAndUnlock (const PathString &path, const CatalogT *parent, bool is_listable)
 
virtual CatalogT * CreateCatalog (const PathString &mountpoint, const shash::Any &catalog_hash, CatalogT *parent_catalog)=0
 
CatalogT * MountCatalog (const PathString &mountpoint, const shash::Any &hash, CatalogT *parent_catalog)
 
bool MountSubtree (const PathString &path, const CatalogT *entry_point, bool can_listing, CatalogT **leaf_catalog)
 
CatalogT * LoadFreeCatalog (const PathString &mountpoint, const shash::Any &hash)
 
bool AttachCatalog (const std::string &db_path, CatalogT *new_catalog)
 
void DetachCatalog (CatalogT *catalog)
 
void DetachSubtree (CatalogT *catalog)
 
void DetachSiblings (const PathString &current_tree)
 
void DetachAll ()
 
bool IsAttached (const PathString &root_path, CatalogT **attached_catalog) const
 
CatalogT * FindCatalog (const PathString &path) const
 
uint64_t GetRevisionNoLock () const
 
uint64_t GetTimestampNoLock () const
 
void ReadLock () const
 
void WriteLock () const
 
void Unlock () const
 
virtual void EnforceSqliteMemLimit ()
 
- Protected Member Functions inherited from SingleCopy
 SingleCopy ()
 

Private Member Functions

void CheckInodeWatermark ()
 
std::string PrintHierarchyRecursively (const CatalogT *catalog, const int level) const
 
std::string PrintMemStatsRecursively (const CatalogT *catalog) const
 
InodeRange AcquireInodes (uint64_t size)
 
void ReleaseInodes (const InodeRange chunk)
 

Private Attributes

CatalogList catalogs_
 
int inode_watermark_status_
 
uint64_t inode_gauge_
 
uint64_t revision_cache_
 
uint64_t timestamp_cache_
 
unsigned catalog_watermark_
 
bool volatile_flag_
 
bool has_authz_cache_
 
std::string authz_cache_
 
uint64_t incarnation_
 
InodeAnnotationinode_annotation_
 
pthread_rwlock_t * rwlock_
 
Statistics statistics_
 
pthread_key_t pkey_sqlitemem_
 
OwnerMap uid_map_
 
OwnerMap gid_map_
 

Detailed Description

template<class CatalogT>
class catalog::AbstractCatalogManager< CatalogT >

This class provides the read-only interface to a tree of catalogs representing a (subtree of a) repository. Mostly lookup functions filling DirectoryEntry objects. Reloading of expired catalogs, attaching of nested catalogs and delegating of lookups to the appropriate catalog is done transparently.

The loading / creating of catalogs is up to derived classes.

CatalogT is either Catalog or MockCatalog.

Usage: DerivedCatalogManager *catalog_manager = new DerivedCatalogManager(); catalog_manager->Init(); catalog_manager->Lookup(<inode>, &<result_entry>);

Definition at line 34 of file catalog.h.

Member Typedef Documentation

template<class CatalogT>
typedef CatalogT catalog::AbstractCatalogManager< CatalogT >::catalog_t

Definition at line 238 of file catalog_mgr.h.

template<class CatalogT>
typedef std::vector<CatalogT*> catalog::AbstractCatalogManager< CatalogT >::CatalogList

Definition at line 237 of file catalog_mgr.h.

Constructor & Destructor Documentation

template<class CatalogT >
catalog::AbstractCatalogManager< CatalogT >::AbstractCatalogManager ( perf::Statistics statistics)
explicit

Definition at line 28 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT >
catalog::AbstractCatalogManager< CatalogT >::~AbstractCatalogManager ( )
virtual

Definition at line 49 of file catalog_mgr_impl.h.

Member Function Documentation

template<class CatalogT >
InodeRange catalog::AbstractCatalogManager< CatalogT >::AcquireInodes ( uint64_t  size)
private

Assigns the next free numbers in the 64 bit space

Definition at line 773 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT>
virtual void catalog::AbstractCatalogManager< CatalogT >::ActivateCatalog ( CatalogT *  catalog)
inlineprotectedvirtual

Reimplemented in catalog::WritableCatalogManager, and catalog::ClientCatalogManager.

Definition at line 342 of file catalog_mgr.h.

template<class CatalogT>
bool catalog::AbstractCatalogManager< CatalogT >::AttachCatalog ( const std::string &  db_path,
CatalogT *  new_catalog 
)
protected

Attaches a newly created catalog.

Parameters
db_paththe file on a local file system containing the database
new_catalogthe catalog to attach to this CatalogManager
Returns
true on success, false otherwise

Definition at line 1038 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT >
LoadReturn catalog::AbstractCatalogManager< CatalogT >::ChangeRoot ( const shash::Any root_hash)

Remounts to the given hash

Definition at line 167 of file catalog_mgr_impl.h.

Referenced by FuseRemounter::TryFinish().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT >
void catalog::AbstractCatalogManager< CatalogT >::CheckInodeWatermark ( )
private

Definition at line 78 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT>
virtual CatalogT* catalog::AbstractCatalogManager< CatalogT >::CreateCatalog ( const PathString mountpoint,
const shash::Any catalog_hash,
CatalogT *  parent_catalog 
)
protectedpure virtual

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

Implemented in catalog::WritableCatalogManager, catalog::ClientCatalogManager, and catalog::SimpleCatalogManager.

template<class CatalogT>
void catalog::AbstractCatalogManager< CatalogT >::DetachAll ( )
inlineprotected

Definition at line 391 of file catalog_mgr.h.

template<class CatalogT>
void catalog::AbstractCatalogManager< CatalogT >::DetachCatalog ( CatalogT *  catalog)
protected

Removes a catalog from this CatalogManager, the catalog pointer is freed if the call succeeds. This method can create dangling children if a catalog in the middle of a tree is removed.

Parameters
catalogthe catalog to detach
Returns
true on success, false otherwise

Definition at line 1091 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT >
void catalog::AbstractCatalogManager< CatalogT >::DetachNested ( )

Detaches everything except the root catalog

Definition at line 209 of file catalog_mgr_impl.h.

Referenced by TalkManager::MainResponder(), and quota::MainUnpinListener().

Here is the caller graph for this function:

template<class CatalogT >
void catalog::AbstractCatalogManager< CatalogT >::DetachSiblings ( const PathString current_tree)
protected

Detaches all nested catalogs that are not on a prefix of the given tree. Used when the catalog_watermark_ is surpassed.

Definition at line 1140 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT>
void catalog::AbstractCatalogManager< CatalogT >::DetachSubtree ( CatalogT *  catalog)
protected

Removes a catalog (and all of it's children) from this CatalogManager. The given catalog and all children are freed, if this call succeeds.

Parameters
catalogthe catalog to detach
Returns
true on success, false otherwise

Definition at line 1120 of file catalog_mgr_impl.h.

Referenced by catalog::AbstractCatalogManager< Catalog >::DetachAll().

Here is the caller graph for this function:

template<class CatalogT >
void catalog::AbstractCatalogManager< CatalogT >::EnforceSqliteMemLimit ( )
protectedvirtual

Reimplemented in catalog::WritableCatalogManager.

Definition at line 1221 of file catalog_mgr_impl.h.

template<class CatalogT >
CatalogT * catalog::AbstractCatalogManager< CatalogT >::FindCatalog ( const PathString path) const
protected

Find the catalog leaf in the tree that fits the path. The path might be served by a not yet loaded nested catalog.

Parameters
paththe path a catalog is searched for
Returns
the catalog which is best fitting at the given path

Definition at line 804 of file catalog_mgr_impl.h.

Referenced by catalog::WritableCatalogManager::FindCatalog().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT>
const std::vector<CatalogT*>& catalog::AbstractCatalogManager< CatalogT >::GetCatalogs ( ) const
inlineprotected

Definition at line 343 of file catalog_mgr.h.

Referenced by catalog::CatalogBalancer< CatalogMgrT >::Balance().

Here is the caller graph for this function:

template<class CatalogT >
shash::Any catalog::AbstractCatalogManager< CatalogT >::GetNestedCatalogHash ( const PathString mountpoint)

Returns the NULL hash if the nested catalog is not found.

Definition at line 233 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT>
virtual LoadReturn catalog::AbstractCatalogManager< CatalogT >::GetNewRootCatalogContext ( CatalogContext result)
protectedpure virtual

Load the catalog and return a file name and the catalog hash.

GetNewRootCatalogContext() populates CatalogContext object with the information needed to retrieve the most recent root catalog independent of its location. The CatalogContext object must be populated with at least hash and mountpoint to call LoadCatalogByHash().

See class description of CatalogContext for more information.

Implemented in catalog::ClientCatalogManager, and catalog::SimpleCatalogManager.

template<class CatalogT >
int catalog::AbstractCatalogManager< CatalogT >::GetNumCatalogs ( ) const

Definition at line 749 of file catalog_mgr_impl.h.

Referenced by NClgMagicXattr::PrepareValueFenced().

Here is the caller graph for this function:

template<class CatalogT >
uint64_t catalog::AbstractCatalogManager< CatalogT >::GetRevision ( ) const
template<class CatalogT >
uint64_t catalog::AbstractCatalogManager< CatalogT >::GetRevisionNoLock ( ) const
protected

Like GetRevision() only without any locking mechanism. As such should only be used in conditions where a lock was already taken and calling GetRevision() would otherwise result in a deadlock.

Definition at line 696 of file catalog_mgr_impl.h.

template<class CatalogT>
CatalogT* catalog::AbstractCatalogManager< CatalogT >::GetRootCatalog ( ) const
inline

Definition at line 312 of file catalog_mgr.h.

Referenced by catalog::AbstractCatalogManager< Catalog >::DetachAll(), and RepoCountersMagicXattr::PrepareValueFenced().

Here is the caller graph for this function:

template<class CatalogT>
inode_t catalog::AbstractCatalogManager< CatalogT >::GetRootInode ( ) const
inline

Get the inode number of the root DirectoryEntry ('root' means the root of the whole file system)

Returns
the root inode number

Definition at line 308 of file catalog_mgr.h.

Referenced by cvmfs::cvmfs_lookup(), cvmfs::cvmfs_opendir(), cvmfs::GetDirentForInode(), cvmfs::GetPathForInode(), LibContext::ListDirectory(), catalog::AbstractCatalogManager< Catalog >::MangleInode(), and cvmfs::MayBeInPageCacheTracker().

Here is the caller graph for this function:

template<class CatalogT >
uint64_t catalog::AbstractCatalogManager< CatalogT >::GetTimestamp ( ) const

Definition at line 701 of file catalog_mgr_impl.h.

template<class CatalogT >
uint64_t catalog::AbstractCatalogManager< CatalogT >::GetTimestampNoLock ( ) const
protected

Like GetTimestamp() only without any locking mechanism. As such should only be used in conditions where a lock was already taken and calling GetTimestamp() would otherwise result in a deadlock.

Definition at line 715 of file catalog_mgr_impl.h.

template<class CatalogT >
uint64_t catalog::AbstractCatalogManager< CatalogT >::GetTTL ( ) const

Definition at line 740 of file catalog_mgr_impl.h.

Referenced by MountPoint::GetEffectiveTtlSec().

Here is the caller graph for this function:

template<class CatalogT >
bool catalog::AbstractCatalogManager< CatalogT >::GetVOMSAuthz ( std::string *  authz) const

Definition at line 720 of file catalog_mgr_impl.h.

Referenced by MountPoint::ReEvaluateAuthz().

Here is the caller graph for this function:

template<class CatalogT >
bool catalog::AbstractCatalogManager< CatalogT >::HasExplicitTTL ( ) const

Definition at line 731 of file catalog_mgr_impl.h.

template<class CatalogT >
bool catalog::AbstractCatalogManager< CatalogT >::Init ( )
virtual

Initializes the CatalogManager and loads and attaches the root entry.

Returns
true on successful init, otherwise false

Definition at line 99 of file catalog_mgr_impl.h.

Referenced by publish::ConstructSyncManagers(), MountPoint::CreateCatalogManager(), publish::GetSimpleCatalogManager(), swissknife::Ingest::Main(), swissknife::CommandApplyDirtab::Main(), and swissknife::CommandSync::Main().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT>
uint64_t catalog::AbstractCatalogManager< CatalogT >::inode_gauge ( )
inline

Definition at line 290 of file catalog_mgr.h.

Referenced by SaveState().

Here is the caller graph for this function:

template<class CatalogT>
bool catalog::AbstractCatalogManager< CatalogT >::IsAttached ( const PathString root_path,
CatalogT **  attached_catalog 
) const
protected

Checks if a searched catalog is already mounted to this CatalogManager

Parameters
root_paththe root path of the searched catalog
attached_catalogis set to the searched catalog, if not NULL
Returns
true if catalog is already present, false otherwise

Definition at line 829 of file catalog_mgr_impl.h.

template<class CatalogT >
bool catalog::AbstractCatalogManager< CatalogT >::ListCatalogSkein ( const PathString path,
std::vector< PathString > *  result_list 
)

Create a listing of the parents, catalog, and children of the catalog that serves the specified path. If the path specified is a catalog mountpoint the catalog at that point is mounted and returned.

Parameters
paththe path to find in the catalogs
result_listthe list where the results will be added.
Returns
true if the list could be created, false if catalog fails to mount.

Definition at line 434 of file catalog_mgr_impl.h.

Referenced by LibContext::ListNestedCatalogs().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT >
bool catalog::AbstractCatalogManager< CatalogT >::ListFileChunks ( const PathString path,
const shash::Algorithms  interpret_hashes_as,
FileChunkList chunks 
)

Collect file chunks (if exist)

Parameters
paththe path of the directory to list
interpret_hashes_ashash of the directory entry (by convention the same than the chunk hashes)
Returns
true if listing succeeded otherwise false

Definition at line 609 of file catalog_mgr_impl.h.

Referenced by cvmfs::cvmfs_open(), cvmfs::Evict(), LibContext::GetExtAttr(), LibContext::Open(), cvmfs::Pin(), ChunkListMagicXattr::PrepareValueFenced(), and ChunksMagicXattr::PrepareValueFenced().

Here is the caller graph for this function:

template<class CatalogT >
bool catalog::AbstractCatalogManager< CatalogT >::Listing ( const PathString path,
DirectoryEntryList listing,
const bool  expand_symlink 
)

Do a listing of the specified directory.

Parameters
paththe path of the directory to list
listingthe resulting DirectoryEntryList
Returns
true if listing succeeded otherwise false

Definition at line 533 of file catalog_mgr_impl.h.

Referenced by catalog::AbstractCatalogManager< Catalog >::Listing(), and catalog::VirtualCatalog::RemoveRecursively().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT>
bool catalog::AbstractCatalogManager< CatalogT >::Listing ( const PathString path,
DirectoryEntryList listing 
)
inline

Definition at line 271 of file catalog_mgr.h.

template<class CatalogT>
bool catalog::AbstractCatalogManager< CatalogT >::Listing ( const std::string &  path,
DirectoryEntryList listing 
)
inline

Definition at line 274 of file catalog_mgr.h.

template<class CatalogT >
bool catalog::AbstractCatalogManager< CatalogT >::ListingStat ( const PathString path,
StatEntryList listing 
)

Do a listing of the specified directory, return only struct stat values.

Parameters
paththe path of the directory to list
listingthe resulting StatEntryList
Returns
true if listing succeeded otherwise false

Definition at line 571 of file catalog_mgr_impl.h.

Referenced by cvmfs::cvmfs_opendir(), LibContext::ListDirectory(), and LibContext::ListDirectoryStat().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT>
virtual LoadReturn catalog::AbstractCatalogManager< CatalogT >::LoadCatalogByHash ( CatalogContext ctlg_context)
protectedpure virtual
template<class CatalogT >
CatalogT * catalog::AbstractCatalogManager< CatalogT >::LoadFreeCatalog ( const PathString mountpoint,
const shash::Any hash 
)
protected

Load a catalog file as a freestanding Catalog object. Loading of catalogs is implemented by derived classes.

Definition at line 1010 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT >
catalog::Counters catalog::AbstractCatalogManager< CatalogT >::LookupCounters ( const PathString path,
std::string *  subcatalog_path,
shash::Any hash 
)

Definition at line 640 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT >
bool catalog::AbstractCatalogManager< CatalogT >::LookupNested ( const PathString path,
PathString mountpoint,
shash::Any hash,
uint64_t *  size 
)

Perform a lookup for Nested Catalog that serves this path. If the path specified is a catalog mountpoint the catalog at that point is mounted and returned.

Parameters
paththe path to find in the catalogs
mountpointthe path to the nested catalog found
hashthe hash of the nested catalog found
sizethe size of the nested catalog, 0 for root. Root is not a nested catalog in the database.
Returns
true if lookup succeeded otherwise false (available catalog failed to mount)

Definition at line 370 of file catalog_mgr_impl.h.

Referenced by LibContext::GetNestedCatalogAttr().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT >
bool catalog::AbstractCatalogManager< CatalogT >::LookupPath ( const PathString path,
const LookupOptions  options,
DirectoryEntry dirent 
)

Perform a lookup for a specific DirectoryEntry in the catalogs.

Parameters
paththe path to find in the catalogs
optionswhether to perform another lookup to get the parent entry, too
direntthe resulting DirectoryEntry, or special Negative entry Note: can be set to zero if the result is not important
Returns
true if lookup succeeded otherwise false

Definition at line 260 of file catalog_mgr_impl.h.

Referenced by catalog::CatalogBalancer< CatalogMgrT >::AddCatalogMarker(), cvmfs::cvmfs_getxattr(), cvmfs::cvmfs_open(), catalog::VirtualCatalog::EnsurePresence(), swissknife::CommandApplyDirtab::FilterCandidatesFromGlobResult(), cvmfs::FixupOpenInode(), cvmfs::GetDirentForInode(), LibContext::GetDirentForPath(), cvmfs::GetDirentForPath(), catalog::AbstractCatalogManager< Catalog >::LookupPath(), and catalog::VirtualCatalog::Remove().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT>
bool catalog::AbstractCatalogManager< CatalogT >::LookupPath ( const std::string &  path,
const LookupOptions  options,
DirectoryEntry entry 
)
inline

Definition at line 253 of file catalog_mgr.h.

template<class CatalogT >
bool catalog::AbstractCatalogManager< CatalogT >::LookupXattrs ( const PathString path,
XattrList xattrs 
)

Definition at line 495 of file catalog_mgr_impl.h.

Referenced by cvmfs::cvmfs_getxattr(), cvmfs::cvmfs_listxattr(), and LibContext::GetExtAttr().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT>
inode_t catalog::AbstractCatalogManager< CatalogT >::MangleInode ( const inode_t  inode) const
inline

Inodes are ambiquitous under some circumstances, to prevent problems they must be passed through this method first

Parameters
inodethe raw inode
Returns
the revised inode

Definition at line 319 of file catalog_mgr.h.

Referenced by cvmfs::cvmfs_forget(), cvmfs::cvmfs_getattr(), cvmfs::cvmfs_getxattr(), cvmfs::cvmfs_listxattr(), cvmfs::cvmfs_lookup(), cvmfs::cvmfs_open(), cvmfs::cvmfs_opendir(), cvmfs::cvmfs_read(), cvmfs::cvmfs_readdir(), cvmfs::cvmfs_readlink(), cvmfs::cvmfs_release(), cvmfs::cvmfs_releasedir(), and cvmfs::cvmfs_statfs().

Here is the caller graph for this function:

template<class CatalogT>
CatalogT * catalog::AbstractCatalogManager< CatalogT >::MountCatalog ( const PathString mountpoint,
const shash::Any hash,
CatalogT *  parent_catalog 
)
protected

Load a catalog file and attach it to the tree of Catalog objects. Loading of catalogs is implemented by derived classes.

Definition at line 957 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT>
bool catalog::AbstractCatalogManager< CatalogT >::MountSubtree ( const PathString path,
const CatalogT *  entry_point,
bool  is_listable,
CatalogT **  leaf_catalog 
)
protected

Recursively mounts all nested catalogs required to serve a path. If leaf_catalog is NULL, just indicate if it is necessary to load a nested catalog for the given path. The final leaf nested catalog is returned. The is_listable parameter is relevant if path is a nested catalog. Only if is_listable is true, the nested catalog will be used; otherwise the parent with the transaction point is sufficient.

Definition at line 893 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT >
std::string catalog::AbstractCatalogManager< CatalogT >::PrintAllMemStatistics ( ) const

Statistics from all catalogs

Definition at line 1211 of file catalog_mgr_impl.h.

Referenced by TalkManager::MainResponder().

Here is the caller graph for this function:

template<class CatalogT >
string catalog::AbstractCatalogManager< CatalogT >::PrintHierarchy ( ) const

Gets a formatted tree of the currently attached catalogs

Definition at line 761 of file catalog_mgr_impl.h.

Referenced by TalkManager::MainResponder().

Here is the caller graph for this function:

template<class CatalogT>
string catalog::AbstractCatalogManager< CatalogT >::PrintHierarchyRecursively ( const CatalogT *  catalog,
const int  level 
) const
private

Formats the catalog hierarchy

Definition at line 1166 of file catalog_mgr_impl.h.

template<class CatalogT>
std::string catalog::AbstractCatalogManager< CatalogT >::PrintMemStatsRecursively ( const CatalogT *  catalog) const
private

Definition at line 1192 of file catalog_mgr_impl.h.

template<class CatalogT>
void catalog::AbstractCatalogManager< CatalogT >::ReadLock ( ) const
inlineprotected

Definition at line 399 of file catalog_mgr.h.

Referenced by catalog::AbstractCatalogManager< Catalog >::inode_gauge().

Here is the caller graph for this function:

template<class CatalogT >
void catalog::AbstractCatalogManager< CatalogT >::ReleaseInodes ( const InodeRange  chunk)
private

Called if a catalog is detached which renders the associated InodeChunk invalid.

Parameters
chunkthe InodeChunk to be freed

Definition at line 792 of file catalog_mgr_impl.h.

template<class CatalogT >
LoadReturn catalog::AbstractCatalogManager< CatalogT >::Remount ( )

Definition at line 127 of file catalog_mgr_impl.h.

Referenced by LibContext::Remount(), and FuseRemounter::TryFinish().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT >
LoadReturn catalog::AbstractCatalogManager< CatalogT >::RemountDryrun ( )

Remounts the root catalog if necessary. If a newer root catalog exists, it is mounted and replaces the currently mounted tree (all existing catalogs are detached)

Definition at line 119 of file catalog_mgr_impl.h.

Referenced by LibContext::Remount().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT >
void catalog::AbstractCatalogManager< CatalogT >::SetCatalogWatermark ( unsigned  limit)

Definition at line 73 of file catalog_mgr_impl.h.

Referenced by MountPoint::CreateCatalogManager().

Here is the caller graph for this function:

template<class CatalogT >
void catalog::AbstractCatalogManager< CatalogT >::SetInodeAnnotation ( InodeAnnotation new_annotation)

Definition at line 57 of file catalog_mgr_impl.h.

Referenced by MountPoint::SetupInodeAnnotation().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT >
void catalog::AbstractCatalogManager< CatalogT >::SetOwnerMaps ( const OwnerMap uid_map,
const OwnerMap gid_map 
)

Definition at line 65 of file catalog_mgr_impl.h.

Referenced by MountPoint::SetupOwnerMaps().

Here is the caller graph for this function:

template<class CatalogT>
void catalog::AbstractCatalogManager< CatalogT >::StageNestedCatalogAndUnlock ( const PathString path,
const CatalogT *  parent,
bool  is_listable 
)
protected

Called within the ReadLock(), which will be released before downloading the catalog (and before leaving the method)

Definition at line 845 of file catalog_mgr_impl.h.

Here is the call graph for this function:

template<class CatalogT>
virtual void catalog::AbstractCatalogManager< CatalogT >::StageNestedCatalogByHash ( const shash::Any ,
const PathString  
)
inlineprotectedvirtual

Opportunistic optimization: the client catalog manager uses this method to preload into the cache a nested catalog that is likely to be required next. Likely, because there is a race with the root catalog reload which may result in the wrong catalog being staged. That's not a fault though, the correct catalog will still be loaded with the write lock held. Note that this method is never used for root catalogs.

Reimplemented in catalog::ClientCatalogManager.

Definition at line 353 of file catalog_mgr.h.

template<class CatalogT>
Statistics catalog::AbstractCatalogManager< CatalogT >::statistics ( ) const
inline

Definition at line 289 of file catalog_mgr.h.

template<class CatalogT>
virtual void catalog::AbstractCatalogManager< CatalogT >::UnloadCatalog ( const CatalogT *  catalog)
inlineprotectedvirtual

Reimplemented in catalog::ClientCatalogManager.

Definition at line 341 of file catalog_mgr.h.

template<class CatalogT>
void catalog::AbstractCatalogManager< CatalogT >::Unlock ( ) const
inlineprotected

Definition at line 411 of file catalog_mgr.h.

Referenced by catalog::AbstractCatalogManager< Catalog >::inode_gauge().

Here is the caller graph for this function:

template<class CatalogT>
bool catalog::AbstractCatalogManager< CatalogT >::volatile_flag ( ) const
inline

Definition at line 293 of file catalog_mgr.h.

Referenced by MountPoint::CreateCatalogManager(), cvmfs::cvmfs_open(), cvmfs::cvmfs_read(), and LHashMagicXattr::FinalizeValue().

Here is the caller graph for this function:

template<class CatalogT>
void catalog::AbstractCatalogManager< CatalogT >::WriteLock ( ) const
inlineprotected

Definition at line 403 of file catalog_mgr.h.

Member Data Documentation

template<class CatalogT>
std::string catalog::AbstractCatalogManager< CatalogT >::authz_cache_
private

Saves the VOMS requirements when a root catalog is attached

Definition at line 446 of file catalog_mgr.h.

template<class CatalogT>
unsigned catalog::AbstractCatalogManager< CatalogT >::catalog_watermark_
private

Try to keep number of nested catalogs below the given limit. Zero means no limit. Surpassing the watermark on mounting a catalog triggers a DetachSiblings() call.

Definition at line 433 of file catalog_mgr.h.

Referenced by catalog::AbstractCatalogManager< CatalogT >::AbstractCatalogManager().

template<class CatalogT>
OwnerMap catalog::AbstractCatalogManager< CatalogT >::gid_map_
private

Definition at line 457 of file catalog_mgr.h.

template<class CatalogT>
bool catalog::AbstractCatalogManager< CatalogT >::has_authz_cache_
private

Saves the result of GetVOMSAuthz when a root catalog is attached

Definition at line 442 of file catalog_mgr.h.

Referenced by catalog::AbstractCatalogManager< CatalogT >::AbstractCatalogManager().

template<class CatalogT>
uint64_t catalog::AbstractCatalogManager< CatalogT >::incarnation_
private

Counts how often the inodes have been invalidated.

Definition at line 450 of file catalog_mgr.h.

Referenced by catalog::AbstractCatalogManager< CatalogT >::AbstractCatalogManager().

template<class CatalogT>
InodeAnnotation* catalog::AbstractCatalogManager< CatalogT >::inode_annotation_
private
template<class CatalogT>
uint64_t catalog::AbstractCatalogManager< CatalogT >::inode_gauge_
private
template<class CatalogT>
int catalog::AbstractCatalogManager< CatalogT >::inode_watermark_status_
private

0: OK, 1: > 32bit

Definition at line 424 of file catalog_mgr.h.

Referenced by catalog::AbstractCatalogManager< CatalogT >::AbstractCatalogManager().

template<class CatalogT>
const inode_t catalog::AbstractCatalogManager< CatalogT >::kInodeOffset = 255
static
template<class CatalogT>
pthread_key_t catalog::AbstractCatalogManager< CatalogT >::pkey_sqlitemem_
private
template<class CatalogT>
uint64_t catalog::AbstractCatalogManager< CatalogT >::revision_cache_
private
template<class CatalogT>
Statistics catalog::AbstractCatalogManager< CatalogT >::statistics_
private
template<class CatalogT>
uint64_t catalog::AbstractCatalogManager< CatalogT >::timestamp_cache_
private
template<class CatalogT>
OwnerMap catalog::AbstractCatalogManager< CatalogT >::uid_map_
private

Definition at line 456 of file catalog_mgr.h.

template<class CatalogT>
bool catalog::AbstractCatalogManager< CatalogT >::volatile_flag_
private

Not protected by a read lock because it can only change when the root catalog is exchanged (during big global lock of the file system).

Definition at line 438 of file catalog_mgr.h.

Referenced by catalog::AbstractCatalogManager< CatalogT >::AbstractCatalogManager(), and catalog::AbstractCatalogManager< Catalog >::volatile_flag().


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