#include <TestSwapDir.h>

Inheritance diagram for TestSwapDir:
Collaboration diagram for TestSwapDir:

Public Types

typedef RefCount< DiskPointer
 

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...
 
StoreEntryget (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...
 
RemovalPolicyrepl
 
int removals
 
int scanned
 
struct Store::Disk::Flags flags
 
CleanLogcleanLog
 
struct {
   int   blksize
 
fs
 

Protected Member Functions

void parseOptions (int reconfiguring)
 
void dumpOptions (StoreEntry *e) const
 
virtual ConfigOptiongetOptionTree () 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

typedef RefCount<Disk> Store::Disk::Pointer
inherited

Definition at line 25 of file Disk.h.

Constructor & Destructor Documentation

◆ TestSwapDir()

TestSwapDir::TestSwapDir ( )
inline

Definition at line 18 of file TestSwapDir.h.

Member Function Documentation

◆ active()

bool Store::Disk::active ( ) const
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()

virtual bool Store::Disk::allowOptionReconfigure ( const char * const  ) const
inlineprotectedvirtualinherited

Reimplemented in Rock::SwapDir.

Definition at line 85 of file Disk.h.

Referenced by Rock::SwapDir::allowOptionReconfigure().

◆ anchorToCache()

virtual bool Store::Controlled::anchorToCache ( StoreEntry )
inlinevirtualinherited

tie StoreEntry to this storage if this storage has a matching entry

Return values
trueif 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()

virtual int Store::Storage::callback ( )
inlinevirtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir, Store::Controller, Store::Disks, and StoreControllerStub.

Definition at line 72 of file Storage.h.

◆ canLog()

bool Store::Disk::canLog ( StoreEntry const &  e) const
inherited

◆ canStore()

bool TestSwapDir::canStore ( const StoreEntry e,
int64_t  diskSpaceNeeded,
int load 
) const
overridevirtual

Implements Store::Disk.

Definition at line 51 of file TestSwapDir.cc.

◆ closeLog()

void Store::Disk::closeLog ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 215 of file Disk.cc.

Referenced by storeDirCloseSwapLogs().

◆ create()

void Store::Disk::create ( )
overridevirtualinherited

Implements Store::Storage.

Definition at line 40 of file Disk.cc.

◆ createStoreIO()

StoreIOState::Pointer TestSwapDir::createStoreIO ( StoreEntry ,
StoreIOState::STIOCB ,
void *   
)
overridevirtual

Implements Store::Disk.

Definition at line 58 of file TestSwapDir.cc.

◆ currentCount()

uint64_t TestSwapDir::currentCount ( ) const
overridevirtual

Implements Store::Storage.

Definition at line 25 of file TestSwapDir.cc.

◆ currentSize()

uint64_t TestSwapDir::currentSize ( ) const
overridevirtual

Implements Store::Storage.

Definition at line 19 of file TestSwapDir.cc.

◆ dereference()

bool Store::Disk::dereference ( StoreEntry e)
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()

virtual void Store::Disk::disconnect ( StoreEntry )
inlinevirtualinherited

Reimplemented in Rock::SwapDir.

Definition at line 71 of file Disk.h.

Referenced by destroyStoreEntry().

◆ diskFull()

void Store::Disk::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()

virtual bool Store::Disk::doReportStat ( ) const
inlinevirtualinherited

Reimplemented in Rock::SwapDir.

Definition at line 35 of file Disk.h.

References Store::Disk::active().

◆ doubleCheck()

bool Store::Disk::doubleCheck ( StoreEntry )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 46 of file Disk.cc.

Referenced by storeCleanup().

◆ dump()

void Store::Disk::dump ( StoreEntry ) const
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 43 of file Disk.cc.

◆ dumpOptions()

void Store::Disk::dumpOptions ( StoreEntry e) const
protectedinherited

Definition at line 307 of file Disk.cc.

References ConfigOption::dump().

◆ evictCached()

void TestSwapDir::evictCached ( StoreEntry e)
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()

void TestSwapDir::evictIfFound ( const cache_key )
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()

void TestSwapDir::finalizeSwapoutFailure ( StoreEntry )
inlineoverridevirtual

Implements Store::Disk.

Definition at line 28 of file TestSwapDir.h.

◆ finalizeSwapoutSuccess()

void TestSwapDir::finalizeSwapoutSuccess ( const StoreEntry )
inlineoverridevirtual

Implements Store::Disk.

Definition at line 27 of file TestSwapDir.h.

◆ get()

StoreEntry * Store::Disk::get ( const cache_key )
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.

Definition at line 393 of file Disk.cc.

◆ getOptionTree()

◆ getStats()

void Store::Disk::getStats ( StoreInfoStats stats) const
overridevirtualinherited

Implements Store::Storage.

Definition at line 52 of file Disk.cc.

References Ping::stats.

◆ hasReadableEntry()

bool TestSwapDir::hasReadableEntry ( const StoreEntry e) const
inlineoverridevirtual

Implements Store::Disk.

Definition at line 38 of file TestSwapDir.h.

◆ init()

void TestSwapDir::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()

void Store::Disk::logEntry ( const StoreEntry e,
int  op 
) const
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 227 of file Disk.cc.

Referenced by storeDirSwapLog().

◆ maintain()

void Store::Disk::maintain ( )
overridevirtualinherited

Implements Store::Storage.

Definition at line 86 of file Disk.cc.

◆ maxObjectSize() [1/2]

int64_t Store::Disk::maxObjectSize ( ) const
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]

void Store::Disk::maxObjectSize ( int64_t  newMax)
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()

uint64_t TestSwapDir::maxSize ( ) const
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()

int64_t Store::Disk::minObjectSize ( ) const
inherited

Definition at line 96 of file Disk.cc.

References Config, SquidConfig::minObjectSize, and SquidConfig::Store.

◆ minSize()

uint64_t Store::Disk::minSize ( ) const
overridevirtualinherited

Implements Store::Storage.

Definition at line 89 of file Disk.cc.

References Config, SquidConfig::lowWaterMark, and SquidConfig::Swap.

◆ needsDiskStrand()

bool Store::Disk::needsDiskStrand ( ) const
virtualinherited

Reimplemented in Rock::SwapDir.

Definition at line 249 of file Disk.cc.

◆ objectSizeIsAcceptable()

bool Store::Disk::objectSizeIsAcceptable ( int64_t  objSize) const
inherited

whether we can store an object of the given size negative objSize means the object size is currently unknown

Definition at line 156 of file Disk.cc.

References assert.

◆ openLog()

void Store::Disk::openLog ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 212 of file Disk.cc.

Referenced by storeDirOpenSwapLogs().

◆ openStoreIO()

StoreIOState::Pointer TestSwapDir::openStoreIO ( StoreEntry ,
StoreIOState::STIOCB ,
void *   
)
overridevirtual

Implements Store::Disk.

Definition at line 64 of file TestSwapDir.cc.

◆ optionObjectSizeDump()

void Store::Disk::optionObjectSizeDump ( StoreEntry e) const
privateinherited

Definition at line 382 of file Disk.cc.

References PRId64, and storeAppendPrintf().

Referenced by Store::Disk::getOptionTree().

◆ optionObjectSizeParse()

bool Store::Disk::optionObjectSizeParse ( char const *  option,
const char *  value,
int  reconfiguring 
)
privateinherited

Definition at line 347 of file Disk.cc.

References DBG_IMPORTANT, debugs, self_destruct(), size, and strtoll().

Referenced by Store::Disk::getOptionTree().

◆ optionReadOnlyDump()

void Store::Disk::optionReadOnlyDump ( StoreEntry e) const
privateinherited

Definition at line 340 of file Disk.cc.

References storeAppendPrintf().

Referenced by Store::Disk::getOptionTree().

◆ optionReadOnlyParse()

bool Store::Disk::optionReadOnlyParse ( char const *  option,
const char *  value,
int  reconfiguring 
)
privateinherited

Definition at line 318 of file Disk.cc.

References DBG_PARSE_NOTE, debugs, and xatoi().

Referenced by Store::Disk::getOptionTree().

◆ parse()

void TestSwapDir::parse ( int  ,
char *   
)
overridevirtual

Implements Store::Disk.

Definition at line 70 of file TestSwapDir.cc.

◆ parseOptions()

void Store::Disk::parseOptions ( int  reconfiguring)
protectedinherited

◆ reconfigure()

void TestSwapDir::reconfigure ( )
overridevirtual

Implements Store::Disk.

Definition at line 37 of file TestSwapDir.cc.

◆ reference()

void Store::Disk::reference ( StoreEntry e)
overridevirtualinherited

Implements Store::Controlled.

Definition at line 136 of file Disk.cc.

Referenced by Store::Disks::reference().

◆ sizeInBlocks()

int64_t Store::Disk::sizeInBlocks ( const int64_t  size) const
inlineprotectedinherited

Definition at line 87 of file Disk.h.

References Store::Disk::fs, and size.

◆ smpAware()

bool TestSwapDir::smpAware ( ) const
inlineoverridevirtual

Implements Store::Disk.

Definition at line 39 of file TestSwapDir.h.

◆ stat()

void TestSwapDir::stat ( StoreEntry e) const
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()

void Store::Disk::statfs ( StoreEntry ) const
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir, and Rock::SwapDir.

Definition at line 83 of file Disk.cc.

◆ sync()

virtual void Store::Storage::sync ( void  )
inlinevirtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir, Store::Controller, and Store::Disks.

Definition at line 78 of file Storage.h.

◆ type()

char const * Store::Disk::type ( ) const
inherited

Definition at line 230 of file Disk.cc.

◆ unlinkdUseful()

bool TestSwapDir::unlinkdUseful ( ) const
overridevirtual

Implements Store::Disk.

Definition at line 45 of file TestSwapDir.cc.

◆ updateAnchored()

virtual bool Store::Controlled::updateAnchored ( StoreEntry )
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()

virtual void Store::Controlled::updateHeaders ( StoreEntry )
inlinevirtualinherited

Reimplemented in Store::Disks, Rock::SwapDir, and MemStore.

Definition at line 35 of file Controlled.h.

Referenced by Store::Disks::updateHeaders().

◆ writeCleanDone()

void Store::Disk::writeCleanDone ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 224 of file Disk.cc.

Referenced by storeDirWriteCleanLogs().

◆ writeCleanStart()

int Store::Disk::writeCleanStart ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 218 of file Disk.cc.

Member Data Documentation

◆ blksize

int Store::Disk::blksize
inherited

Definition at line 146 of file Disk.h.

◆ cleanLog

CleanLog* Store::Disk::cleanLog
inherited

Definition at line 140 of file Disk.h.

Referenced by UFSCleanLog::write().

◆ disker

int Store::Disk::disker
inherited

Definition at line 104 of file Disk.h.

◆ flags

struct Store::Disk::Flags Store::Disk::flags
inherited

◆ 

struct { ... } Store::Disk::fs

◆ index

int Store::Disk::index
inherited

Definition at line 103 of file Disk.h.

Referenced by Fs::Ufs::UFSStoreState::UFSStoreState(), and Rock::Rebuild::Start().

◆ max_objsize

int64_t Store::Disk::max_objsize
protectedinherited

Definition at line 99 of file Disk.h.

◆ max_size

uint64_t Store::Disk::max_size
protectedinherited

Definition at line 97 of file Disk.h.

Referenced by Store::Disk::maxSize().

◆ min_objsize

int64_t Store::Disk::min_objsize
protectedinherited

Definition at line 98 of file Disk.h.

◆ path

char* Store::Disk::path
inherited

◆ removals

int Store::Disk::removals
inherited

Definition at line 106 of file Disk.h.

◆ repl

RemovalPolicy* Store::Disk::repl
inherited

Definition at line 105 of file Disk.h.

◆ scanned

int Store::Disk::scanned
inherited

Definition at line 107 of file Disk.h.

◆ statsCalled

bool TestSwapDir::statsCalled

Definition at line 20 of file TestSwapDir.h.

Referenced by stat().

◆ theType

char const* Store::Disk::theType
privateinherited

Definition at line 94 of file Disk.h.


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors