16 #ifndef CVMFS_CATALOG_SQL_H_
17 #define CVMFS_CATALOG_SQL_H_
19 #ifndef __STDC_FORMAT_MACROS
20 #define __STDC_FORMAT_MACROS
50 const bool volatile_content,
51 const std::string &voms_authz,
103 const int idx_column,
112 const unsigned char *buffer =
static_cast<const unsigned char *
>(
115 return (byte_count > 0) ?
shash::Any(hash_algo, buffer, hash_suffix)
123 const int idx_column,
126 const std::string hash_string = std::string(reinterpret_cast<const char *>(
138 inline bool BindMd5(
const int idx_high,
const int idx_low,
143 const bool retval =
BindInt64(idx_high, static_cast<int64_t>(high)) &&
144 BindInt64(idx_low, static_cast<int64_t>(low));
239 const uint32_t linkcount)
const;
264 const int hardlinks_idx,
268 const int mtimens_idx,
271 const int symlink_idx,
299 const bool expand_symlink =
true)
const;
599 #endif // CVMFS_CATALOG_SQL_H_
PathString GetPath() const
bool BindSearchPath(const PathString &path)
static const int kFlagDirNestedMountpoint
bool BindPathHash(const shash::Md5 &hash)
bool BindCounter(const std::string &counter)
shash::Any GetHash() const
SqlAllChunks(const CatalogDatabase &database)
uint32_t GetMaxGroupId() const
shash::Md5 GetPathHash() const
SqlListing(const CatalogDatabase &database)
static const int kFlagPosCompression
SqlIncLinkcount(const CatalogDatabase &database)
bool BindDirentBase(const DirectoryEntryBase &entry)
const std::string & filename() const
shash::Algorithms RetrieveHashAlgorithm(const unsigned flags) const
bool Init(const sqlite3 *database, const std::string &statement)
PathString GetPath() const
static const int kFlagDirNestedRoot
bool BindPathHash(const shash::Md5 &hash)
bool CreateEmptyDatabase()
SqlLookupPathHash(const CatalogDatabase &database)
bool BindDirent(const DirectoryEntry &entry)
void ToIntPair(uint64_t *lo, uint64_t *hi) const
bool BindRowId(const uint64_t inode)
SqlCreateCounter(const CatalogDatabase &database)
const void * RetrieveBlob(const int idx_column) const
shash::Any GetContentHash() const
bool BindDirentFields(const int hash_idx, const int hardlinks_idx, const int size_idx, const int mode_idx, const int mtime_idx, const int mtimens_idx, const int flags_idx, const int name_idx, const int symlink_idx, const int uid_idx, const int gid_idx, const DirectoryEntry &entry)
bool BindFileChunk(const FileChunk &chunk)
SqlUpdateCounter(const CatalogDatabase &database)
bool BindPathHash(const shash::Md5 &hash)
static const int kFlagPosHash
SqlGetCounter(const CatalogDatabase &database)
SqlCatalog(const CatalogDatabase &database, const std::string &statement)
DirectoryEntry GetDirent(const Catalog *catalog, const bool expand_symlink=true) const
shash::Md5 RetrieveMd5(const int idx_high, const int idx_low) const
SqlDirentInsert(const CatalogDatabase &database)
SqlLookupInode(const CatalogDatabase &database)
bool BindPathHash(const shash::Md5 &hash)
bool LiveSchemaUpgradeIfNecessary()
uint32_t Hardlinks2HardlinkGroup(const uint64_t hardlinks) const
SqlListContentHashes(const CatalogDatabase &database)
Database(const std::string &filename, const OpenMode open_mode)
static const int kFlagFileChunk
SqlNestedCatalogListing(const CatalogDatabase &database)
shash::Any GetContentHash() const
bool BindPathHash(const shash::Md5 &hash)
SqlChunksListing(const CatalogDatabase &database)
int GetChunkCount() const
static const int kFlagFile
uint64_t GetCounter() const
unsigned char digest[digest_size_]
static const int kFlagLink
bool BindCounter(const std::string &counter)
bool BindPathHash(const shash::Md5 &hash)
bool BindXattr(const XattrList &xattrs)
zlib::Algorithms RetrieveCompressionAlgorithm(const unsigned flags) const
bool BindCounter(const std::string &counter)
bool BindDelta(const int delta)
unsigned GetDigestSize() const
static const int kFlagDirBindMountpoint
bool BindPathHash(const shash::Md5 &hash)
SqlChunksRemove(const CatalogDatabase &database)
bool CheckSchemaCompatibility()
bool Next(shash::Any *hash, zlib::Algorithms *compression_alg)
SqlOwnNestedCatalogListing(const CatalogDatabase &database)
static const int kFlagFileSpecial
static const int kFlagFileExternal
SqlDirentTouch(const CatalogDatabase &database)
bool BindHashBlob(const int idx_column, const shash::Any &hash)
bool BindXattr(const XattrList &xattrs)
bool InsertInitialValues(const std::string &root_path, const bool volatile_content, const std::string &voms_authz, const DirectoryEntry &root_entry=DirectoryEntry(kDirentNegative))
SqlNestedCatalogLookup(const CatalogDatabase &database)
sqlite3_int64 RetrieveInt64(const int idx_column) const
bool BindBlob(const int index, const void *value, const unsigned size)
bool SetVOMSAuthz(const std::string &)
uint64_t MakeHardlinks(const uint32_t hardlink_group, const uint32_t linkcount) const
SqlDirentUnlink(const CatalogDatabase &database)
bool BindPathHash(const shash::Md5 &hash)
bool BindPathHash(const struct shash::Md5 &hash)
static const int kFlagDirectIo
SqlDirentUpdate(const CatalogDatabase &database)
sqlite3 * sqlite_db() const
static const float kLatestSchema
bool BindInt64(const int index, const sqlite3_int64 value)
bool BindPathHash(const struct shash::Md5 &hash)
shash::Any RetrieveHashBlob(const int idx_column, const shash::Algorithms hash_algo, const char hash_suffix=shash::kSuffixNone) const
shash::Any RetrieveHashHex(const int idx_column, const char hash_suffix=shash::kSuffixNone) const
bool CompactDatabase() const
const unsigned char * RetrieveText(const int idx_column) const
SqlLookupDanglingMountpoints(const CatalogDatabase &database)
shash::Any GetContentHash() const
FileChunk GetFileChunk(const shash::Algorithms interpret_hash_as) const
virtual bool BindDirent(const DirectoryEntry &entry)=0
SqlLookupXattrs(const CatalogDatabase &database)
SqlChunkInsert(const CatalogDatabase &database)
static const int kFlagHidden
Any MkFromHexPtr(const HexPtr hex, const char suffix)
uint32_t Hardlinks2Linkcount(const uint64_t hardlinks) const
shash::Md5 GetParentPathHash() const
static const float kLatestSupportedSchema
SqlMaxHardlinkGroup(const CatalogDatabase &database)
double GetRowIdWasteRatio() const
unsigned CreateDatabaseFlags(const DirectoryEntry &entry) const
bool BindDelta(const int64_t delta)
bool BindMd5(const int idx_high, const int idx_low, const shash::Md5 &hash)
bool BindNull(const int index)
bool BindParentPathHash(const shash::Md5 &hash)
static const unsigned kLatestSchemaRevision
static const int kFlagDir
CatalogDatabase(const std::string &filename, const OpenMode open_mode)
bool BindInitialValue(const int64_t value)
bool BindPathHash(const shash::Md5 &hash)
SqlChunksCount(const CatalogDatabase &database)
int RetrieveBytes(const int idx_column) const
bool BindPathHash(const shash::Md5 &hash)
bool BindDirent(const DirectoryEntry &entry)
void StoreHashAlgorithm(const shash::Algorithms algo, unsigned *flags) const
void ExpandSymlink(LinkString *raw_symlink) const