9#ifndef SQUID_SRC_MEMSTORE_H
10#define SQUID_SRC_MEMSTORE_H
51 uint64_t
maxSize()
const override;
52 uint64_t
minSize()
const override;
Ipc::StoreMapItems< MemStoreMapExtraItem > MemStoreMapExtras
Ipc::StoreMap MemStoreMap
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.
temporary storage for slot and page ID pointers; for the waiting cache
Ipc::Mem::PageId * slot
local slot variable, waiting to be filled
Ipc::Mem::PageId * page
local page variable, waiting to be filled
bool updateAnchored(StoreEntry &) override
void anchorEntry(StoreEntry &e, const sfileno index, const Ipc::StoreMapAnchor &anchor)
anchors StoreEntry to an already locked map entry
void updateHeaders(StoreEntry *e) override
make stored metadata and HTTP headers the same as in the given entry
sfileno lastWritingSlice
the last allocate slice for writing a store entry (during copyToShm)
uint64_t currentCount() const override
the total number of objects stored right now
Ipc::Mem::Pointer< Extras > extras
IDs of pages with slice data.
Ipc::Mem::PageId pageForSlice(Ipc::StoreMapSliceId sliceId)
safely returns a previously allocated memory page for the given entry slice
bool anchorToCache(StoreEntry &) override
bool updateAnchoredWith(StoreEntry &, const sfileno, const Ipc::StoreMapAnchor &)
updates Transients entry after its anchor has been located
void copyToShmSlice(StoreEntry &e, Ipc::StoreMapAnchor &anchor, Ipc::StoreMap::Slice &slice)
copies at most one slice worth of local memory to shared memory
void disconnect(StoreEntry &e)
called when the entry is about to forget its association with mem cache
uint64_t minSize() const override
the minimum size the store will shrink to via normal housekeeping
bool shouldCache(StoreEntry &e) const
whether we should cache the entry
void evictCached(StoreEntry &) override
void copyFromShmSlice(StoreEntry &, const StoreIOBuffer &)
imports one shared memory slice into local memory
Ipc::Mem::Pointer< Ipc::Mem::PageStack > freeSlots
unused map slot IDs
SlotAndPage waitingFor
a cache for a single "hot" free slot and page
void completeWriting(StoreEntry &e)
all data has been received; there will be no more write() calls
void stat(StoreEntry &e) const override
uint64_t maxSize() const override
bool keepInLocalMemory(const StoreEntry &e) const
whether e should be kept in local RAM for possible future caching
StoreEntry * get(const cache_key *) override
void copyToShm(StoreEntry &e)
copies all local data to shared memory
int64_t maxObjectSize() const override
the maximum size of a storable object; -1 if unlimited
Ipc::StoreMap::Slice & nextAppendableSlice(const sfileno entryIndex, sfileno &sliceOffset)
static int64_t EntryLimit()
calculates maximum number of entries we need to store and map
sfileno reserveSapForWriting(Ipc::Mem::PageId &page)
finds a slot and a free page to fill or throws
void evictIfFound(const cache_key *) override
void reference(StoreEntry &e) override
somebody needs this entry (many cache replacement policies need to know)
static bool Enabled()
whether Squid is correctly configured to use a shared memory cache
void updateHeadersOrThrow(Ipc::StoreMapUpdate &update)
bool copyFromShm(StoreEntry &e, const sfileno index, const Ipc::StoreMapAnchor &anchor)
copies the entire entry from shared to local memory
bool dereference(StoreEntry &e) override
void write(StoreEntry &e)
copy non-shared entry data of the being-cached entry to our cache
uint64_t currentSize() const override
current size
void maintain() override
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
bool startCaching(StoreEntry &e)
locks map anchor and preps to store the entry in shared memory
void noteFreeMapSlice(const Ipc::StoreMapSliceId sliceId) override
adjust slice-linked state before a locked Readable slice is erased
MemStoreMap * map
index of mem-cached entries
void getStats(StoreInfoStats &stats) const override
collect statistics
void create() override
create system resources needed for this store to operate in the future
High-level store statistics used by mgr:info action. Used inside PODs!
unsigned char cache_key
Store key.