4 #ifndef CVMFS_CACHE_RAM_H_
5 #define CVMFS_CACHE_RAM_H_
67 "Number of GetSize calls");
69 "Number of Close calls");
71 "Number of Pread calls");
74 "Number of ReadAhead calls");
76 "Number of StartTxn calls");
78 "Number of Write calls");
80 "Number of Reset calls");
82 "Number of AbortTxn calls");
84 "Number of Commit calls");
86 "n_enfile",
"Number of times the limit on handles was reached");
88 "n_openregular",
"Number of opens from the regular cache");
90 "n_openvolatile",
"Number of opens from the volatile cache");
92 "Number of missed opens");
94 "Number of reallocs");
96 "n_overrun",
"Number of cache limit overruns");
98 "n_full",
"Number of overruns that could not be resolved");
106 unsigned max_entries,
123 virtual int Open(
const LabeledObject &
object);
131 virtual int64_t
GetSize(
int fd);
139 virtual int Close(
int fd);
148 virtual int64_t
Pread(
int fd,
void *buf, uint64_t
size, uint64_t offset);
158 virtual int Dup(
int fd);
191 virtual void CtrlTxn(
const Label &label,
const int flags,
void *txn);
200 virtual int64_t
Write(
const void *buf, uint64_t
size,
void *txn);
206 virtual int Reset(
void *txn);
281 int AddFd(
const ReadOnlyHandle &handle);
293 #endif // CVMFS_CACHE_RAM_H_
perf::Counter * n_aborttxn
perf::Counter * n_openmiss
virtual CacheManagerIds id()
RamCacheManager(uint64_t max_size, unsigned max_entries, MemoryKvStore::MemoryAllocator alloc, perf::StatisticsTemplate statistics)
perf::Counter * n_getsize
virtual int OpenFromTxn(void *txn)
virtual int Open(const LabeledObject &object)
static const shash::Any kInvalidHandle
bool operator==(const ReadOnlyHandle &other) const
virtual int Close(int fd)
perf::Counter * n_committxn
virtual int CommitTxn(void *txn)
MemoryKvStore * GetStore(const ReadOnlyHandle &fd)
Counters(perf::StatisticsTemplate statistics)
virtual int AbortTxn(void *txn)
perf::Counter * n_starttxn
MemoryKvStore * GetTransactionStore(Transaction *txn)
Counter * RegisterTemplated(const std::string &name_minor, const std::string &desc)
virtual void CtrlTxn(const Label &label, const int flags, void *txn)
virtual int StartTxn(const shash::Any &id, uint64_t size, void *txn)
virtual int64_t Pread(int fd, void *buf, uint64_t size, uint64_t offset)
virtual int Readahead(int fd)
FdTable< ReadOnlyHandle > fd_table_
perf::Counter * n_readahead
perf::Counter * n_overrun
perf::Counter * n_realloc
int AddFd(const ReadOnlyHandle &handle)
int64_t CommitToKvStore(Transaction *transaction)
perf::Counter * n_openregular
bool operator!=(const ReadOnlyHandle &other) const
ReadOnlyHandle(const shash::Any &h, bool v)
virtual int DoOpen(const shash::Any &id)
static const int kLabelVolatile
perf::Counter * n_openvolatile
virtual std::string Describe()
QuotaManager * quota_mgr()
virtual int64_t GetSize(int fd)
virtual int Reset(void *txn)
virtual ~RamCacheManager()
MemoryKvStore regular_entries_
MemoryKvStore volatile_entries_
virtual int64_t Write(const void *buf, uint64_t size, void *txn)
virtual bool AcquireQuotaManager(QuotaManager *quota_mgr)
virtual uint32_t SizeOfTxn()