#include <TestSwapDir.h>

Inheritance diagram for TestSwapDir:
Collaboration diagram for TestSwapDir:

Public Types

typedef RefCount< DiskPointer
 

Public Member Functions

 TestSwapDir ()
 
virtual uint64_t maxSize () const override
 
virtual uint64_t currentSize () const override
 current size More...
 
virtual uint64_t currentCount () const override
 the total number of objects stored right now More...
 
virtual void stat (StoreEntry &) const override
 
virtual void swappedOut (const StoreEntry &e) override
 called when entry swap out is complete More...
 
virtual void reconfigure () override
 
virtual void init () override
 
virtual bool unlinkdUseful () const override
 whether SwapDir may benefit from unlinkd More...
 
virtual 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...
 
virtual StoreIOState::Pointer createStoreIO (StoreEntry &, StoreIOState::STFNCB *, StoreIOState::STIOCB *, void *) override
 
virtual StoreIOState::Pointer openStoreIO (StoreEntry &, StoreIOState::STFNCB *, StoreIOState::STIOCB *, void *) override
 
virtual void parse (int, char *) override
 
virtual void markForUnlink (StoreEntry &) override
 expect an unlink() call after the entry becomes idle More...
 
virtual void unlink (StoreEntry &) override
 remove the entry from the store 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 ()
 
virtual void create () override
 create system resources needed for this store to operate in the future More...
 
virtual StoreEntryget (const cache_key *) override
 Retrieve a store entry from the store (blocking) More...
 
virtual uint64_t minSize () const override
 the minimum size the store will shrink to via normal housekeeping More...
 
virtual int64_t maxObjectSize () const override
 the maximum size of a storable object; -1 if unlimited More...
 
void maxObjectSize (int64_t newMax)
 
virtual void getStats (StoreInfoStats &stats) const override
 collect statistics More...
 
virtual void reference (StoreEntry &e) override
 somebody needs this entry (many cache replacement policies need to know) More...
 
virtual bool dereference (StoreEntry &e) override
 
virtual void maintain () override
 perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain More...
 
virtual bool smpAware () const override
 
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 anchorCollapsed (StoreEntry &, bool &)
 
