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

#include <catalog.h>

Inheritance diagram for catalog::Catalog:
Collaboration diagram for catalog::Catalog:

Classes

struct  NestedCatalog
 

Public Types

typedef std::vector< shash::AnyHashVector
 
typedef std::vector
< NestedCatalog
NestedCatalogList
 

Public Member Functions

 Catalog (const PathString &mountpoint, const shash::Any &catalog_hash, Catalog *parent, const bool is_nested=false)
 
virtual ~Catalog ()
 
bool OpenDatabase (const std::string &db_path)
 
bool LookupPath (const PathString &path, DirectoryEntry *dirent) const
 
bool LookupRawSymlink (const PathString &path, LinkString *raw_symlink) const
 
bool LookupXattrsPath (const PathString &path, XattrList *xattrs) const
 
bool ListingPath (const PathString &path, DirectoryEntryList *listing, const bool expand_symlink=true) const
 
bool ListingPathStat (const PathString &path, StatEntryList *listing) const
 
bool AllChunksBegin ()
 
bool AllChunksNext (shash::Any *hash, zlib::Algorithms *compression_alg)
 
bool AllChunksEnd ()
 
bool ListPathChunks (const PathString &path, const shash::Algorithms interpret_hashes_as, FileChunkList *chunks) const
 
CatalogList GetChildren () const
 
CatalogFindSubtree (const PathString &path) const
 
CatalogFindChild (const PathString &mountpoint) const
 
void AddChild (Catalog *child)
 
void RemoveChild (Catalog *child)
 
const HashVectorGetReferencedObjects () const
 
void TakeDatabaseFileOwnership ()
 
void DropDatabaseFileOwnership ()
 
bool OwnsDatabaseFile () const
 
uint64_t GetTTL () const
 
bool HasExplicitTTL () const
 
uint64_t GetRevision () const
 
bool GetVOMSAuthz (std::string *authz) const
 
uint64_t GetLastModified () const
 
uint64_t GetNumEntries () const
 
uint64_t GetNumChunks () const
 
shash::Any GetPreviousRevision () const
 
const CountersGetCounters () const
 
std::string PrintMemStatistics () const
 
float schema () const
 
PathString mountpoint () const
 
Catalogparent () const
 
uint64_t max_row_id () const
 
InodeRange inode_range () const
 
void set_inode_range (const InodeRange value)
 
std::string database_path () const
 
PathString root_prefix () const
 
shash::Any hash () const
 
bool volatile_flag () const
 
uint64_t revision () const
 
bool IsInitialized () const
 
bool IsRoot () const
 
bool IsAutogenerated () const
 
bool HasParent () const
 
virtual bool IsWritable () const
 
const NestedCatalogListListNestedCatalogs () const
 
const NestedCatalogList ListOwnNestedCatalogs () const
 
bool FindNested (const PathString &mountpoint, shash::Any *hash, uint64_t *size) const
 
void SetInodeAnnotation (InodeAnnotation *new_annotation)
 
inode_t GetMangledInode (const uint64_t row_id, const uint64_t hardlink_group) const
 
void SetOwnerMaps (const OwnerMap *uid_map, const OwnerMap *gid_map)
 
uint64_t MapUid (const uint64_t uid) const
 
uint64_t MapGid (const uint64_t gid) const
 

Static Public Member Functions

static CatalogAttachFreely (const std::string &imaginary_mountpoint, const std::string &file, const shash::Any &catalog_hash, Catalog *parent=NULL, const bool is_nested=false)
 

Static Public Attributes

static const uint64_t kDefaultTTL = 240
 

Protected Types

typedef std::map< uint64_t,
inode_t
HardlinkGroupMap
 

Protected Member Functions

bool InitStandalone (const std::string &database_file)
 
bool ReadCatalogCounters ()
 
virtual CatalogDatabase::OpenMode DatabaseOpenMode () const
 
virtual void InitPreparedStatements ()
 
void FinalizePreparedStatements ()
 
CountersGetWritableCounters ()
 
const CatalogDatabasedatabase () const
 
CatalogDatabasedatabase ()
 
void set_parent (Catalog *catalog)
 
void ResetNestedCatalogCacheUnprotected ()
 
bool LookupMd5Path (const shash::Md5 &md5path, DirectoryEntry *dirent) const
 

Protected Attributes

HardlinkGroupMap hardlink_groups_
 
pthread_mutex_t * lock_
 

