8 #ifndef __STDC_FORMAT_MACROS
9 #define __STDC_FORMAT_MACROS
112 return "file catalog at " +
path;
114 return "certificate for " +
path;
116 return "metainfo for " +
path;
118 return "tag database for " +
path;
120 return "Part of " +
path;
166 virtual int64_t
GetSize(
int fd) = 0;
167 virtual int Close(
int fd) = 0;
168 virtual int64_t
Pread(
int fd,
void *buf, uint64_t
size, uint64_t offset) = 0;
169 virtual int Dup(
int fd) = 0;
177 virtual int64_t
Write(
const void *buf, uint64_t sz,
void *txn) = 0;
178 virtual int Reset(
void *txn) = 0;
179 virtual int AbortTxn(
void *txn) = 0;
183 virtual void Spawn() = 0;
188 unsigned char **buffer, uint64_t *
size);
190 const unsigned char *buffer,
191 const uint64_t
size);
206 void FreeState(
const int fd_progress,
void *state);
208 return static_cast<State *
>(state)->manager_type;
257 #endif // CVMFS_CACHE_H_
LabeledObject(const shash::Any &id, const Label &l)
int ChecksumFd(int fd, shash::Any *id)
virtual int64_t GetSize(int fd)=0
std::string GetDescription() const
int RestoreState(const int fd_progress, void *state)
static const int kLabelCatalog
static const int kLabelMetainfo
bool IsCertificate() const
int OpenPinned(const LabeledObject &object)
CacheManagerIds manager_type
virtual manifest::Breadcrumb LoadBreadcrumb(const std::string &)
void * SaveState(const int fd_progress)
LabeledObject(const shash::Any &id)
virtual int AbortTxn(void *txn)=0
static const int kLabelHistory
virtual bool StoreBreadcrumb(const manifest::Manifest &)
virtual void * DoSaveState()
virtual bool DoFreeState(void *data)
virtual CacheManagerIds id()=0
virtual int Open(const LabeledObject &object)=0
virtual int DoRestoreState(void *data)
virtual int CommitTxn(void *txn)=0
uint64_t size
unzipped size, if known
virtual int OpenFromTxn(void *txn)=0
static const int kLabelCertificate
bool CommitFromMem(const LabeledObject &object, const unsigned char *buffer, const uint64_t size)
static const int kLabelPinned
virtual int Close(int fd)=0
CacheManagerIds PeekState(void *state)
static const int kLabelVolatile
virtual int Reset(void *txn)=0
static const unsigned kStateVersion
void FreeState(const int fd_progress, void *state)
zlib::Algorithms zip_algorithm
virtual void CtrlTxn(const Label &label, const int flags, void *txn)=0
QuotaManager * quota_mgr()
QuotaManager * quota_mgr_
virtual uint32_t SizeOfTxn()=0
virtual int Dup(int fd)=0
virtual int Readahead(int fd)=0
bool Open2Mem(const LabeledObject &object, unsigned char **buffer, uint64_t *size)
static const int kLabelExternal
virtual bool AcquireQuotaManager(QuotaManager *quota_mgr)=0
static const int kLabelChunked
virtual int StartTxn(const shash::Any &id, uint64_t size, void *txn)=0
virtual int64_t Pread(int fd, void *buf, uint64_t size, uint64_t offset)=0
virtual std::string Describe()=0
virtual int64_t Write(const void *buf, uint64_t sz, void *txn)=0
static const uint64_t kSizeUnknown