#include <TestSwapDir.h>
Public Types | |
typedef RefCount< Disk > | Pointer |
Public Member Functions | |
TestSwapDir () | |
uint64_t | maxSize () const override |
uint64_t | currentSize () const override |
current size More... | |
uint64_t | currentCount () const override |
the total number of objects stored right now More... | |
void | stat (StoreEntry &) const override |
void | finalizeSwapoutSuccess (const StoreEntry &) override |
finalize the successful swapout that has been already noticed by Store More... | |
void | finalizeSwapoutFailure (StoreEntry &) override |
abort the failed swapout that has been already noticed by Store More... | |
void | reconfigure () override |
void | init () override |
bool | unlinkdUseful () const override |
whether SwapDir may benefit from unlinkd More... | |
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 More... | |
StoreIOState::Pointer | createStoreIO (StoreEntry &, StoreIOState::STIOCB *, void *) override |
StoreIOState::Pointer | openStoreIO (StoreEntry &, StoreIOState::STIOCB *, void *) override |
void | parse (int, char *) override |
void | evictCached (StoreEntry &) override |
void | evictIfFound (const cache_key *) override |
bool | hasReadableEntry (const StoreEntry &) const override |
whether this cache dir has an entry with e.key More... | |
bool | smpAware () const override |
whether this disk storage is capable of serving multiple workers More... | |
char const * | type () const |
virtual bool | needsDiskStrand () const |
needs a dedicated kid process More... | |
virtual bool | active () const |
virtual bool | doReportStat () const |
whether stat should be reported by this SwapDir More... | |
virtual void | diskFull () |
void | create () override |
create system resources needed for this store to operate in the future More... | |
StoreEntry * | get (const cache_key *) override |
uint64_t | minSize () const override |
the minimum size the store will shrink to via normal housekeeping More... | |
int64_t | maxObjectSize () const override |
the maximum size of a storable object; -1 if unlimited More... | |
void | maxObjectSize (int64_t newMax) |
void | getStats (StoreInfoStats &stats) const override |
collect statistics More... | |
void | reference (StoreEntry &e) override |
somebody needs this entry (many cache replacement policies need to know) More... | |
bool | dereference (StoreEntry &e) override |
void | maintain () override |
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain More... | |
int64_t | minObjectSize () const |
the size of the smallest entry this cache_dir can store More... | |
bool | objectSizeIsAcceptable (int64_t objSize) const |
virtual void | disconnect (StoreEntry &) |
called when the entry is about to forget its association with cache_dir More... | |
virtual void | dump (StoreEntry &) const |
virtual bool | doubleCheck (StoreEntry &) |
virtual void | statfs (StoreEntry &) const |
bool | canLog (StoreEntry const &e) const |
virtual void | openLog () |
virtual void | closeLog () |
virtual void | logEntry (const StoreEntry &e, int op) const |
virtual int | writeCleanStart () |
virtual void | writeCleanDone () |
virtual void | updateHeaders (StoreEntry *) |
make stored metadata and HTTP headers the same as in the given entry More... | |
virtual bool | anchorToCache (StoreEntry &) |
virtual bool | updateAnchored (StoreEntry &) |
virtual int | callback () |
called once every main loop iteration; TODO: Move to UFS code. More... | |
virtual void | sync () |
prepare for shutdown More... | |
Public Attributes | |
bool | statsCalled |
char * | path |
int | index |
int | disker |
disker kid id dedicated to this SwapDir or -1 More... | |
RemovalPolicy * | repl |
int | removals |
int | scanned |
struct Store::Disk::Flags | flags |
CleanLog * | cleanLog |
struct { | |
int blksize | |
} | fs |
Protected Member Functions | |
void | parseOptions (int reconfiguring) |
void | dumpOptions (StoreEntry *e) const |
virtual ConfigOption * | getOptionTree () const |
virtual bool | allowOptionReconfigure (const char *const) const |
int64_t | sizeInBlocks (const int64_t size) const |
Protected Attributes | |
uint64_t | max_size |
maximum allocatable size of the storage area More... | |
int64_t | min_objsize |
minimum size of any object stored here (-1 for no limit) More... | |
int64_t | max_objsize |
maximum size of any object stored here (-1 for no limit) More... | |
Private Member Functions | |
bool | optionReadOnlyParse (char const *option, const char *value, int reconfiguring) |
void | optionReadOnlyDump (StoreEntry *e) const |
bool | optionObjectSizeParse (char const *option, const char *value, int reconfiguring) |
void | optionObjectSizeDump (StoreEntry *e) const |
Private Attributes | |
char const * | theType |
Detailed Description
Definition at line 14 of file TestSwapDir.h.
Member Typedef Documentation
◆ Pointer
|
inherited |
Constructor & Destructor Documentation
◆ TestSwapDir()
|
inline |
Definition at line 18 of file TestSwapDir.h.
Member Function Documentation
◆ active()
|
virtualinherited |
may be used in this strand
Definition at line 236 of file Disk.cc.
References IamWorkerProcess(), and KidIdentifier.
Referenced by Store::Disks::anchorToCache(), and Store::Disk::doReportStat().
◆ allowOptionReconfigure()
|
inlineprotectedvirtualinherited |
Reimplemented in Rock::SwapDir.
Definition at line 85 of file Disk.h.
Referenced by Rock::SwapDir::allowOptionReconfigure().
◆ anchorToCache()
|
inlinevirtualinherited |
tie StoreEntry to this storage if this storage has a matching entry
- Return values
-
true if this storage has a matching entry
Reimplemented in Rock::SwapDir, MemStore, and Store::Disks.
Definition at line 39 of file Controlled.h.
Referenced by Store::Disks::anchorToCache().
◆ callback()
|
inlinevirtualinherited |
Reimplemented in Fs::Ufs::UFSSwapDir, Store::Controller, Store::Disks, and StoreControllerStub.
◆ canLog()
|
inherited |
Definition at line 188 of file Disk.cc.
References EBIT_TEST, ENTRY_SPECIAL, StoreEntry::flags, StoreEntry::hasDisk(), KEY_PRIVATE, RELEASE_REQUEST, StoreEntry::swap_file_sz, and StoreEntry::swappedOut().
◆ canStore()
|
overridevirtual |
Implements Store::Disk.
Definition at line 51 of file TestSwapDir.cc.
◆ closeLog()
|
virtualinherited |
Reimplemented in Fs::Ufs::UFSSwapDir.
Definition at line 215 of file Disk.cc.
Referenced by storeDirCloseSwapLogs().
◆ create()
|
overridevirtualinherited |
Implements Store::Storage.
◆ createStoreIO()
|
overridevirtual |
Implements Store::Disk.
Definition at line 58 of file TestSwapDir.cc.
◆ currentCount()
|
overridevirtual |
Implements Store::Storage.
Definition at line 25 of file TestSwapDir.cc.
◆ currentSize()
|
overridevirtual |
Implements Store::Storage.
Definition at line 19 of file TestSwapDir.cc.
◆ dereference()
|
overridevirtualinherited |
somebody no longer needs this entry (usually after calling reference()) return false iff the idle entry should be destroyed
Implements Store::Controlled.
Definition at line 139 of file Disk.cc.
Referenced by Store::Disks::dereference().
◆ disconnect()
|
inlinevirtualinherited |
Reimplemented in Rock::SwapDir.
Definition at line 71 of file Disk.h.
Referenced by destroyStoreEntry().
◆ diskFull()
|
virtualinherited |
Notify this disk that it is full. XXX move into a protected api call between store files and their stores, rather than a top level api call
Reimplemented in Rock::SwapDir.
Definition at line 145 of file Disk.cc.
References DBG_IMPORTANT, and debugs.
Referenced by storeSwapOutFileClosed().
◆ doReportStat()
|
inlinevirtualinherited |
Reimplemented in Rock::SwapDir.
Definition at line 35 of file Disk.h.
References Store::Disk::active().
◆ doubleCheck()
|
virtualinherited |
Reimplemented in Fs::Ufs::UFSSwapDir.
Definition at line 46 of file Disk.cc.
Referenced by storeCleanup().
◆ dump()
|
virtualinherited |
Reimplemented in Fs::Ufs::UFSSwapDir.
◆ dumpOptions()
|
protectedinherited |
Definition at line 307 of file Disk.cc.
References ConfigOption::dump().
◆ evictCached()
|
inlineoverridevirtual |
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
.
Implements Store::Storage.
Definition at line 36 of file TestSwapDir.h.
◆ evictIfFound()
|
inlineoverridevirtual |
An evictCached() equivalent for callers that did not get() a StoreEntry. Callers with StoreEntry objects must use evictCached() instead.
Implements Store::Storage.
Definition at line 37 of file TestSwapDir.h.
◆ finalizeSwapoutFailure()
|
inlineoverridevirtual |
Implements Store::Disk.
Definition at line 28 of file TestSwapDir.h.
◆ finalizeSwapoutSuccess()
|
inlineoverridevirtual |
Implements Store::Disk.
Definition at line 27 of file TestSwapDir.h.
◆ get()
|
overridevirtualinherited |
- 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).
Implements Store::Controlled.
◆ getOptionTree()
|
protectedvirtualinherited |
Reimplemented in Rock::SwapDir, and Fs::Ufs::UFSSwapDir.
Definition at line 258 of file Disk.cc.
References Store::Disk::optionObjectSizeDump(), Store::Disk::optionObjectSizeParse(), Store::Disk::optionReadOnlyDump(), Store::Disk::optionReadOnlyParse(), and ConfigOptionVector::options.
Referenced by Rock::SwapDir::getOptionTree(), and Fs::Ufs::UFSSwapDir::getOptionTree().
◆ getStats()
|
overridevirtualinherited |
◆ hasReadableEntry()
|
inlineoverridevirtual |
Implements Store::Disk.
Definition at line 38 of file TestSwapDir.h.
◆ init()
|
overridevirtual |
Start preparing the store for use. To check readiness, callers should use readable() and writable() methods.
Implements Store::Storage.
Definition at line 41 of file TestSwapDir.cc.
◆ logEntry()
|
virtualinherited |
Reimplemented in Fs::Ufs::UFSSwapDir.
Definition at line 227 of file Disk.cc.
Referenced by storeDirSwapLog().
◆ maintain()
|
overridevirtualinherited |
Implements Store::Storage.
◆ maxObjectSize() [1/2]
|
overridevirtualinherited |
Implements Store::Storage.
Definition at line 103 of file Disk.cc.
References Config, SquidConfig::maxObjectSize, min(), and SquidConfig::Store.
Referenced by Fs::Ufs::UFSStoreState::write().
◆ maxObjectSize() [2/2]
|
inherited |
configure the maximum object size for this storage area. May be any size up to the total storage area.
Definition at line 115 of file Disk.cc.
References DBG_PARSE_NOTE, and debugs.
◆ maxSize()
|
overridevirtual |
The maximum size the store will support in normal use. Inaccuracy is permitted, but may throw estimates for memory etc out of whack.
Reimplemented from Store::Disk.
Definition at line 13 of file TestSwapDir.cc.
◆ minObjectSize()
|
inherited |
Definition at line 96 of file Disk.cc.
References Config, SquidConfig::minObjectSize, and SquidConfig::Store.
◆ minSize()
|
overridevirtualinherited |
Implements Store::Storage.
Definition at line 89 of file Disk.cc.
References Config, SquidConfig::lowWaterMark, and SquidConfig::Swap.
◆ needsDiskStrand()
|
virtualinherited |
Reimplemented in Rock::SwapDir.
◆ objectSizeIsAcceptable()
|
inherited |
◆ openLog()
|
virtualinherited |
Reimplemented in Fs::Ufs::UFSSwapDir.
Definition at line 212 of file Disk.cc.
Referenced by storeDirOpenSwapLogs().
◆ openStoreIO()
|
overridevirtual |
Implements Store::Disk.
Definition at line 64 of file TestSwapDir.cc.
◆ optionObjectSizeDump()
|
privateinherited |
Definition at line 382 of file Disk.cc.
References PRId64, and storeAppendPrintf().
Referenced by Store::Disk::getOptionTree().
◆ optionObjectSizeParse()
|
privateinherited |
Definition at line 347 of file Disk.cc.
References DBG_IMPORTANT, debugs, self_destruct(), size, and strtoll().
Referenced by Store::Disk::getOptionTree().
◆ optionReadOnlyDump()
|
privateinherited |
Definition at line 340 of file Disk.cc.
References storeAppendPrintf().
Referenced by Store::Disk::getOptionTree().
◆ optionReadOnlyParse()
|
privateinherited |
Definition at line 318 of file Disk.cc.
References DBG_PARSE_NOTE, debugs, and xatoi().
Referenced by Store::Disk::getOptionTree().
◆ parse()
|
overridevirtual |
Implements Store::Disk.
Definition at line 70 of file TestSwapDir.cc.
◆ parseOptions()
|
protectedinherited |
Definition at line 267 of file Disk.cc.
References DBG_IMPORTANT, debugs, ConfigParser::NextToken(), ConfigOption::parse(), and self_destruct().
◆ reconfigure()
|
overridevirtual |
Implements Store::Disk.
Definition at line 37 of file TestSwapDir.cc.
◆ reference()
|
overridevirtualinherited |
Implements Store::Controlled.
Definition at line 136 of file Disk.cc.
Referenced by Store::Disks::reference().
◆ sizeInBlocks()
|
inlineprotectedinherited |
Definition at line 87 of file Disk.h.
References Store::Disk::fs, and size.
◆ smpAware()
|
inlineoverridevirtual |
Implements Store::Disk.
Definition at line 39 of file TestSwapDir.h.
◆ stat()
|
overridevirtual |
Output stats to the provided store entry. TODO: make these calls asynchronous
Reimplemented from Store::Disk.
Definition at line 31 of file TestSwapDir.cc.
References statsCalled.
◆ statfs()
|
virtualinherited |
Reimplemented in Fs::Ufs::UFSSwapDir, and Rock::SwapDir.
◆ sync()
|
inlinevirtualinherited |
Reimplemented in Fs::Ufs::UFSSwapDir, Store::Controller, and Store::Disks.
◆ type()
◆ unlinkdUseful()
|
overridevirtual |
Implements Store::Disk.
Definition at line 45 of file TestSwapDir.cc.
◆ updateAnchored()
|
inlinevirtualinherited |
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 Rock::SwapDir, MemStore, and Store::Disks.
Definition at line 44 of file Controlled.h.
Referenced by Store::Disks::updateAnchored().
◆ updateHeaders()
|
inlinevirtualinherited |
Reimplemented in Store::Disks, Rock::SwapDir, and MemStore.
Definition at line 35 of file Controlled.h.
Referenced by Store::Disks::updateHeaders().
◆ writeCleanDone()
|
virtualinherited |
Reimplemented in Fs::Ufs::UFSSwapDir.
Definition at line 224 of file Disk.cc.
Referenced by storeDirWriteCleanLogs().
◆ writeCleanStart()
|
virtualinherited |
Reimplemented in Fs::Ufs::UFSSwapDir.
Member Data Documentation
◆ blksize
◆ cleanLog
|
inherited |
Definition at line 140 of file Disk.h.
Referenced by UFSCleanLog::write().
◆ disker
◆ flags
|
inherited |
Referenced by storeDirSelectSwapDirLeastLoad().
◆
struct { ... } Store::Disk::fs |
Referenced by Store::Disk::Disk(), and Store::Disk::sizeInBlocks().
◆ index
|
inherited |
Definition at line 103 of file Disk.h.
Referenced by Fs::Ufs::UFSStoreState::UFSStoreState(), and Rock::Rebuild::Start().
◆ max_objsize
◆ max_size
|
protectedinherited |
Definition at line 97 of file Disk.h.
Referenced by Store::Disk::maxSize().
◆ min_objsize
◆ path
|
inherited |
Definition at line 102 of file Disk.h.
Referenced by Fs::Ufs::UFSSwapDir::DirClean(), Rock::Rebuild::Stats::Init(), and Rock::Rebuild::Start().
◆ removals
◆ repl
|
inherited |
◆ scanned
◆ statsCalled
bool TestSwapDir::statsCalled |
Definition at line 20 of file TestSwapDir.h.
Referenced by stat().
◆ theType
The documentation for this class was generated from the following files:
- src/tests/TestSwapDir.h
- src/tests/TestSwapDir.cc