Private Types

enum  VomsAuthzStatus { kVomsUnknown, kVomsNone, kVomsPresent }
 
typedef std::map< PathString,
Catalog * > 
NestedCatalogMap
 

Private Member Functions

 FRIEND_TEST (T_Catalog, NormalizePath)
 
 FRIEND_TEST (T_Catalog, PlantPath)
 
shash::Md5 NormalizePath (const PathString &path) const
 
PathString NormalizePath2 (const PathString &path) const
 
PathString PlantPath (const PathString &path) const
 
void FixTransitionPoint (const shash::Md5 &md5path, DirectoryEntry *dirent) const
 
bool LookupXattrsMd5Path (const shash::Md5 &md5path, XattrList *xattrs) const
 
bool ListMd5PathChunks (const shash::Md5 &md5path, const shash::Algorithms interpret_hashes_as, FileChunkList *chunks) const
 
bool ListingMd5Path (const shash::Md5 &md5path, DirectoryEntryList *listing, const bool expand_symlink=true) const
 
bool ListingMd5PathStat (const shash::Md5 &md5path, StatEntryList *listing) const
 
bool LookupEntry (const shash::Md5 &md5path, const bool expand_symlink, DirectoryEntry *dirent) const
 
- Private Member Functions inherited from SingleCopy
 SingleCopy ()
 

Private Attributes

CatalogDatabasedatabase_
 
const shash::Any catalog_hash_
 
PathString root_prefix_
 
PathString mountpoint_
 
bool is_regular_mountpoint_
 
bool volatile_flag_
 
const bool is_root_
 
bool managed_database_
 
Catalogparent_
 
NestedCatalogMap children_
 
NestedCatalogList nested_catalog_cache_
 
bool nested_catalog_cache_dirty_
 
VomsAuthzStatus voms_authz_status_
 
std::string voms_authz_
 
bool initialized_
 
InodeRange inode_range_
 
uint64_t max_row_id_
 
InodeAnnotationinode_annotation_
 
Counters counters_
 
const OwnerMapuid_map_
 
const OwnerMapgid_map_
 
SqlListingsql_listing_
 
SqlLookupPathHashsql_lookup_md5path_
 
SqlNestedCatalogLookupsql_lookup_nested_
 
SqlNestedCatalogListingsql_list_nested_
 
SqlOwnNestedCatalogListingsql_own_list_nested_
 
SqlAllChunkssql_all_chunks_
 
SqlChunksListingsql_chunks_listing_
 
SqlLookupXattrssql_lookup_xattrs_
 
HashVector referenced_hashes_
 

Static Private Attributes

static const shash::Md5 kMd5PathEmpty
 

Friends

class swissknife::CommandMigrate
 

Detailed Description

This class wraps a catalog database and provides methods to query for directory entries. It has a pointer to its parent catalog and its children, thereby creating a tree structure of nested catalogs.

Read-only catalog. A sub-class provides read-write access.

Definition at line 91 of file catalog.h.

Member Typedef Documentation

typedef std::map<uint64_t, inode_t> catalog::Catalog::HardlinkGroupMap
protected

Definition at line 229 of file catalog.h.

Definition at line 97 of file catalog.h.

Definition at line 208 of file catalog.h.

Definition at line 258 of file catalog.h.

Member Enumeration Documentation

Enumerator
kVomsUnknown 
kVomsNone 
kVomsPresent 

Definition at line 266 of file catalog.h.

Constructor & Destructor Documentation

catalog::Catalog::Catalog ( const PathString mountpoint,
const shash::Any catalog_hash,
Catalog parent,
const bool  is_nested = false 
)

Note: is_nested only has an effect if parent == NULL otherwise being a root catalog is determined by having a parent pointer or not.

Definition at line 49 of file catalog.cc.

Here is the call graph for this function:

catalog::Catalog::~Catalog ( )
virtual

Definition at line 84 of file catalog.cc.

Here is the call graph for this function:

Member Function Documentation

void catalog::Catalog::AddChild ( Catalog child)

Add a Catalog as child to this Catalog.

Parameters
childthe Catalog to define as child

Definition at line 730 of file catalog.cc.

Referenced by catalog::WritableCatalog::InsertNestedCatalog(), and OpenDatabase().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::AllChunksBegin ( )

Definition at line 422 of file catalog.cc.

Referenced by swissknife::CommandPull::Pull().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::AllChunksEnd ( )

Definition at line 433 of file catalog.cc.

Referenced by swissknife::CommandPull::Pull().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::AllChunksNext ( shash::Any hash,
zlib::Algorithms compression_alg 
)

Definition at line 427 of file catalog.cc.

Referenced by swissknife::CommandPull::Pull().

Here is the call graph for this function:

Here is the caller graph for this function:

Catalog * catalog::Catalog::AttachFreely ( const std::string &  imaginary_mountpoint,
const std::string &  file,
const shash::Any catalog_hash,
Catalog parent = NULL,
const bool  is_nested = false 
)
static

Open a catalog outside the framework of a catalog manager.

Definition at line 29 of file catalog.cc.

Referenced by swissknife::CommandCheck::FetchCatalog(), swissknife::Assistant::GetCatalog(), swissknife::CommandTag::GetCatalog(), and swissknife::CommandPull::Pull().

Here is the call graph for this function:

Here is the caller graph for this function:

const CatalogDatabase& catalog::Catalog::database ( ) const
inlineprotected

Definition at line 249 of file catalog.h.

Referenced by swissknife::CommandMigrate::MigrationWorker_20x::AnalyzeFileLinkcounts(), swissknife::CommandMigrate::MigrationWorker_20x::AttachOldCatalogDatabase(), swissknife::CommandMigrate::MigrationWorker_20x::CheckDatabaseSchemaCompatibility(), swissknife::CommandMigrate::MigrationWorker_217::CheckDatabaseSchemaCompatibility(), swissknife::CommandMigrate::HardlinkRemovalMigrationWorker::CheckDatabaseSchemaCompatibility(), swissknife::CommandMigrate::BulkhashRemovalMigrationWorker::CheckDatabaseSchemaCompatibility(), swissknife::CommandMigrate::StatsMigrationWorker::CheckDatabaseSchemaCompatibility(), swissknife::CommandMigrate::AbstractMigrationWorker< DerivedT >::CollectAndAggregateStatistics(), catalog::WritableCatalog::Commit(), catalog::WritableCatalog::CopyToParent(), swissknife::CommandMigrate::MigrationWorker_20x::DetachOldCatalogDatabase(), swissknife::CommandMigrate::MigrationWorker_20x::FindRootEntryInformation(), swissknife::CommandMigrate::MigrationWorker_20x::FixNestedCatalogTransitionPoints(), swissknife::CommandMigrate::MigrationWorker_20x::GenerateCatalogStatistics(), GetLastModified(), GetNumEntries(), GetPreviousRevision(), GetReferencedObjects(), GetRevision(), GetTTL(), GetVOMSAuthz(), swissknife::CommandMigrate::PendingCatalog::HasChanges(), HasExplicitTTL(), catalog::WritableCatalog::InitPreparedStatements(), InitPreparedStatements(), catalog::WritableCatalog::InsertBindMountpoint(), catalog::WritableCatalog::InsertNestedCatalog(), swissknife::CommandMigrate::MigrationWorker_20x::MigrateFileMetadata(), swissknife::CommandMigrate::MigrationWorker_20x::MigrateNestedCatalogMountPoints(), OpenDatabase(), PrintMemStatistics(), ReadCatalogCounters(), catalog::WritableCatalog::RemoveBindMountpoint(), swissknife::CommandMigrate::MigrationWorker_20x::RemoveDanglingNestedMountpoints(), catalog::WritableCatalog::RemoveNestedCatalog(), schema(), catalog::WritableCatalog::SetBranch(), catalog::WritableCatalog::SetPreviousRevision(), catalog::WritableCatalog::SetRevision(), catalog::WritableCatalog::SetTTL(), catalog::WritableCatalog::SetVOMSAuthz(), catalog::WritableCatalog::Transaction(), catalog::WritableCatalog::UpdateCounters(), catalog::WritableCatalog::UpdateLastModified(), catalog::WritableCatalog::UpdateNestedCatalog(), swissknife::CommandMigrate::AbstractMigrationWorker< DerivedT >::UpdateNestedCatalogReferences(), and catalog::WritableCatalog::VacuumDatabaseIfNecessary().

Here is the caller graph for this function:

CatalogDatabase& catalog::Catalog::database ( )
inlineprotected

Definition at line 250 of file catalog.h.

std::string catalog::Catalog::database_path ( ) const
inline
virtual CatalogDatabase::OpenMode catalog::Catalog::DatabaseOpenMode ( ) const
inlineprotectedvirtual

