Squid Web Cache v8/master
Loading...
Searching...
No Matches
Rock::SwapDir Class Referenceabstract

#include <RockSwapDir.h>

Inheritance diagram for Rock::SwapDir:
[legend]
Collaboration diagram for Rock::SwapDir:
[legend]

Public Types

typedef RefCount< SwapDirPointer
 
typedef Ipc::StoreMap DirMap
 

Public Member Functions

 SwapDir ()
 
 ~SwapDir () override
 
void reconfigure () override
 
StoreEntryget (const cache_key *key) override
 
void evictCached (StoreEntry &) override
 
void evictIfFound (const cache_key *) override
 
void disconnect (StoreEntry &e) override
 called when the entry is about to forget its association with cache_dir
 
uint64_t currentSize () const override
 current size
 
uint64_t currentCount () const override
 the total number of objects stored right now
 
bool doReportStat () const override
 
void finalizeSwapoutSuccess (const StoreEntry &) override
 finalize the successful swapout that has been already noticed by Store
 
void finalizeSwapoutFailure (StoreEntry &) override
 abort the failed swapout that has been already noticed by Store
 
void create () override
 create system resources needed for this store to operate in the future
 
void parse (int index, char *path) override
 
bool smpAware () const override
 whether this disk storage is capable of serving multiple workers
 
bool hasReadableEntry (const StoreEntry &) const override
 whether this cache dir has an entry with e.key
 
SBuf inodeMapPath () const
 
const char * freeSlotsPath () const
 
int64_t entryLimitAbsolute () const
 Core limit.
 
int64_t entryLimitActual () const
 max number of possible entries in db
 
int64_t slotLimitAbsolute () const
 Rock store implementation limit.
 
int64_t slotLimitActual () const
 total number of slots in this db
 
bool validSlotId (const SlotId slotId) const
 whether the given slot ID may point to a slot in this db
 
SlotId reserveSlotForWriting ()
 finds and returns a free db slot to fill or throws
 
void purgeSome ()
 purges one or more entries to make full() false and free some slots
 
int64_t diskOffset (Ipc::Mem::PageId &pageId) const
 
int64_t diskOffset (int filen) const
 
void writeError (StoreIOState &sio)
 
void noteFreeMapSlice (const Ipc::StoreMapSliceId fileno) override
 adjust slice-linked state before a locked Readable slice is erased
 
char const * type () const
 
virtual bool active () const
 
uint64_t maxSize () const override
 
uint64_t minSize () const override
 the minimum size the store will shrink to via normal housekeeping
 
int64_t maxObjectSize () const override
 the maximum size of a storable object; -1 if unlimited
 
void maxObjectSize (int64_t newMax)
 
void getStats (StoreInfoStats &stats) const override
 collect statistics
 
void stat (StoreEntry &) const override
 
int64_t minObjectSize () const
 the size of the smallest entry this cache_dir can store
 
bool objectSizeIsAcceptable (int64_t objSize) const
 
virtual void dump (StoreEntry &) const
 
virtual bool doubleCheck (StoreEntry &)
 
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 int callback ()
 called once every main loop iteration; TODO: Move to UFS code.
 
virtual void sync ()
 prepare for shutdown
 
virtual void readCompleted (const char *buf, int len, int errflag, RefCount< ReadRequest >)=0
 
virtual void writeCompleted (int errflag, size_t len, RefCount< WriteRequest >)=0
 

Public Attributes

uint64_t slotSize
 all db slots are of this size
 
char * path
 
int index
 
int disker
 disker kid id dedicated to this SwapDir or -1
 
RemovalPolicyrepl
 
int removals
 
int scanned
 
struct Store::Disk::Flags flags
 
CleanLogcleanLog
 
struct { 
 
