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

#include <catalog_mgr_ro.h>

Inheritance diagram for catalog::SimpleCatalogManager:
Collaboration diagram for catalog::SimpleCatalogManager:

Public Member Functions

 SimpleCatalogManager (const shash::Any &base_hash, const std::string &stratum0, const std::string &dir_temp, download::DownloadManager *download_manager, perf::Statistics *statistics, const bool manage_catalog_files=false, const std::string &dir_cache="", const bool copy_to_tmp_dir=false)
 
- Public Member Functions inherited from catalog::AbstractCatalogManager< Catalog >
 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
 
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

virtual LoadReturn GetNewRootCatalogContext (CatalogContext *result)
 
virtual LoadReturn LoadCatalogByHash (CatalogContext *ctlg_context)
 
virtual CatalogCreateCatalog (const PathString &mountpoint, const shash::Any &catalog_hash, Catalog *parent_catalog)
 
const shash::Anybase_hash () const
 
void set_base_hash (const shash::Any &hash)
 
const std::string & dir_temp () const
 
std::string MakeRelativePath (const std::string &relative_path) const
 
bool UseLocalCache () const
 
- Protected Member Functions inherited from catalog::AbstractCatalogManager< Catalog >
virtual void UnloadCatalog (const Catalog *catalog)
 
virtual void ActivateCatalog (Catalog *catalog)
 
const std::vector< Catalog * > & GetCatalogs () const
 
virtual void StageNestedCatalogByHash (const shash::Any &, const PathString &)
 
void StageNestedCatalogAndUnlock (const PathString &path, const Catalog *parent, bool is_listable)
 
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
 
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 ()
 

Protected Attributes

std::string dir_cache_
 
bool copy_to_tmp_dir_
 

Private Member Functions

std::string CopyCatalogToTempFile (const std::string &cache_path)
 

Private Attributes

shash::Any base_hash_
 
std::string stratum0_
 
std::string dir_temp_
 
download::DownloadManagerdownload_manager_
 
const bool manage_catalog_files_
 

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

Definition at line 32 of file catalog_mgr_ro.h.

Constructor & Destructor Documentation

catalog::SimpleCatalogManager::SimpleCatalogManager ( const shash::Any base_hash,
const std::string &  stratum0,
const std::string &  dir_temp,
download::DownloadManager download_manager,
perf::Statistics statistics,
const bool  manage_catalog_files = false,
const std::string &  dir_cache = "",
const bool  copy_to_tmp_dir = false 
)

Definition at line 17 of file catalog_mgr_ro.cc.

Here is the call graph for this function:

Member Function Documentation

const shash::Any& catalog::SimpleCatalogManager::base_hash ( ) const
inlineprotected

Definition at line 51 of file catalog_mgr_ro.h.

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

Here is the caller graph for this function:

std::string catalog::SimpleCatalogManager::CopyCatalogToTempFile ( const std::string &  cache_path)
private

Definition at line 58 of file catalog_mgr_ro.cc.

Referenced by LoadCatalogByHash().

Here is the call graph for this function:

Here is the caller graph for this function:

Catalog * catalog::SimpleCatalogManager::CreateCatalog ( const PathString mountpoint,
const shash::Any catalog_hash,
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 >.

Reimplemented in catalog::WritableCatalogManager.

Definition at line 161 of file catalog_mgr_ro.cc.

Here is the call graph for this function:

const std::string& catalog::SimpleCatalogManager::dir_temp ( ) const
inlineprotected

Definition at line 53 of file catalog_mgr_ro.h.

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

Here is the caller graph for this function:

LoadReturn catalog::SimpleCatalogManager::GetNewRootCatalogContext ( CatalogContext result)
protectedvirtual

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.

Implements catalog::AbstractCatalogManager< Catalog >.

Definition at line 47 of file catalog_mgr_ro.cc.

Here is the call graph for this function:

LoadReturn catalog::SimpleCatalogManager::LoadCatalogByHash ( CatalogContext ctlg_context)
protectedvirtual

Loads a catalog via HTTP from Statum 0 into a temporary file. See CatalogContext class description for correct usage

Depending on the initialization of SimpleCatalogManager, it can locally cache catalogs.

Independent of the catalog being downloaded or being already locally cached, for WriteableCatalog it creates a new copy of the catalog in a tmp dir. This is due to write actions having to be transaction-based and therefore cannot work on standard file locations for cvmfs - someone else could try to access them in a non-clean state.

Returns
kLoadNew on success

Implements catalog::AbstractCatalogManager< Catalog >.

Definition at line 92 of file catalog_mgr_ro.cc.

Here is the call graph for this function:

void catalog::SimpleCatalogManager::set_base_hash ( const shash::Any hash)
inlineprotected

Definition at line 52 of file catalog_mgr_ro.h.

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

Here is the caller graph for this function:

bool catalog::SimpleCatalogManager::UseLocalCache ( ) const
inlineprotected

Member Data Documentation

shash::Any catalog::SimpleCatalogManager::base_hash_
private

Definition at line 77 of file catalog_mgr_ro.h.

Referenced by base_hash(), GetNewRootCatalogContext(), and set_base_hash().

bool catalog::SimpleCatalogManager::copy_to_tmp_dir_
protected

Definition at line 69 of file catalog_mgr_ro.h.

Referenced by LoadCatalogByHash(), and SimpleCatalogManager().

std::string catalog::SimpleCatalogManager::dir_cache_
protected
std::string catalog::SimpleCatalogManager::dir_temp_
private

Definition at line 79 of file catalog_mgr_ro.h.

Referenced by CopyCatalogToTempFile(), dir_temp(), and LoadCatalogByHash().

download::DownloadManager* catalog::SimpleCatalogManager::download_manager_
private

Definition at line 80 of file catalog_mgr_ro.h.

Referenced by LoadCatalogByHash().

const bool catalog::SimpleCatalogManager::manage_catalog_files_
private

Definition at line 81 of file catalog_mgr_ro.h.

Referenced by CreateCatalog().

std::string catalog::SimpleCatalogManager::stratum0_
private

Definition at line 78 of file catalog_mgr_ro.h.

Referenced by LoadCatalogByHash().


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