Specifies the SQLite open flags. Overwritten by r/w catalog.

Reimplemented in catalog::WritableCatalog.

Definition at line 240 of file catalog.h.

Referenced by OpenDatabase().

Here is the caller graph for this function:

void catalog::Catalog::DropDatabaseFileOwnership ( )

Definition at line 487 of file catalog.cc.

Here is the call graph for this function:

void catalog::Catalog::FinalizePreparedStatements ( )
protected

Definition at line 110 of file catalog.cc.

Referenced by ~Catalog().

Here is the caller graph for this function:

Catalog * catalog::Catalog::FindChild ( const PathString mountpoint) const

Looks for a child catalog, which is a subset of all registered nested catalogs.

Definition at line 808 of file catalog.cc.

Referenced by AddChild(), catalog::WritableCatalog::CopyCatalogsToParent(), FindSubtree(), RemoveChild(), catalog::WritableCatalog::RemoveNestedCatalog(), and catalog::WritableCatalogManager::SwapNestedCatalog().

Here is the caller graph for this function:

bool catalog::Catalog::FindNested ( const PathString mountpoint,
shash::Any hash,
uint64_t *  size 
) const
Catalog * catalog::Catalog::FindSubtree ( const PathString path) const

Find the nested catalog that serves the given path. It might be possible that the path is in fact served by a child of the found nested catalog.

Parameters
paththe path to find a best fitting catalog for
Returns
a pointer to the best fitting child or NULL if it does not fit at all

Definition at line 773 of file catalog.cc.

Here is the call graph for this function:

void catalog::Catalog::FixTransitionPoint ( const shash::Md5 md5path,
DirectoryEntry dirent 
) const
private

For the transition points for nested catalogs and bind mountpoints, the inode is ambiguous. It has to be set to the parent inode because nested catalogs are lazily loaded.

Parameters
md5paththe MD5 hash of the entry to check
direntthe DirectoryEntry to perform coherence fixes on

Definition at line 827 of file catalog.cc.

Referenced by ListingMd5Path(), ListingMd5PathStat(), and LookupEntry().

Here is the call graph for this function:

Here is the caller graph for this function:

catalog::Catalog::FRIEND_TEST ( T_Catalog  ,
NormalizePath   
)
private
catalog::Catalog::FRIEND_TEST ( T_Catalog  ,
PlantPath   
)
private
uint64_t catalog::Catalog::GetLastModified ( ) const

Definition at line 533 of file catalog.cc.

Referenced by swissknife::CommandEditTag::AddNewTag(), swissknife::CommandMigrate::DoMigrationAndCommit(), and swissknife::CommandPull::Pull().

Here is the call graph for this function:

Here is the caller graph for this function:

inode_t catalog::Catalog::GetMangledInode ( const uint64_t  row_id,
const uint64_t  hardlink_group 
) const

Determine the actual inode of a DirectoryEntry. The first used entry from a hardlink group deterimines the inode of the others.

Parameters
row_idthe row id of a read row in the sqlite database
hardlink_groupthe id of a possibly present hardlink group
Returns
the assigned inode number

Definition at line 593 of file catalog.cc.

Referenced by catalog::SqlLookup::GetDirent().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t catalog::Catalog::GetNumChunks ( ) const

Definition at line 541 of file catalog.cc.

Referenced by swissknife::CommandPull::Pull().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t catalog::Catalog::GetNumEntries ( ) const

Definition at line 546 of file catalog.cc.

Referenced by swissknife::CommandListCatalogs::CatalogCallback(), and catalog::WritableCatalogManager::FixWeight().

Here is the call graph for this function:

Here is the caller graph for this function:

shash::Any catalog::Catalog::GetPreviousRevision ( ) const

Definition at line 555 of file catalog.cc.

Referenced by swissknife::CommandPull::PullRecursion().

Here is the call graph for this function:

Here is the caller graph for this function:

const Catalog::HashVector & catalog::Catalog::GetReferencedObjects ( ) const

Only used by the garbage collection

Definition at line 464 of file catalog.cc.

Referenced by swissknife::CommandListReflog::CatalogCallback().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t catalog::Catalog::GetRevision ( ) const
uint64_t catalog::Catalog::GetTTL ( ) const

Definition at line 495 of file catalog.cc.

Referenced by catalog::WritableCatalogManager::CatalogUploadCallback(), and swissknife::CommandMigrate::DoMigrationAndCommit().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::GetVOMSAuthz ( std::string *  authz) const

