9#ifndef SQUID_SRC_FS_ROCK_ROCKSWAPDIR_H
10#define SQUID_SRC_FS_ROCK_ROCKSWAPDIR_H
54 bool smpAware()
const override {
return true; }
generally useful configuration options supported by some children
Shared memory page identifier, address, or handler.
API for adjusting external state when dirty map slice is being freed.
Aggregates information required for updating entry metadata and headers.
initializes shared memory segments used by Rock::SwapDir
void create() override
called when the runner should create a new memory segment
std::vector< SwapDir::DirMap::Owner * > mapOwners
std::vector< Ipc::Mem::Owner< Rebuild::Stats > * > rebuildStatsOwners
std::vector< Ipc::Mem::Owner< Ipc::Mem::PageStack > * > freeSlotsOwners
int64_t slotLimitAbsolute() const
Rock store implementation limit.
void readCompleted(const char *buf, int len, int errflag, RefCount< ::ReadRequest >) override
void handleWriteCompletionProblem(const int errflag, const WriteRequest &request)
code shared by writeCompleted() error handling cases
int64_t slotLimitActual() const
total number of slots in this db
void dumpSizeOption(StoreEntry *e) const
reports size-specific options; mimics SwapDir::optionObjectSizeDump()
uint64_t slotSize
all db slots are of this size
bool doReportStat() const override
StoreEntry * get(const cache_key *key) override
int64_t diskOffset(int filen) const
void updateHeaders(StoreEntry *e) override
make stored metadata and HTTP headers the same as in the given entry
bool anchorToCache(StoreEntry &) override
SBuf inodeMapPath() const
Ipc::Mem::Pointer< Ipc::Mem::PageStack > freeSlots
all unused slots
bool allowOptionReconfigure(const char *const option) const override
void reconfigure() override
void disconnect(StoreEntry &e) override
called when the entry is about to forget its association with cache_dir
DiskFile::Config fileConfig
file-level configuration options
void parseSize(const bool reconfiguring)
parses anonymous cache_dir size option
ConfigOption * getOptionTree() const override
bool parseTimeOption(char const *option, const char *value, int reconfiguring)
parses time-specific options; mimics SwapDir::optionObjectSizeParse()
void validateOptions()
warns of configuration problems; may quit
const char * filePath
location of cache storage file inside path/
RefCount< DiskFile > theFile
cache storage for this cache_dir
void handleWriteCompletionSuccess(const WriteRequest &request)
code shared by writeCompleted() success handling cases
bool parseRateOption(char const *option, const char *value, int reconfiguring)
parses rate-specific options; mimics SwapDir::optionObjectSizeParse()
void purgeSome()
purges one or more entries to make full() false and free some slots
bool unlinkdUseful() const override
whether SwapDir may benefit from unlinkd
const char * freeSlotsPath() const
bool full() const
no more entries can be stored without purging
StoreIOState::Pointer createStoreIO(StoreEntry &, StoreIOState::STIOCB *, void *) override
void evictCached(StoreEntry &) override
void finalizeSwapoutSuccess(const StoreEntry &) override
finalize the successful swapout that has been already noticed by Store
int64_t diskOffset(Ipc::Mem::PageId &pageId) const
static const int64_t HeaderSize
on-disk db header size
bool updateAnchored(StoreEntry &) override
bool dereference(StoreEntry &e) override
int64_t entryLimitAbsolute() const
Core limit.
bool hasReadableEntry(const StoreEntry &) const override
whether this cache dir has an entry with e.key
void reference(StoreEntry &e) override
somebody needs this entry (many cache replacement policies need to know)
void writeCompleted(int errflag, size_t len, RefCount< ::WriteRequest >) override
bool needsDiskStrand() const override
needs a dedicated kid process
bool validSlotId(const SlotId slotId) const
whether the given slot ID may point to a slot in this db
void ignoreReferences(StoreEntry &e)
delete from repl policy scope
void finalizeSwapoutFailure(StoreEntry &) override
abort the failed swapout that has been already noticed by Store
bool canStore(const StoreEntry &e, int64_t diskSpaceNeeded, int &load) const override
check whether we can store the entry; if we can, report current load
DirMap * map
entry key/sfileno to MaxExtras/inode mapping
void noteFreeMapSlice(const Ipc::StoreMapSliceId fileno) override
adjust slice-linked state before a locked Readable slice is erased
uint64_t currentCount() const override
the total number of objects stored right now
int64_t diskOffsetLimit() const
bool smpAware() const override
whether this disk storage is capable of serving multiple workers
void trackReferences(StoreEntry &e)
add to replacement policy scope
StoreIOState::Pointer openStoreIO(StoreEntry &, StoreIOState::STIOCB *, void *) override
void closeCompleted() override
Ipc::Mem::PageId * waitingForPage
one-page cache for a "hot" free slot
void maintain() override
purge while full(); it should be sufficient to purge just one
void dumpRateOption(StoreEntry *e) const
reports rate-specific options; mimics SwapDir::optionObjectSizeDump()
void createError(const char *const msg)
void ioCompletedNotification() override
StoreIOState::Pointer createUpdateIO(const Ipc::StoreMapUpdate &, StoreIOState::STIOCB *, void *)
void parse(int index, char *path) override
void anchorEntry(StoreEntry &e, const sfileno filen, const Ipc::StoreMapAnchor &anchor)
void dumpTimeOption(StoreEntry *e) const
reports time-specific options; mimics SwapDir::optionObjectSizeDump()
void writeError(StoreIOState &sio)
uint64_t currentSize() const override
current size
bool parseSizeOption(char const *option, const char *value, int reconfiguring)
parses size-specific options; mimics SwapDir::optionObjectSizeParse()
SlotId reserveSlotForWriting()
finds and returns a free db slot to fill or throws
int64_t entryLimitActual() const
max number of possible entries in db
void updateHeadersOrThrow(Ipc::StoreMapUpdate &update)
RefCount< SwapDir > Pointer
void create() override
create system resources needed for this store to operate in the future
void evictIfFound(const cache_key *) override
void statfs(StoreEntry &e) const override
void STIOCB(void *their_data, int errflag, StoreIOState::Pointer self)
manages a single cache_dir
sfileno SlotId
db cell number, starting with cell 0 (always occupied by the db header)
unsigned char cache_key
Store key.