#include <Controlled.h>


Public Member Functions | |
virtual StoreEntry * | get (const cache_key *)=0 |
virtual void | reference (StoreEntry &e)=0 |
somebody needs this entry (many cache replacement policies need to know) More... | |
virtual bool | dereference (StoreEntry &e)=0 |
virtual void | updateHeaders (StoreEntry *) |
make stored metadata and HTTP headers the same as in the given entry More... | |
virtual bool | anchorToCache (StoreEntry &, bool &) |
virtual bool | updateAnchored (StoreEntry &) |
virtual void | create ()=0 |
create system resources needed for this store to operate in the future More... | |
virtual void | init ()=0 |
virtual uint64_t | maxSize () const =0 |
virtual uint64_t | minSize () const =0 |
the minimum size the store will shrink to via normal housekeeping More... | |
virtual uint64_t | currentSize () const =0 |
current size More... | |
virtual uint64_t | currentCount () const =0 |
the total number of objects stored right now More... | |
virtual int64_t | maxObjectSize () const =0 |
the maximum size of a storable object; -1 if unlimited More... | |
virtual void | getStats (StoreInfoStats &stats) const =0 |
collect statistics More... | |
virtual void | stat (StoreEntry &e) const =0 |
virtual void | evictCached (StoreEntry &e)=0 |
virtual void | evictIfFound (const cache_key *)=0 |
virtual int | callback () |
called once every main loop iteration; TODO: Move to UFS code. More... | |
virtual void | maintain ()=0 |
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain More... | |
virtual void | sync () |
prepare for shutdown More... | |
Detailed Description
Storage controlled by a Controller. This API is shared among Disks, Disk, Memory caches and Transients.
Definition at line 18 of file Controlled.h.
Member Function Documentation
◆ anchorToCache()
|
inlinevirtual |
If Transients entry cannot be attached to this storage, return false. If the entry is not found, return false. Otherwise, return true after tying the entry to this cache and setting inSync to updateAnchored().
Reimplemented in Rock::SwapDir, Store::Disks, and MemStore.
Definition at line 40 of file Controlled.h.
Referenced by Store::Disks::anchorToCache().
◆ callback()
|
inlinevirtualinherited |
Reimplemented in Store::Disks, Store::Controller, Fs::Ufs::UFSSwapDir, and TestStore.
◆ create()
|
pure virtualinherited |
Implemented in Transients, Store::Disks, Store::Disk, Store::Controller, MemStore, Fs::Ufs::UFSSwapDir, and Rock::SwapDir.
◆ currentCount()
|
pure virtualinherited |
Implemented in Transients, TestSwapDir, Store::Disks, Store::Controller, MemStore, Fs::Ufs::UFSSwapDir, TestStore, and Rock::SwapDir.
◆ currentSize()
|
pure virtualinherited |
Implemented in Transients, TestSwapDir, Store::Disks, Store::Controller, MemStore, Fs::Ufs::UFSSwapDir, TestStore, and Rock::SwapDir.
◆ dereference()
|
pure virtual |
somebody no longer needs this entry (usually after calling reference()) return false iff the idle entry should be destroyed
Implemented in Transients, Store::Disks, Store::Disk, MemStore, Rock::SwapDir, and Fs::Ufs::UFSSwapDir.
◆ evictCached()
|
pure virtualinherited |
Prevent new get() calls from returning the matching entry. If the matching entry is unused, it may be removed from the store now. The store entry is matched using either e
attachment info or e.key
.
Implemented in Transients, TestSwapDir, Store::Disks, Store::Controller, MemStore, Fs::Ufs::UFSSwapDir, and Rock::SwapDir.
Referenced by Store::Disks::evictCached().
◆ evictIfFound()
|
pure virtualinherited |
An evictCached() equivalent for callers that did not get() a StoreEntry. Callers with StoreEntry objects must use evictCached() instead.
Implemented in Transients, TestSwapDir, Store::Disks, Store::Controller, MemStore, Fs::Ufs::UFSSwapDir, and Rock::SwapDir.
◆ get()
|
pure virtual |
- Returns
- a possibly unlocked/unregistered stored entry with key (or nil) The returned entry might not match the caller's Store ID or method. The caller must abandon()/release() the entry or register it with Root(). This method must not trigger slow I/O operations (e.g., disk swap in).
Implemented in Rock::SwapDir, Transients, Store::Disks, Store::Disk, and MemStore.
◆ getStats()
|
pure virtualinherited |
Implemented in Transients, Store::Disks, Store::Disk, Store::Controller, MemStore, and TestStore.
◆ init()
|
pure virtualinherited |
Start preparing the store for use. To check readiness, callers should use readable() and writable() methods.
Implemented in Transients, TestSwapDir, Store::Disks, Store::Controller, MemStore, Fs::Ufs::UFSSwapDir, TestStore, and Rock::SwapDir.
◆ maintain()
|
pure virtualinherited |
Implemented in Transients, Store::Disks, Store::Disk, Store::Controller, MemStore, Fs::Ufs::UFSSwapDir, TestStore, and Rock::SwapDir.
◆ maxObjectSize()
|
pure virtualinherited |
Implemented in Transients, Store::Disks, Store::Disk, Store::Controller, MemStore, and TestStore.
◆ maxSize()
|
pure virtualinherited |
The maximum size the store will support in normal use. Inaccuracy is permitted, but may throw estimates for memory etc out of whack.
Implemented in Transients, TestSwapDir, Store::Disks, Store::Disk, Store::Controller, MemStore, and TestStore.
◆ minSize()
|
pure virtualinherited |
Implemented in Transients, Store::Disks, Store::Disk, Store::Controller, MemStore, and TestStore.
◆ reference()
|
pure virtual |
Implemented in Transients, Store::Disk, MemStore, Rock::SwapDir, Store::Disks, and Fs::Ufs::UFSSwapDir.
◆ stat()
|
pure virtualinherited |
Output stats to the provided store entry. TODO: make these calls asynchronous
Implemented in Transients, MemStore, TestSwapDir, Store::Disks, Store::Disk, Store::Controller, and TestStore.
◆ sync()
|
inlinevirtualinherited |
Reimplemented in Store::Disks, Store::Controller, and Fs::Ufs::UFSSwapDir.
◆ updateAnchored()
|
inlinevirtual |
Update a local Transients entry with fresh info from this cache (if any). Return true iff the cache supports Transients entries and the given local Transients entry is now in sync with this storage.
Reimplemented in Store::Disks, MemStore, and Rock::SwapDir.
Definition at line 45 of file Controlled.h.
Referenced by Store::Disks::updateAnchored().
◆ updateHeaders()
|
inlinevirtual |
Reimplemented in MemStore, Rock::SwapDir, and Store::Disks.
Definition at line 35 of file Controlled.h.
Referenced by Store::Disks::updateHeaders().
The documentation for this class was generated from the following file:
- src/store/Controlled.h