Definition at line 507 of file catalog.cc.

Here is the call graph for this function:

Counters& catalog::Catalog::GetWritableCounters ( )
inlineprotected

Definition at line 247 of file catalog.h.

Referenced by catalog::WritableCatalog::MergeIntoParent().

Here is the caller graph for this function:

bool catalog::Catalog::HasExplicitTTL ( ) const

Definition at line 501 of file catalog.cc.

Here is the call graph for this function:

bool catalog::Catalog::HasParent ( ) const
inline
void catalog::Catalog::InitPreparedStatements ( )
protectedvirtual

InitPreparedStatement uses polymorphism in case of a r/w catalog. FinalizePreparedStatements is called in the destructor where polymorphism does not work any more and has to be called both in the WritableCatalog and the Catalog destructor

Reimplemented in catalog::WritableCatalog.

Definition at line 98 of file catalog.cc.

Referenced by catalog::WritableCatalog::InitPreparedStatements(), and OpenDatabase().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::InitStandalone ( const std::string &  database_file)
protected

Definition at line 122 of file catalog.cc.

Referenced by catalog::WritableCatalog::AttachFreely(), and AttachFreely().

Here is the call graph for this function:

Here is the caller graph for this function:

InodeRange catalog::Catalog::inode_range ( ) const
inline

Definition at line 182 of file catalog.h.

Referenced by InitStandalone().

Here is the caller graph for this function:

bool catalog::Catalog::IsAutogenerated ( ) const
inline

Definition at line 194 of file catalog.h.

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::IsInitialized ( ) const
inline

Definition at line 190 of file catalog.h.

Referenced by GetMangledInode(), IsAutogenerated(), ListingMd5Path(), ListingMd5PathStat(), ListMd5PathChunks(), LookupEntry(), and LookupXattrsMd5Path().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool catalog::Catalog::IsWritable ( ) const
inlinevirtual
bool catalog::Catalog::ListingMd5Path ( const shash::Md5 md5path,
DirectoryEntryList listing,
const bool  expand_symlink = true 
) const
private

Perform a listing of the directory with the given MD5 path hash. Returns only struct stat values

Parameters
path_hashthe MD5 hash of the path of the directory to list
listingwill be set to the resulting DirectoryEntryList
expand_symlinkdefines if magic symlinks should be resolved
Returns
true on successful listing, false otherwise

Definition at line 402 of file catalog.cc.

Referenced by ListingPath().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::ListingMd5PathStat ( const shash::Md5 md5path,
StatEntryList listing 
) const
private

Perform a listing of the directory with the given MD5 path hash.

Parameters
path_hashthe MD5 hash of the path of the directory to list
listingwill be set to the resulting DirectoryEntryList
Returns
true on successful listing, false otherwise

Definition at line 369 of file catalog.cc.

Referenced by ListingPathStat().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::ListingPath ( const PathString path,
DirectoryEntryList listing,
const bool  expand_symlink = true 
) const
inline

Definition at line 132 of file catalog.h.

Referenced by swissknife::CommandCheck::Find(), and catalog::WritableCatalog::MoveToNestedRecursively().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::ListingPathStat ( const PathString path,
StatEntryList listing 
) const
inline

Definition at line 138 of file catalog.h.

Here is the call graph for this function:

bool catalog::Catalog::ListMd5PathChunks ( const shash::Md5 md5path,
const shash::Algorithms  interpret_hashes_as,
FileChunkList chunks 
) const
private

Hash algorithm is given by the unchunked file. Could be figured out by a join but it is faster if the user of this method tells us.

Definition at line 443 of file catalog.cc.

Referenced by ListPathChunks().

Here is the call graph for this function:

Here is the caller graph for this function:

const Catalog::NestedCatalogList & catalog::Catalog::ListNestedCatalogs ( ) const

Get a list of all registered nested catalogs and bind mountpoints in this catalog.

Returns
a list of all nested catalog and bind mountpoints.

Definition at line 630 of file catalog.cc.

Referenced by catalog::VirtualCatalog::GetSortedTagsFromCatalog(), and swissknife::CommandMigrate::MigrationWorker_20x::RemoveDanglingNestedMountpoints().

Here is the call graph for this function:

Here is the caller graph for this function:

const Catalog::NestedCatalogList catalog::Catalog::ListOwnNestedCatalogs ( ) const