virtual bool updateCollapsed (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...
 

Detailed Description

Definition at line 14 of file TestSwapDir.h.

Member Typedef Documentation

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

Definition at line 25 of file Disk.h.

Constructor & Destructor Documentation

TestSwapDir::TestSwapDir ( )
inline

Definition at line 18 of file TestSwapDir.h.

Member Function Documentation

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::anchorCollapsed(), and Store::Disks::get().

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

Reimplemented in Rock::SwapDir.

Definition at line 79 of file Disk.h.

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

virtual bool Store::Controlled::anchorCollapsed ( StoreEntry ,
bool &   
)
inlinevirtualinherited

If this storage cannot cache collapsed entries, return false. If the entry is not found, return false. Otherwise, return true after tying the entry to this cache and setting inSync to updateCollapsed().

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

Definition at line 34 of file Controlled.h.

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

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

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

Definition at line 70 of file Storage.h.

bool Store::Disk::canLog ( StoreEntry const &  e) const
inherited
bool TestSwapDir::canStore ( const StoreEntry e,
int64_t  diskSpaceNeeded,
int load 
) const
overridevirtual

Implements Store::Disk.

Definition at line 51 of file TestSwapDir.cc.

void Store::Disk::closeLog ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 215 of file Disk.cc.

void Store::Disk::create ( )
overridevirtualinherited

Implements Store::Storage.

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

Definition at line 40 of file Disk.cc.

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

Implements Store::Disk.

Definition at line 58 of file TestSwapDir.cc.

References NULL.

uint64_t TestSwapDir::currentCount ( ) const
overridevirtual

Implements Store::Storage.

Definition at line 25 of file TestSwapDir.cc.

uint64_t TestSwapDir::currentSize ( ) const
overridevirtual

Implements Store::Storage.

Definition at line 19 of file TestSwapDir.cc.

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.

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

Definition at line 139 of file Disk.cc.

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

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

Reimplemented in Rock::SwapDir.

Definition at line 70 of file Disk.h.

Referenced by destroyStoreEntry().

void Store::Disk::diskFull ( )
virtualinherited

Notify this disk that it is full.

Todo:
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().

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

Reimplemented in Rock::SwapDir.

Definition at line 35 of file Disk.h.

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

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 46 of file Disk.cc.

Referenced by storeCleanupDoubleCheck().

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

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 43 of file Disk.cc.

Referenced by dump_cachedir().

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

Definition at line 307 of file Disk.cc.

References ConfigOption::dump().

StoreEntry * Store::Disk::get ( const cache_key )
overridevirtualinherited

Implements Store::Storage.

Reimplemented in Rock::SwapDir.

Definition at line 393 of file Disk.cc.

References NULL.

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

void Store::Disk::getStats ( StoreInfoStats stats) const
overridevirtualinherited
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.

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

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 227 of file Disk.cc.

void Store::Disk::maintain ( )
overridevirtualinherited

Implements Store::Storage.

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

Definition at line 86 of file Disk.cc.

virtual void TestSwapDir::markForUnlink ( StoreEntry e)
inlineoverridevirtual

Implements Store::Storage.

Definition at line 35 of file TestSwapDir.h.

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

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.

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

Definition at line 96 of file Disk.cc.

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

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.

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

Reimplemented in Rock::SwapDir.

Definition at line 249 of file Disk.cc.

Referenced by configDoConfigure().

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.

void Store::Disk::openLog ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 212 of file Disk.cc.

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

Implements Store::Disk.

Definition at line 64 of file TestSwapDir.cc.

References NULL.

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

Implements Store::Disk.

Definition at line 70 of file TestSwapDir.cc.

void Store::Disk::parseOptions ( int  reconfiguring)
protectedinherited
void TestSwapDir::reconfigure ( )
overridevirtual

Implements Store::Disk.

Definition at line 37 of file TestSwapDir.cc.

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

Implements Store::Controlled.

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

Definition at line 136 of file Disk.cc.

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

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

Definition at line 81 of file Disk.h.

References Store::Disk::fs.

virtual bool Store::Disk::smpAware ( ) const
inlineoverridevirtualinherited

whether this storage is capable of serving multiple workers; a true result does not imply [lack of] non-SMP support because [only] some SMP-aware storages also support non-SMP configss

Implements Store::Storage.

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

Definition at line 56 of file Disk.h.

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.

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

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

Definition at line 83 of file Disk.cc.

virtual void TestSwapDir::swappedOut ( const StoreEntry e)
inlineoverridevirtual

Implements Store::Disk.

Definition at line 27 of file TestSwapDir.h.

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

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

Definition at line 76 of file Storage.h.

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

Definition at line 230 of file Disk.cc.

Referenced by dump_cachedir(), and parse_cachedir().

virtual void TestSwapDir::unlink ( StoreEntry e)
inlineoverridevirtual

Implements Store::Storage.

Definition at line 36 of file TestSwapDir.h.

bool TestSwapDir::unlinkdUseful ( ) const
overridevirtual

Implements Store::Disk.

Definition at line 45 of file TestSwapDir.cc.

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

Update a local collapsed entry with fresh info from this cache (if any). Return true iff the cache supports collapsed entries and the given local collapsed entry is now in sync with this storage.

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

Definition at line 39 of file Controlled.h.

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

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

Definition at line 29 of file Controlled.h.

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

void Store::Disk::writeCleanDone ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 224 of file Disk.cc.

int Store::Disk::writeCleanStart ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 218 of file Disk.cc.

Referenced by storeDirWriteCleanLogs().

Member Data Documentation

int Store::Disk::blksize
inherited

Definition at line 140 of file Disk.h.

CleanLog* Store::Disk::cleanLog
inherited

Definition at line 134 of file Disk.h.

Referenced by storeDirWriteCleanLogs(), and UFSCleanLog::write().

int Store::Disk::disker
inherited

Definition at line 98 of file Disk.h.

Referenced by configDoConfigure().

struct Store::Disk::Flags Store::Disk::flags
inherited
struct { ... } Store::Disk::fs
int Store::Disk::index
inherited

Definition at line 97 of file Disk.h.

Referenced by storeDirWriteCleanLogs(), and Fs::Ufs::UFSStoreState::UFSStoreState().

int64_t Store::Disk::max_objsize
protectedinherited

Definition at line 93 of file Disk.h.

uint64_t Store::Disk::max_size
protectedinherited

Definition at line 91 of file Disk.h.

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

int64_t Store::Disk::min_objsize
protectedinherited

Definition at line 92 of file Disk.h.

char* Store::Disk::path
inherited

Definition at line 96 of file Disk.h.

Referenced by Fs::Ufs::UFSSwapDir::DirClean(), dump_cachedir(), and parse_cachedir().

int Store::Disk::removals
inherited

Definition at line 100 of file Disk.h.

RemovalPolicy* Store::Disk::repl
inherited

Definition at line 99 of file Disk.h.

int Store::Disk::scanned
inherited

Definition at line 101 of file Disk.h.

bool TestSwapDir::statsCalled

Definition at line 20 of file TestSwapDir.h.

Referenced by stat().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors