5 #ifndef CVMFS_CATALOG_H_
6 #define CVMFS_CATALOG_H_
21 #include "gtest/gtest_prod.h"
27 namespace swissknife {
33 template <
class CatalogT>
78 virtual bool ValidInode(
const uint64_t inode) = 0;
113 const bool is_nested =
false);
117 const std::string &file,
120 const bool is_nested =
false);
134 const bool expand_symlink =
true)
const
216 const uint64_t hardlink_group)
const;
219 uint64_t
MapUid(
const uint64_t uid)
const {
223 uint64_t
MapGid(
const uint64_t gid)
const {
285 const bool expand_symlink =
true)
const;
342 #endif // CVMFS_CATALOG_H_
InodeRange inode_range() const
PathString PlantPath(const PathString &path) const
const Counters & GetCounters() const
SqlAllChunks * sql_all_chunks_
NestedCatalogMap children_
bool AllChunksNext(shash::Any *hash, zlib::Algorithms *compression_alg)
HardlinkGroupMap hardlink_groups_
std::string database_path() const
uint64_t MapUid(const uint64_t uid) const
uint64_t revision() const
virtual ~InodeAnnotation()
const std::string & filename() const
CatalogDatabase * database_
NestedCatalogList nested_catalog_cache_
bool ListPathChunks(const PathString &path, const shash::Algorithms interpret_hashes_as, FileChunkList *chunks) const
Catalog(const PathString &mountpoint, const shash::Any &catalog_hash, Catalog *parent, const bool is_nested=false)
bool LookupXattrsMd5Path(const shash::Md5 &md5path, XattrList *xattrs) const
const OwnerMap * gid_map_
bool OpenDatabase(const std::string &db_path)
const OwnerMap * uid_map_
SqlOwnNestedCatalogListing * sql_own_list_nested_
PathString NormalizePath2(const PathString &path) const
bool LookupPath(const PathString &path, DirectoryEntry *dirent) const
static const shash::Md5 kMd5PathEmpty
std::map< PathString, Catalog * > NestedCatalogMap
bool ListingPath(const PathString &path, DirectoryEntryList *listing, const bool expand_symlink=true) const
bool IsInitialized() const
virtual inode_t Strip(const inode_t annotated_inode)=0
Catalog * FindSubtree(const PathString &path) const
virtual void InitPreparedStatements()
shash::Any GetPreviousRevision() const
assert((mem||(size==0))&&"Out Of Memory")
float schema_version() const
CatalogList GetChildren() const
bool InitStandalone(const std::string &database_file)
std::string PrintMemStatistics() const
bool ListMd5PathChunks(const shash::Md5 &md5path, const shash::Algorithms interpret_hashes_as, FileChunkList *chunks) const
bool OwnsDatabaseFile() const
Catalog * FindChild(const PathString &mountpoint) const
void SetInodeAnnotation(InodeAnnotation *new_annotation)
const NestedCatalogList & ListNestedCatalogs() const
SqlLookupXattrs * sql_lookup_xattrs_
bool ListingMd5Path(const shash::Md5 &md5path, DirectoryEntryList *listing, const bool expand_symlink=true) const
bool LookupEntry(const shash::Md5 &md5path, const bool expand_symlink, DirectoryEntry *dirent) const
IntegerMap< uint64_t > OwnerMap
void FinalizePreparedStatements()
SqlListing * sql_listing_
const shash::Any catalog_hash_
InodeAnnotation * inode_annotation_
bool GetVOMSAuthz(std::string *authz) const
std::vector< shash::Any > HashVector
uint64_t GetNumEntries() const
uint64_t GetRevision() const
bool IsAutogenerated() const
std::vector< DirectoryEntry > DirectoryEntryList
CatalogDatabase & database()
uint64_t GetLastModified() const
bool HasExplicitTTL() const
bool volatile_flag() const
virtual CatalogDatabase::OpenMode DatabaseOpenMode() const
void set_parent(Catalog *catalog)
bool LookupXattrsPath(const PathString &path, XattrList *xattrs) const
FRIEND_TEST(T_Catalog, NormalizePath)
SqlNestedCatalogListing * sql_list_nested_
const HashVector & GetReferencedObjects() const
bool LookupMd5Path(const shash::Md5 &md5path, DirectoryEntry *dirent) const
void AddChild(Catalog *child)
uint64_t max_row_id() const
virtual inode_t GetGeneration()=0
shash::Md5 NormalizePath(const PathString &path) const
void FixTransitionPoint(const shash::Md5 &md5path, DirectoryEntry *dirent) const
void ResetNestedCatalogCacheUnprotected()
bool ListingMd5PathStat(const shash::Md5 &md5path, StatEntryList *listing) const
PathString mountpoint() const
void TakeDatabaseFileOwnership()
SqlLookupPathHash * sql_lookup_md5path_
bool ListingPathStat(const PathString &path, StatEntryList *listing) const
std::map< uint64_t, inode_t > HardlinkGroupMap
void RemoveChild(Catalog *child)
PathString root_prefix() const
std::vector< Catalog * > CatalogList
bool is_regular_mountpoint_
bool IsInitialized() const
void set_inode_range(const InodeRange value)
std::string ToString() const
inode_t GetMangledInode(const uint64_t row_id, const uint64_t hardlink_group) const
std::vector< NestedCatalog > NestedCatalogList
const NestedCatalogList ListOwnNestedCatalogs() const
SqlChunksListing * sql_chunks_listing_
virtual inode_t Annotate(const inode_t raw_inode)=0
ShortString< kDefaultMaxPath, 0 > PathString
uint64_t GetNumChunks() const
void SetOwnerMaps(const OwnerMap *uid_map, const OwnerMap *gid_map)
HashVector referenced_hashes_
static Catalog * AttachFreely(const std::string &imaginary_mountpoint, const std::string &file, const shash::Any &catalog_hash, Catalog *parent=NULL, const bool is_nested=false)
const CatalogDatabase & database() const
bool FindNested(const PathString &mountpoint, shash::Any *hash, uint64_t *size) const
bool LookupRawSymlink(const PathString &path, LinkString *raw_symlink) const
virtual bool ValidInode(const uint64_t inode)=0
bool ReadCatalogCounters()
void DropDatabaseFileOwnership()
Counters & GetWritableCounters()
virtual void IncGeneration(const uint64_t by)=0
virtual bool IsWritable() const
bool ContainsInode(const inode_t inode) const
bool nested_catalog_cache_dirty_
SqlNestedCatalogLookup * sql_lookup_nested_
VomsAuthzStatus voms_authz_status_
static const uint64_t kDefaultTTL
uint64_t MapGid(const uint64_t gid) const