Get a list of all registered nested catalogs without bind mountpoints. Used for replication and garbage collection.

Returns
a list of all nested catalogs.

Definition at line 656 of file catalog.cc.

Referenced by catalog::WritableCatalog::CopyCatalogsToParent(), and swissknife::CommandPull::PullRecursion().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::ListPathChunks ( const PathString path,
const shash::Algorithms  interpret_hashes_as,
FileChunkList chunks 
) const
inline

Definition at line 147 of file catalog.h.

Referenced by swissknife::CommandCheck::Find(), and catalog::WritableCatalog::MoveFileChunksToNested().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::LookupEntry ( const shash::Md5 md5path,
const bool  expand_symlink,
DirectoryEntry dirent 
) const
private

Performs a lookup on this Catalog for a given MD5 path hash.

Parameters
md5paththe MD5 hash of the searched path
expand_symlinkindicates if variables in symlink should be resolved
direntwill be set to the found DirectoryEntry
Returns
true if DirectoryEntry was successfully found, false otherwise

Definition at line 303 of file catalog.cc.

Referenced by LookupMd5Path(), and LookupRawSymlink().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::LookupMd5Path ( const shash::Md5 md5path,
DirectoryEntry dirent 
) const
protected

Performs a lookup on this Catalog for a given MD5 path hash.

Parameters
md5paththe MD5 hash of the searched path
direntwill be set to the found DirectoryEntry
Returns
true if DirectoryEntry was successfully found, false otherwise

Definition at line 327 of file catalog.cc.

Referenced by FixTransitionPoint(), LookupPath(), and catalog::WritableCatalog::TouchEntry().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::LookupRawSymlink ( const PathString path,
LinkString raw_symlink 
) const

Definition at line 334 of file catalog.cc.

Here is the call graph for this function:

bool catalog::Catalog::LookupXattrsMd5Path ( const shash::Md5 md5path,
XattrList xattrs 
) const
private

Definition at line 345 of file catalog.cc.

Referenced by LookupXattrsPath().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::LookupXattrsPath ( const PathString path,
XattrList xattrs 
) const
inline

Definition at line 128 of file catalog.h.

Referenced by catalog::WritableCatalogManager::CreateNestedCatalog(), and catalog::WritableCatalog::MoveToNestedRecursively().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t catalog::Catalog::MapGid ( const uint64_t  gid) const
inline

Definition at line 223 of file catalog.h.

Referenced by catalog::SqlLookup::GetDirent().

Here is the caller graph for this function:

uint64_t catalog::Catalog::MapUid ( const uint64_t  uid) const
inline

Definition at line 219 of file catalog.h.

Referenced by catalog::SqlLookup::GetDirent().

Here is the caller graph for this function:

uint64_t catalog::Catalog::max_row_id ( ) const
inline

Definition at line 181 of file catalog.h.

shash::Md5 catalog::Catalog::NormalizePath ( const PathString path) const
private

Removes the mountpoint and prepends the root prefix to path

Definition at line 240 of file catalog.cc.

Referenced by ListingPath(), ListingPathStat(), ListPathChunks(), LookupPath(), LookupRawSymlink(), and LookupXattrsPath().

Here is the call graph for this function:

Here is the caller graph for this function:

PathString catalog::Catalog::NormalizePath2 ( const PathString path) const
private

Same as NormalizePath but returns a PathString instead of an Md5 hash.

Definition at line 267 of file catalog.cc.

Referenced by FindNested().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::OpenDatabase ( const std::string &  db_path)

Establishes the database structures and opens the sqlite database file.

Parameters
db_paththe absolute path to the database file on local file system
Returns
true on successful initialization otherwise false

Definition at line 164 of file catalog.cc.

Referenced by InitStandalone().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::OwnsDatabaseFile ( ) const
inline

Definition at line 163 of file catalog.h.

Here is the call graph for this function:

PathString catalog::Catalog::PlantPath ( const PathString path) const
private

The opposite of NormalizePath: from a full path remove the root prefix and add the catalogs current mountpoint. Needed for normalized paths from the SQlite tables, such as nested catalog entry points.

Definition at line 284 of file catalog.cc.

Referenced by ListNestedCatalogs(), and ListOwnNestedCatalogs().

Here is the call graph for this function:

Here is the caller graph for this function:

string catalog::Catalog::PrintMemStatistics ( ) const

Definition at line 565 of file catalog.cc.

Here is the call graph for this function:

bool catalog::Catalog::ReadCatalogCounters ( )
protected

Definition at line 135 of file catalog.cc.

Referenced by OpenDatabase(), and catalog::WritableCatalog::UpdateCounters().

Here is the call graph for this function:

Here is the caller graph for this function:

void catalog::Catalog::RemoveChild ( Catalog child)

Removes a Catalog from the children list of this Catalog

Parameters
childthe Catalog to delete as child

Definition at line 743 of file catalog.cc.

Referenced by catalog::WritableCatalog::RemoveNestedCatalog().

Here is the call graph for this function:

Here is the caller graph for this function:

void catalog::Catalog::ResetNestedCatalogCacheUnprotected ( )
protected

Drops the nested catalog cache. Usually this is only useful in subclasses that implement writable catalogs.

Note: this action is not secured by the catalog's mutex. If serialisation is required the subclass needs to ensure that.

Definition at line 681 of file catalog.cc.

Referenced by catalog::WritableCatalog::InsertNestedCatalog(), catalog::WritableCatalog::RemoveNestedCatalog(), and catalog::WritableCatalog::UpdateNestedCatalog().

Here is the caller graph for this function:

uint64_t catalog::Catalog::revision ( ) const
inline

Definition at line 188 of file catalog.h.

Here is the call graph for this function:

PathString catalog::Catalog::root_prefix ( ) const
inline

Definition at line 185 of file catalog.h.

Referenced by swissknife::CommandEditTag::AddNewTag(), and OpenDatabase().

Here is the caller graph for this function:

float catalog::Catalog::schema ( ) const
inline

Definition at line 178 of file catalog.h.

Referenced by catalog::SqlLookup::GetDirent().

Here is the call graph for this function:

Here is the caller graph for this function:

void catalog::Catalog::set_inode_range ( const InodeRange  value)
inline

Definition at line 183 of file catalog.h.

Referenced by InitStandalone().

Here is the caller graph for this function:

void catalog::Catalog::set_parent ( Catalog catalog)
inlineprotected

Definition at line 251 of file catalog.h.

Referenced by AddChild(), and RemoveChild().

Here is the caller graph for this function:

void catalog::Catalog::SetInodeAnnotation ( InodeAnnotation new_annotation)

Sets a new object to do inode annotations (or set to NULL) The annotation object is not owned by the catalog.

Definition at line 711 of file catalog.cc.

Here is the call graph for this function:

void catalog::Catalog::SetOwnerMaps ( const OwnerMap uid_map,
const OwnerMap gid_map 
)

Definition at line 720 of file catalog.cc.

void catalog::Catalog::TakeDatabaseFileOwnership ( )

Definition at line 479 of file catalog.cc.

Referenced by catalog::WritableCatalogManager::ActivateCatalog(), catalog::SimpleCatalogManager::CreateCatalog(), and swissknife::Assistant::GetCatalog().

Here is the call graph for this function:

Here is the caller graph for this function:

bool catalog::Catalog::volatile_flag ( ) const
inline

Definition at line 187 of file catalog.h.

Friends And Related Function Documentation

friend class swissknife::CommandMigrate
friend

Definition at line 94 of file catalog.h.

Member Data Documentation

const shash::Any catalog::Catalog::catalog_hash_
private

Definition at line 293 of file catalog.h.

Referenced by hash().

NestedCatalogMap catalog::Catalog::children_
private

Definition at line 312 of file catalog.h.

Referenced by AddChild(), FindChild(), GetChildren(), and RemoveChild().

Counters catalog::Catalog::counters_
private

Definition at line 323 of file catalog.h.

Referenced by GetCounters(), GetNumChunks(), GetWritableCounters(), and ReadCatalogCounters().

const OwnerMap* catalog::Catalog::gid_map_
private

Definition at line 326 of file catalog.h.

Referenced by Catalog(), MapGid(), and SetOwnerMaps().

HardlinkGroupMap catalog::Catalog::hardlink_groups_
mutableprotected

Definition at line 230 of file catalog.h.

Referenced by GetMangledInode().

bool catalog::Catalog::initialized_
private

Definition at line 319 of file catalog.h.

Referenced by IsInitialized(), and OpenDatabase().

InodeAnnotation* catalog::Catalog::inode_annotation_
private

Definition at line 322 of file catalog.h.

Referenced by Catalog(), GetMangledInode(), and SetInodeAnnotation().