   int   blksize 
 
fs 
 

Protected Member Functions

bool anchorToCache (StoreEntry &) override
 
bool updateAnchored (StoreEntry &) override
 
bool needsDiskStrand () const override
 needs a dedicated kid process
 
void init () override
 
ConfigOptiongetOptionTree () const override
 
bool allowOptionReconfigure (const char *const option) const override
 
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
 
StoreIOState::Pointer createStoreIO (StoreEntry &, StoreIOState::STIOCB *, void *) override
 
StoreIOState::Pointer openStoreIO (StoreEntry &, StoreIOState::STIOCB *, void *) override
 
void maintain () override
 purge while full(); it should be sufficient to purge just one
 
void diskFull () override
 
void reference (StoreEntry &e) override
 somebody needs this entry (many cache replacement policies need to know)
 
bool dereference (StoreEntry &e) override
 
void updateHeaders (StoreEntry *e) override
 make stored metadata and HTTP headers the same as in the given entry
 
bool unlinkdUseful () const override
 whether SwapDir may benefit from unlinkd
 
void statfs (StoreEntry &e) const override
 
void ioCompletedNotification () override
 
void closeCompleted () override
 
void readCompleted (const char *buf, int len, int errflag, RefCount< ::ReadRequest >) override
 
void writeCompleted (int errflag, size_t len, RefCount< ::WriteRequest >) override
 
void parseSize (const bool reconfiguring)
 parses anonymous cache_dir size option
 
void validateOptions ()
 warns of configuration problems; may quit
 
bool parseTimeOption (char const *option, const char *value, int reconfiguring)
 parses time-specific options; mimics SwapDir::optionObjectSizeParse()
 
void dumpTimeOption (StoreEntry *e) const
 reports time-specific options; mimics SwapDir::optionObjectSizeDump()
 
bool parseRateOption (char const *option, const char *value, int reconfiguring)
 parses rate-specific options; mimics SwapDir::optionObjectSizeParse()
 
void dumpRateOption (StoreEntry *e) const
 reports rate-specific options; mimics SwapDir::optionObjectSizeDump()
 
bool parseSizeOption (char const *option, const char *value, int reconfiguring)
 parses size-specific options; mimics SwapDir::optionObjectSizeParse()
 
void dumpSizeOption (StoreEntry *e) const
 reports size-specific options; mimics SwapDir::optionObjectSizeDump()
 
bool full () const
 no more entries can be stored without purging
 
void trackReferences (StoreEntry &e)
 add to replacement policy scope
 
void ignoreReferences (StoreEntry &e)
 delete from repl policy scope
 
int64_t diskOffsetLimit () const
 
void updateHeadersOrThrow (Ipc::StoreMapUpdate &update)
 
StoreIOState::Pointer createUpdateIO (const Ipc::StoreMapUpdate &, StoreIOState::STIOCB *, void *)
 
void anchorEntry (StoreEntry &e, const sfileno filen, const Ipc::StoreMapAnchor &anchor)
 
void parseOptions (int reconfiguring)
 
void dumpOptions (StoreEntry *e) const
 
int64_t sizeInBlocks (const int64_t size) const
 

Protected Attributes

const char * filePath
 location of cache storage file inside path/
 
DirMapmap
 entry key/sfileno to MaxExtras/inode mapping
 
uint64_t max_size
 maximum allocatable size of the storage area
 
int64_t min_objsize
 minimum size of any object stored here (-1 for no limit)
 
int64_t max_objsize
 maximum size of any object stored here (-1 for no limit)
 

Private Member Functions

void createError (const char *const msg)
 
void handleWriteCompletionSuccess (const WriteRequest &request)
 code shared by writeCompleted() success handling cases
 
void handleWriteCompletionProblem (const int errflag, const WriteRequest &request)
 code shared by writeCompleted() error handling cases
 
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

DiskIOStrategyio
 
RefCount< DiskFiletheFile
 cache storage for this cache_dir
 
Ipc::Mem::Pointer< Ipc::Mem::PageStackfreeSlots
 all unused slots
 
Ipc::Mem::PageIdwaitingForPage
 one-page cache for a "hot" free slot
 
DiskFile::Config fileConfig
 file-level configuration options
 
char const * theType
 

Static Private Attributes

static const int64_t HeaderSize = 16*1024
 on-disk db header size
 

Friends

class Rebuild
 
class IoState
 
class HeaderUpdater
 

Detailed Description

Definition at line 32 of file RockSwapDir.h.

Member Typedef Documentation

◆ DirMap

typedef Ipc::StoreMap Rock::SwapDir::DirMap

Definition at line 36 of file RockSwapDir.h.

◆ Pointer

Definition at line 35 of file RockSwapDir.h.

Constructor & Destructor Documentation

◆ SwapDir()

Rock::SwapDir::SwapDir ( )

Definition at line 42 of file RockSwapDir.cc.

References SwapDir().

Referenced by SwapDir().

◆ ~SwapDir()

Rock::SwapDir::~SwapDir ( )
override

Definition at line 48 of file RockSwapDir.cc.

References ~SwapDir(), and safe_free.

Referenced by ~SwapDir().

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()

bool Rock::SwapDir::allowOptionReconfigure ( const char *const  option) const
overrideprotectedvirtual

Reimplemented from Store::Disk.

Definition at line 389 of file RockSwapDir.cc.

References Store::Disk::allowOptionReconfigure().

◆ anchorEntry()

◆ anchorToCache()

bool Rock::SwapDir::anchorToCache ( StoreEntry )
overrideprotectedvirtual

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

Return values
trueif this storage has a matching entry

Reimplemented from Store::Controlled.

Definition at line 76 of file RockSwapDir.cc.

References Assure, StoreEntry::hasDisk(), and hash_link::key.

◆ callback()

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

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

Definition at line 72 of file Storage.h.

◆ canLog()

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

◆ canStore()

bool Rock::SwapDir::canStore ( const StoreEntry e,
int64_t  diskSpaceNeeded,
int load 
) const
overrideprotectedvirtual

◆ closeCompleted()

void Rock::SwapDir::closeCompleted ( )
overrideprotectedvirtual

Implements IORequestor.

Definition at line 832 of file RockSwapDir.cc.

References closeCompleted().

Referenced by closeCompleted().

◆ closeLog()

void Store::Disk::closeLog ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 215 of file Disk.cc.

Referenced by storeDirCloseSwapLogs().

◆ create()

void Rock::SwapDir::create ( )
overridevirtual

Implements Store::Storage.

Definition at line 212 of file RockSwapDir.cc.

References assert, DBG_IMPORTANT, debugs, IamDiskProcess(), Must, O_BINARY, UsingSmp(), xclose(), xopen(), and xwrite().

Referenced by TestRock::setUp().

◆ createError()

void Rock::SwapDir::createError ( const char *const  msg)
private

Definition at line 272 of file RockSwapDir.cc.

References createError(), DBG_CRITICAL, debugs, fatal(), and xstrerr().

Referenced by createError().

◆ createStoreIO()

StoreIOState::Pointer Rock::SwapDir::createStoreIO ( StoreEntry e,
StoreIOState::STIOCB cbIo,
void *  cbData 
)
overrideprotectedvirtual

◆ createUpdateIO()

◆ currentCount()

uint64_t Rock::SwapDir::currentCount ( ) const
overridevirtual

Implements Store::Storage.

Definition at line 157 of file RockSwapDir.cc.

Referenced by TestRock::testRockSwapOut().

◆ currentSize()

uint64_t Rock::SwapDir::currentSize ( ) const
overridevirtual

Implements Store::Storage.

Definition at line 148 of file RockSwapDir.cc.

◆ dereference()

bool Rock::SwapDir::dereference ( StoreEntry e)
overrideprotectedvirtual

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 995 of file RockSwapDir.cc.

References debugs, StoreEntry::repl, StoreEntry::swap_dirn, and StoreEntry::swap_filen.

◆ disconnect()

◆ diskFull()

void Rock::SwapDir::diskFull ( )
overrideprotectedvirtual

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 from Store::Disk.

Definition at line 970 of file RockSwapDir.cc.

References DBG_IMPORTANT, and debugs.

◆ diskOffset() [1/2]

int64_t Rock::SwapDir::diskOffset ( int  filen) const

◆ diskOffset() [2/2]

int64_t Rock::SwapDir::diskOffset ( Ipc::Mem::PageId pageId) const

Definition at line 685 of file RockSwapDir.cc.

References assert, diskOffset(), and Ipc::Mem::PageId::number.

Referenced by diskOffset().

◆ diskOffsetLimit()

int64_t Rock::SwapDir::diskOffsetLimit ( ) const
protected

Definition at line 692 of file RockSwapDir.cc.

References assert, and diskOffsetLimit().

Referenced by Rock::Rebuild::Rebuild(), and diskOffsetLimit().

◆ doReportStat()

bool Rock::SwapDir::doReportStat ( ) const
overridevirtual

In SMP mode only the disker process reports stats to avoid counting the same stats by multiple processes.

Reimplemented from Store::Disk.

Definition at line 165 of file RockSwapDir.cc.

References IamDiskProcess(), and UsingSmp().

◆ 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().

◆ dumpRateOption()

void Rock::SwapDir::dumpRateOption ( StoreEntry e) const
protected

Definition at line 487 of file RockSwapDir.cc.

References dumpRateOption(), and storeAppendPrintf().

Referenced by dumpRateOption().

◆ dumpSizeOption()

void Rock::SwapDir::dumpSizeOption ( StoreEntry e) const
protected

Definition at line 535 of file RockSwapDir.cc.

References dumpSizeOption(), PRId64, and storeAppendPrintf().

Referenced by dumpSizeOption().

◆ dumpTimeOption()

void Rock::SwapDir::dumpTimeOption ( StoreEntry e) const
protected

Definition at line 436 of file RockSwapDir.cc.

References dumpTimeOption(), PRId64, and storeAppendPrintf().

Referenced by dumpTimeOption().

◆ entryLimitAbsolute()

int64_t Rock::SwapDir::entryLimitAbsolute ( ) const
inline

Definition at line 62 of file RockSwapDir.h.

References SwapFilenMax.

◆ entryLimitActual()

int64_t Rock::SwapDir::entryLimitActual ( ) const

◆ evictCached()

void Rock::SwapDir::evictCached ( StoreEntry e)
overridevirtual

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 1020 of file RockSwapDir.cc.

References CollapsedForwarding::Broadcast(), debugs, StoreEntry::hasDisk(), StoreEntry::locked(), StoreEntry::publicKey(), and StoreEntry::swap_filen.

◆ evictIfFound()

void Rock::SwapDir::evictIfFound ( const cache_key )
overridevirtual

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 1013 of file RockSwapDir.cc.

◆ finalizeSwapoutFailure()

void Rock::SwapDir::finalizeSwapoutFailure ( StoreEntry )
overridevirtual

Implements Store::Disk.

Definition at line 180 of file RockSwapDir.cc.

References debugs.

◆ finalizeSwapoutSuccess()

void Rock::SwapDir::finalizeSwapoutSuccess ( const StoreEntry )
overridevirtual

◆ freeSlotsPath()

const char * Rock::SwapDir::freeSlotsPath ( ) const

Definition at line 1104 of file RockSwapDir.cc.

References String::append(), freeSlotsPath(), and String::termedBuf().

Referenced by freeSlotsPath().

◆ full()

bool Rock::SwapDir::full ( ) const
protected

Definition at line 962 of file RockSwapDir.cc.

References full().

Referenced by full().

◆ get()

StoreEntry * Rock::SwapDir::get ( const cache_key )
overridevirtual
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 57 of file RockSwapDir.cc.

References StoreEntry::createMemObject().

◆ getOptionTree()

ConfigOption * Rock::SwapDir::getOptionTree ( ) const
overrideprotectedvirtual

Reimplemented from Store::Disk.

Definition at line 370 of file RockSwapDir.cc.

References Store::Disk::getOptionTree(), ConfigOptionVector::options, and vector.

◆ getStats()

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

◆ handleWriteCompletionProblem()

void Rock::SwapDir::handleWriteCompletionProblem ( const int  errflag,
const WriteRequest request 
)
private

◆ handleWriteCompletionSuccess()

◆ hasReadableEntry()

bool Rock::SwapDir::hasReadableEntry ( const StoreEntry e) const
overridevirtual

Implements Store::Disk.

Definition at line 1113 of file RockSwapDir.cc.

References hash_link::key.

◆ ignoreReferences()

void Rock::SwapDir::ignoreReferences ( StoreEntry e)
protected

Definition at line 1042 of file RockSwapDir.cc.

References debugs, ignoreReferences(), and StoreEntry::repl.

Referenced by ignoreReferences().

◆ init()

void Rock::SwapDir::init ( )
overrideprotectedvirtual

Start preparing the store for use. To check readiness, callers should use readable() and writable() methods.

Implements Store::Storage.

Definition at line 281 of file RockSwapDir.cc.

References DBG_CRITICAL, debugs, fatal(), DiskIOModule::Find(), Must, MYNAME, and shm_old.

◆ inodeMapPath()

SBuf Rock::SwapDir::inodeMapPath ( ) const

Definition at line 1098 of file RockSwapDir.cc.

References inodeMapPath(), and Ipc::Mem::Segment::Name().

Referenced by inodeMapPath().

◆ ioCompletedNotification()

void Rock::SwapDir::ioCompletedNotification ( )
overrideprotectedvirtual

◆ 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 Rock::SwapDir::maintain ( )
overrideprotectedvirtual

Implements Store::Storage.

Definition at line 978 of file RockSwapDir.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 Store::Disk::maxSize ( ) const
inlineoverridevirtualinherited

The maximum size the store will support in normal use. Inaccuracy is permitted, but may throw estimates for memory etc out of whack.

Implements Store::Storage.

Reimplemented in TestSwapDir.

Definition at line 48 of file Disk.h.

References Store::Disk::max_size.

◆ 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 Rock::SwapDir::needsDiskStrand ( ) const
overrideprotectedvirtual

Reimplemented from Store::Disk.

Definition at line 312 of file RockSwapDir.cc.

References Config, DiskIOModule::Find(), InDaemonMode(), and SquidConfig::workers.

◆ noteFreeMapSlice()

void Rock::SwapDir::noteFreeMapSlice ( const Ipc::StoreMapSliceId  sliceId)
overridevirtual

◆ 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()

◆ 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 Rock::SwapDir::parse ( int  index,
char *  path 
)
overridevirtual

Implements Store::Disk.

Definition at line 321 of file RockSwapDir.cc.

References String::append(), assert, String::termedBuf(), and xstrdup.

Referenced by TestRock::setUp().

◆ parseOptions()

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

◆ parseRateOption()

bool Rock::SwapDir::parseRateOption ( char const *  option,
const char *  value,
int  reconfiguring 
)
protected

Definition at line 445 of file RockSwapDir.cc.

References DBG_CRITICAL, DBG_IMPORTANT, debugs, parseRateOption(), self_destruct(), and strtoll().

Referenced by parseRateOption().

◆ parseSize()

void Rock::SwapDir::parseSize ( const bool  reconfiguring)
protected

parse maximum db disk size

Definition at line 353 of file RockSwapDir.cc.

References DBG_IMPORTANT, debugs, fatal(), GetInteger(), and parseSize().

Referenced by parseSize().

◆ parseSizeOption()

bool Rock::SwapDir::parseSizeOption ( char const *  option,
const char *  value,
int  reconfiguring 
)
protected

Definition at line 495 of file RockSwapDir.cc.

References DBG_CRITICAL, DBG_IMPORTANT, debugs, parseSizeOption(), self_destruct(), and strtoll().

Referenced by parseSizeOption().

◆ parseTimeOption()

bool Rock::SwapDir::parseTimeOption ( char const *  option,
const char *  value,
int  reconfiguring 
)
protected

Definition at line 397 of file RockSwapDir.cc.

References DBG_CRITICAL, DBG_IMPORTANT, debugs, parseTimeOption(), self_destruct(), and strtoll().

Referenced by parseTimeOption().

◆ purgeSome()

void Rock::SwapDir::purgeSome ( )

◆ readCompleted() [1/2]

void Rock::SwapDir::readCompleted ( const char *  buf,
int  len,
int  errflag,
RefCount< ::ReadRequest r 
)
overrideprotected

◆ readCompleted() [2/2]

virtual void IORequestor::readCompleted ( const char *  buf,
int  len,
int  errflag,
RefCount< ReadRequest  
)
pure virtualinherited

◆ reconfigure()

void Rock::SwapDir::reconfigure ( )
overridevirtual

Implements Store::Disk.

Definition at line 343 of file RockSwapDir.cc.

◆ reference()

void Rock::SwapDir::reference ( StoreEntry e)
overrideprotectedvirtual

Implements Store::Controlled.

Definition at line 987 of file RockSwapDir.cc.

References debugs, StoreEntry::repl, StoreEntry::swap_dirn, and StoreEntry::swap_filen.

◆ reserveSlotForWriting()

Rock::SlotId Rock::SwapDir::reserveSlotForWriting ( )

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

◆ slotLimitAbsolute()

int64_t Rock::SwapDir::slotLimitAbsolute ( ) const

Definition at line 187 of file RockSwapDir.cc.

References assert, and slotLimitAbsolute().

Referenced by slotLimitAbsolute().

◆ slotLimitActual()

int64_t Rock::SwapDir::slotLimitActual ( ) const

◆ smpAware()

bool Rock::SwapDir::smpAware ( ) const
inlineoverridevirtual

Implements Store::Disk.

Definition at line 54 of file RockSwapDir.h.

◆ stat()

void Store::Disk::stat ( StoreEntry e) const
overridevirtualinherited

Output stats to the provided store entry. TODO: make these calls asynchronous

Implements Store::Storage.

Reimplemented in TestSwapDir.

Definition at line 63 of file Disk.cc.

References storeAppendPrintf().

◆ statfs()

void Rock::SwapDir::statfs ( StoreEntry e) const
overrideprotectedvirtual

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

◆ trackReferences()

void Rock::SwapDir::trackReferences ( StoreEntry e)
protected

Definition at line 1034 of file RockSwapDir.cc.

References debugs, StoreEntry::repl, and trackReferences().

Referenced by trackReferences().

◆ type()

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

Definition at line 230 of file Disk.cc.

◆ unlinkdUseful()

bool Rock::SwapDir::unlinkdUseful ( ) const
overrideprotectedvirtual

Implements Store::Disk.

Definition at line 1006 of file RockSwapDir.cc.

◆ updateAnchored()

bool Rock::SwapDir::updateAnchored ( StoreEntry )
overrideprotectedvirtual

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 from Store::Controlled.

Definition at line 94 of file RockSwapDir.cc.

References assert, StoreEntry::hasDisk(), StoreEntry::swap_file_sz, and StoreEntry::swap_filen.

◆ updateHeaders()

void Rock::SwapDir::updateHeaders ( StoreEntry )
overrideprotectedvirtual

Reimplemented from Store::Controlled.

Definition at line 944 of file RockSwapDir.cc.

References debugs, AsyncJob::Start(), and StoreEntry::swap_filen.

◆ updateHeadersOrThrow()

void Rock::SwapDir::updateHeadersOrThrow ( Ipc::StoreMapUpdate update)
protected

◆ validateOptions()

void Rock::SwapDir::validateOptions ( )
protected

check the results of the configuration; only level-0 debugging works here

Definition at line 542 of file RockSwapDir.cc.

References DBG_CRITICAL, debugs, fatal(), max(), and validateOptions().

Referenced by validateOptions().

◆ validSlotId()

bool Rock::SwapDir::validSlotId ( const SlotId  slotId) const

Definition at line 733 of file RockSwapDir.cc.

References validSlotId().

Referenced by validSlotId().

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

◆ writeCompleted() [1/2]

◆ writeCompleted() [2/2]

virtual void IORequestor::writeCompleted ( int  errflag,
size_t  len,
RefCount< WriteRequest  
)
pure virtualinherited

◆ writeError()

void Rock::SwapDir::writeError ( StoreIOState sio)

Friends And Related Symbol Documentation

◆ HeaderUpdater

friend class HeaderUpdater
friend

Definition at line 134 of file RockSwapDir.h.

◆ IoState

friend class IoState
friend

Definition at line 133 of file RockSwapDir.h.

◆ Rebuild

friend class Rebuild
friend

Definition at line 132 of file RockSwapDir.h.

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.

◆ fileConfig

DiskFile::Config Rock::SwapDir::fileConfig
private

Definition at line 149 of file RockSwapDir.h.

◆ filePath

const char* Rock::SwapDir::filePath
protected

Definition at line 135 of file RockSwapDir.h.

Referenced by Rock::Rebuild::Start().

◆ flags

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

◆ freeSlots

Ipc::Mem::Pointer<Ipc::Mem::PageStack> Rock::SwapDir::freeSlots
private

Definition at line 145 of file RockSwapDir.h.

◆ [struct]

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

◆ HeaderSize

const int64_t Rock::SwapDir::HeaderSize = 16*1024
staticprivate

Definition at line 151 of file RockSwapDir.h.

◆ index

int Store::Disk::index
inherited

Definition at line 103 of file Disk.h.

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

◆ io

DiskIOStrategy* Rock::SwapDir::io
private

Definition at line 143 of file RockSwapDir.h.

◆ map

DirMap* Rock::SwapDir::map
protected

Definition at line 136 of file RockSwapDir.h.

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

◆ slotSize

uint64_t Rock::SwapDir::slotSize

Definition at line 83 of file RockSwapDir.h.

Referenced by Rock::Rebuild::Rebuild().

◆ theFile

RefCount<DiskFile> Rock::SwapDir::theFile
private

Definition at line 144 of file RockSwapDir.h.

◆ theType

char const* Store::Disk::theType
privateinherited

Definition at line 94 of file Disk.h.

◆ waitingForPage

Ipc::Mem::PageId* Rock::SwapDir::waitingForPage
private

Definition at line 146 of file RockSwapDir.h.


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