#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 finalizeSwapoutSuccess (const StoreEntry &) override
 finalize the successful swapout that has been already noticed by Store More...
 
virtual void finalizeSwapoutFailure (StoreEntry &) override
 abort the failed swapout that has been already noticed by Store 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 evictCached (StoreEntry &) override
 
virtual void evictIfFound (const cache_key *) override
 
virtual bool hasReadableEntry (const StoreEntry &) const override
 whether this cache dir has an entry with e.key 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
 
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 anchorToCache (StoreEntry &, bool &)
 
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...
 

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

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

Reimplemented in Rock::SwapDir.

Definition at line 84 of file Disk.h.

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

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

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, MemStore, and Store::Disks.

Definition at line 40 of file Controlled.h.

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

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

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

Definition at line 72 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().

virtual 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.

virtual 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.

virtual void TestSwapDir::finalizeSwapoutFailure ( StoreEntry )
inlineoverridevirtual

Implements Store::Disk.

Definition at line 28 of file TestSwapDir.h.

virtual void TestSwapDir::finalizeSwapoutSuccess ( const StoreEntry )
inlineoverridevirtual

Implements Store::Disk.

Definition at line 27 of file TestSwapDir.h.

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.

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
virtual bool TestSwapDir::hasReadableEntry ( const StoreEntry e) const
inlineoverridevirtual

Implements Store::Disk.

Definition at line 38 of file TestSwapDir.h.

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.

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 86 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 Store::Storage::sync ( void  )
inlinevirtualinherited

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

Definition at line 78 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().

bool TestSwapDir::unlinkdUseful ( ) const
overridevirtual

Implements Store::Disk.

Definition at line 45 of file TestSwapDir.cc.

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 45 of file Controlled.h.

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

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

Definition at line 35 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 145 of file Disk.h.

CleanLog* Store::Disk::cleanLog
inherited

Definition at line 139 of file Disk.h.

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

int Store::Disk::disker
inherited

Definition at line 103 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 102 of file Disk.h.

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

int64_t Store::Disk::max_objsize
protectedinherited

Definition at line 98 of file Disk.h.

uint64_t Store::Disk::max_size
protectedinherited

Definition at line 96 of file Disk.h.

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

int64_t Store::Disk::min_objsize
protectedinherited

Definition at line 97 of file Disk.h.

char* Store::Disk::path
inherited

Definition at line 101 of file Disk.h.

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

int Store::Disk::removals
inherited

Definition at line 105 of file Disk.h.

RemovalPolicy* Store::Disk::repl
inherited

Definition at line 104 of file Disk.h.

int Store::Disk::scanned
inherited

Definition at line 106 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