InodeRange catalog::Catalog::inode_range_
private

Definition at line 320 of file catalog.h.

Referenced by GetMangledInode(), inode_range(), IsInitialized(), and set_inode_range().

bool catalog::Catalog::is_regular_mountpoint_
private

True, iff root_prefix_ == mountpoint_

Definition at line 303 of file catalog.h.

Referenced by NormalizePath(), NormalizePath2(), OpenDatabase(), and PlantPath().

const bool catalog::Catalog::is_root_
private

For catalogs in a catalog manager: doesn't have a parent catalog

Definition at line 308 of file catalog.h.

Referenced by IsRoot().

const uint64_t catalog::Catalog::kDefaultTTL = 240
static

The default TTL should be shorter than the autofs idle unmount time which is 5 minutes, because the config repo is accessed on every root catalog refresh and we want to avoid thrashing that mountpoint.4 minutes default TTL

Definition at line 104 of file catalog.h.

Referenced by GetTTL(), and swissknife::CommandSync::Main().

const shash::Md5 catalog::Catalog::kMd5PathEmpty
staticprivate

The hash of the empty string. Used to identify the root entry of a repository, which is the child transition point of a bind mountpoint.

Definition at line 264 of file catalog.h.

Referenced by FixTransitionPoint().

bool catalog::Catalog::managed_database_
private
uint64_t catalog::Catalog::max_row_id_
private

Definition at line 321 of file catalog.h.

Referenced by Catalog(), max_row_id(), and OpenDatabase().

PathString catalog::Catalog::mountpoint_
private

Normally, catalogs are mounted at their root_prefix_. But for the structure under /.cvmfs/snapshots/..., that's not the case.

Definition at line 299 of file catalog.h.

Referenced by FindSubtree(), FixTransitionPoint(), IsAutogenerated(), mountpoint(), NormalizePath(), NormalizePath2(), OpenDatabase(), and PlantPath().

NestedCatalogList catalog::Catalog::nested_catalog_cache_
mutableprivate

Definition at line 313 of file catalog.h.

Referenced by ListNestedCatalogs(), and ResetNestedCatalogCacheUnprotected().

bool catalog::Catalog::nested_catalog_cache_dirty_
mutableprivate

Definition at line 314 of file catalog.h.

Referenced by ListNestedCatalogs(), and ResetNestedCatalogCacheUnprotected().

Catalog* catalog::Catalog::parent_
private

Definition at line 311 of file catalog.h.

Referenced by FixTransitionPoint(), HasParent(), OpenDatabase(), parent(), and set_parent().

HashVector catalog::Catalog::referenced_hashes_
mutableprivate

Definition at line 337 of file catalog.h.

Referenced by GetReferencedObjects().

PathString catalog::Catalog::root_prefix_
private

Definition at line 294 of file catalog.h.

Referenced by NormalizePath(), NormalizePath2(), OpenDatabase(), PlantPath(), and root_prefix().

SqlAllChunks* catalog::Catalog::sql_all_chunks_
private
SqlChunksListing* catalog::Catalog::sql_chunks_listing_
private
SqlNestedCatalogListing* catalog::Catalog::sql_list_nested_
private
SqlListing* catalog::Catalog::sql_listing_
private
SqlLookupPathHash* catalog::Catalog::sql_lookup_md5path_
private
SqlNestedCatalogLookup* catalog::Catalog::sql_lookup_nested_
private

Definition at line 330 of file catalog.h.

Referenced by Catalog(), FinalizePreparedStatements(), FindNested(), and InitPreparedStatements().

SqlLookupXattrs* catalog::Catalog::sql_lookup_xattrs_
private
SqlOwnNestedCatalogListing* catalog::Catalog::sql_own_list_nested_
private
const OwnerMap* catalog::Catalog::uid_map_
private

Definition at line 325 of file catalog.h.

Referenced by Catalog(), MapUid(), and SetOwnerMaps().

bool catalog::Catalog::volatile_flag_
private

Definition at line 304 of file catalog.h.

Referenced by OpenDatabase(), and volatile_flag().

std::string catalog::Catalog::voms_authz_
mutableprivate

Definition at line 317 of file catalog.h.

Referenced by GetVOMSAuthz().

VomsAuthzStatus catalog::Catalog::voms_authz_status_
mutableprivate

Definition at line 316 of file catalog.h.

Referenced by GetVOMSAuthz().


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