#include <RockSwapDir.h>

Inheritance diagram for Rock::SwapDir:
Collaboration diagram for Rock::SwapDir:

Public Types

typedef RefCount< SwapDirPointer
 
typedef Ipc::StoreMap DirMap
 

Public Member Functions

 SwapDir ()
 
virtual ~SwapDir ()
 
virtual void reconfigure ()
 
virtual StoreEntryget (const cache_key *key)
 
virtual void evictCached (StoreEntry &)
 
virtual void evictIfFound (const cache_key *)
 
virtual void disconnect (StoreEntry &e)
 called when the entry is about to forget its association with cache_dir More...
 
virtual uint64_t currentSize () const
 current size More...
 
virtual uint64_t currentCount () const
 the total number of objects stored right now More...
 
virtual bool doReportStat () const
 
virtual void finalizeSwapoutSuccess (const StoreEntry &)
 finalize the successful swapout that has been already noticed by Store More...
 
virtual void finalizeSwapoutFailure (StoreEntry &)
 abort the failed swapout that has been already noticed by Store More...
 
virtual void create ()
 create system resources needed for this store to operate in the future More...
 
virtual void parse (int index, char *path)
 
virtual bool smpAware () const
 whether this disk storage is capable of serving multiple workers More...
 
virtual bool hasReadableEntry (const StoreEntry &) const
 whether this cache dir has an entry with e.key More...
 
SBuf inodeMapPath () const
 
const char * freeSlotsPath () const
 
int64_t entryLimitAbsolute () const
 Core limit. More...
 
int64_t entryLimitActual () const
 max number of possible entries in db More...
 
int64_t slotLimitAbsolute () const
 Rock store implementation limit. More...
 
int64_t slotLimitActual () const
 total number of slots in this db More...
 
bool validSlotId (const SlotId slotId) const
 whether the given slot ID may point to a slot in this db More...
 
SlotId reserveSlotForWriting ()
 finds and returns a free db slot to fill or throws More...
 
void purgeSome ()
 purges one or more entries to make full() false and free some slots More...
 
int64_t diskOffset (Ipc::Mem::PageId &pageId) const
 
int64_t diskOffset (int filen) const
 
void writeError (StoreIOState &sio)
 
virtual void noteFreeMapSlice (const Ipc::StoreMapSliceId fileno)
 adjust slice-linked state before a locked Readable slice is erased More...
 
char const * type () const
 
virtual bool active () const
 
virtual uint64_t maxSize () const 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 stat (StoreEntry &) 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 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. More...
 
virtual void sync ()
 prepare for shutdown More...
 
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 More...
 
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

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

void createError (const char *const msg)
 
void handleWriteCompletionSuccess (const WriteRequest &request)
 code shared by writeCompleted() success handling cases More...
 
void handleWriteCompletionProblem (const int errflag, const WriteRequest &request)
 code shared by writeCompleted() error handling cases More...
 
bool droppedEarlierRequest (const WriteRequest &request) const
 whether the disk has dropped at least one of the previous write requests More...
 

Private Attributes

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

Static Private Attributes

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

Friends

class Rebuild
 
class IoState
 
class HeaderUpdater
 

Detailed Description

Definition at line 30 of file RockSwapDir.h.

Member Typedef Documentation

◆ DirMap

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

Definition at line 34 of file RockSwapDir.h.

◆ Pointer

Definition at line 33 of file RockSwapDir.h.

Constructor & Destructor Documentation

◆ SwapDir()

Rock::SwapDir::SwapDir ( )

Definition at line 42 of file RockSwapDir.cc.

◆ ~SwapDir()

Rock::SwapDir::~SwapDir ( )
virtual

Definition at line 48 of file RockSwapDir.cc.

References filePath, io, map, and safe_free.

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 Store::Disk::disker, IamWorkerProcess(), and KidIdentifier.

Referenced by Store::Disks::anchorToCache(), and Store::Disks::get().

◆ allowOptionReconfigure()

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

Reimplemented from Store::Disk.

Definition at line 395 of file RockSwapDir.cc.

References Store::Disk::allowOptionReconfigure().

◆ anchorEntry()

◆ anchorToCache()

bool Rock::SwapDir::anchorToCache ( StoreEntry ,
bool &   
)
protectedvirtual

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

Definition at line 76 of file RockSwapDir.cc.

References anchorEntry(), DiskFile::canRead(), hash_link::key, map, Ipc::StoreMap::openForReading(), theFile, and updateAnchoredWith().

◆ callback()

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.

References Store::Storage::maintain().

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

◆ canLog()

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

◆ canStore()

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

◆ closeCompleted()

void Rock::SwapDir::closeCompleted ( )
protectedvirtual

Implements IORequestor.

Definition at line 837 of file RockSwapDir.cc.

References NULL, and theFile.

◆ closeLog()

void Store::Disk::closeLog ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 215 of file Disk.cc.

◆ create()

void Rock::SwapDir::create ( )
virtual

◆ createError()

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

Definition at line 273 of file RockSwapDir.cc.

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

Referenced by create().

◆ createStoreIO()

StoreIOState::Pointer Rock::SwapDir::createStoreIO ( StoreEntry e,
StoreIOState::STFNCB cbFile,
StoreIOState::STIOCB cbIo,
void *  data 
)
protectedvirtual

◆ createUpdateIO()

◆ currentCount()

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

Implements Store::Storage.

Definition at line 161 of file RockSwapDir.cc.

References Ipc::StoreMap::entryCount(), and map.

Referenced by testRock::testRockSwapOut().

◆ currentSize()

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

Implements Store::Storage.

Definition at line 152 of file RockSwapDir.cc.

References freeSlots, Store::Disk::maxSize(), Ipc::Mem::PageStack::size(), and slotSize.

Referenced by statfs().

◆ dereference()

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

somebody no longer needs this entry (usually after calling reference()) return false iff the idle entry should be destroyed

Reimplemented from Store::Disk.

Definition at line 1008 of file RockSwapDir.cc.

References debugs, RemovalPolicy::Dereferenced, HERE(), Store::Disk::repl, StoreEntry::repl, StoreEntry::swap_dirn, and StoreEntry::swap_filen.

◆ disconnect()

◆ diskFull()

void Rock::SwapDir::diskFull ( )
protectedvirtual

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

Definition at line 983 of file RockSwapDir.cc.

References DBG_IMPORTANT, debugs, and filePath.

◆ diskOffset() [1/2]

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

◆ diskOffset() [2/2]

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

◆ diskOffsetLimit()

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

Definition at line 707 of file RockSwapDir.cc.

References assert, diskOffset(), map, and Ipc::StoreMap::sliceLimit().

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

◆ doReportStat()

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

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 169 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 storeCleanupDoubleCheck().

◆ droppedEarlierRequest()

bool Rock::SwapDir::droppedEarlierRequest ( const WriteRequest request) const
private

◆ dump()

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

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 43 of file Disk.cc.

Referenced by dump_cachedir().

◆ dumpOptions()

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

◆ dumpRateOption()

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

Definition at line 493 of file RockSwapDir.cc.

References fileConfig, DiskFile::Config::ioRate, and storeAppendPrintf().

Referenced by getOptionTree().

◆ dumpSizeOption()

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

Definition at line 541 of file RockSwapDir.cc.

References PRId64, slotSize, and storeAppendPrintf().

Referenced by getOptionTree().

◆ dumpTimeOption()

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

Definition at line 442 of file RockSwapDir.cc.

References fileConfig, DiskFile::Config::ioTimeout, PRId64, and storeAppendPrintf().

Referenced by getOptionTree().

◆ entryLimitAbsolute()

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

◆ entryLimitActual()

int64_t Rock::SwapDir::entryLimitActual ( ) const

Definition at line 206 of file RockSwapDir.cc.

References entryLimitAbsolute(), min(), and slotLimitActual().

Referenced by entryLimitAbsolute(), Rock::Rebuild::Rebuild(), and statfs().

◆ evictCached()

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

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

References CollapsedForwarding::Broadcast(), debugs, disconnect(), evictIfFound(), Ipc::StoreMap::freeEntry(), StoreEntry::hasDisk(), Store::Disk::index, StoreEntry::locked(), map, StoreEntry::publicKey(), and StoreEntry::swap_filen.

◆ evictIfFound()

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

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

References Ipc::StoreMap::freeEntryByKey(), and map.

Referenced by evictCached().

◆ finalizeSwapoutFailure()

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

Implements Store::Disk.

Definition at line 181 of file RockSwapDir.cc.

References debugs, and disconnect().

◆ finalizeSwapoutSuccess()

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

Implements Store::Disk.

Definition at line 175 of file RockSwapDir.cc.

◆ freeSlotsPath()

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

Definition at line 1117 of file RockSwapDir.cc.

References String::append(), Store::Disk::path, and String::termedBuf().

Referenced by init(), and smpAware().

◆ full()

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

Definition at line 975 of file RockSwapDir.cc.

References freeSlots, NULL, and Ipc::Mem::PageStack::size().

◆ get()

StoreEntry * Rock::SwapDir::get ( const cache_key )
virtual
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).

Reimplemented from Store::Disk.

Definition at line 57 of file RockSwapDir.cc.

References anchorEntry(), DiskFile::canRead(), StoreEntry::createMemObject(), map, NULL, Ipc::StoreMap::openForReading(), theFile, and trackReferences().

◆ getOptionTree()

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

◆ getStats()

◆ handleWriteCompletionProblem()

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

◆ handleWriteCompletionSuccess()

◆ hasReadableEntry()

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

Implements Store::Disk.

Definition at line 1126 of file RockSwapDir.cc.

References Ipc::StoreMap::hasReadableEntry(), hash_link::key, map, and Rock::RunnerRegistrationEntry().

Referenced by smpAware().

◆ ignoreReferences()

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

Definition at line 1055 of file RockSwapDir.cc.

References debugs, HERE(), RemovalPolicy::Remove, Store::Disk::repl, and StoreEntry::repl.

Referenced by disconnect().

◆ init()

void Rock::SwapDir::init ( )
protectedvirtual

◆ inodeMapPath()

SBuf Rock::SwapDir::inodeMapPath ( ) const

Definition at line 1111 of file RockSwapDir.cc.

References Ipc::Mem::Segment::Name(), and Store::Disk::path.

Referenced by init(), and smpAware().

◆ ioCompletedNotification()

void Rock::SwapDir::ioCompletedNotification ( )
protectedvirtual

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

◆ maintain()

void Rock::SwapDir::maintain ( )
protectedvirtual

Reimplemented from Store::Disk.

Definition at line 991 of file RockSwapDir.cc.

◆ maxObjectSize() [1/2]

◆ 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, debugs, Store::Disk::max_objsize, Store::Disk::maxSize(), and Store::Disk::path.

◆ maxSize()

◆ minObjectSize()

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

◆ minSize()

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

◆ needsDiskStrand()

bool Rock::SwapDir::needsDiskStrand ( ) const
protectedvirtual

Reimplemented from Store::Disk.

Definition at line 318 of file RockSwapDir.cc.

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

Referenced by canStore(), init(), and openStoreIO().

◆ noteFreeMapSlice()

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

◆ 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, Store::Disk::maxObjectSize(), and Store::Disk::minObjectSize().

Referenced by Store::Disk::canStore(), and Store::Disk::maxSize().

◆ openLog()

void Store::Disk::openLog ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 212 of file Disk.cc.

◆ openStoreIO()

◆ parse()

void Rock::SwapDir::parse ( int  index,
char *  path 
)
virtual

◆ parseOptions()

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

◆ parseRateOption()

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

◆ parseSize()

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

parse maximum db disk size

Definition at line 359 of file RockSwapDir.cc.

References DBG_IMPORTANT, debugs, fatal(), GetInteger(), i, Store::Disk::max_size, and Store::Disk::path.

Referenced by parse(), and reconfigure().

◆ parseSizeOption()

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

Definition at line 501 of file RockSwapDir.cc.

References DBG_CRITICAL, DBG_IMPORTANT, debugs, NULL, Store::Disk::path, self_destruct(), slotSize, and strtoll().

Referenced by getOptionTree().

◆ parseTimeOption()

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

◆ purgeSome()

void Rock::SwapDir::purgeSome ( )

Referenced by entryLimitAbsolute().

◆ readCompleted() [1/2]

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

◆ readCompleted() [2/2]

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

◆ rebuild()

void Rock::SwapDir::rebuild ( )
protected

Definition at line 590 of file RockSwapDir.cc.

References Rebuild, and AsyncJob::Start().

Referenced by ioCompletedNotification().

◆ reconfigure()

void Rock::SwapDir::reconfigure ( )
virtual

Implements Store::Disk.

Definition at line 349 of file RockSwapDir.cc.

References Store::Disk::parseOptions(), parseSize(), and validateOptions().

◆ reference()

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

◆ reserveSlotForWriting()

◆ sizeInBlocks()

◆ slotLimitAbsolute()

int64_t Rock::SwapDir::slotLimitAbsolute ( ) const

Definition at line 188 of file RockSwapDir.cc.

References assert, and max().

Referenced by entryLimitAbsolute(), slotLimitActual(), and validateOptions().

◆ slotLimitActual()

int64_t Rock::SwapDir::slotLimitActual ( ) const

◆ smpAware()

virtual bool Rock::SwapDir::smpAware ( ) const
inlinevirtual

Implements Store::Disk.

Definition at line 52 of file RockSwapDir.h.

References freeSlotsPath(), hasReadableEntry(), and inodeMapPath().

◆ stat()

◆ statfs()

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

Referenced by Store::Disks::sync(), and Store::Controller::sync().

◆ trackReferences()

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

Definition at line 1047 of file RockSwapDir.cc.

References RemovalPolicy::Add, debugs, HERE(), Store::Disk::repl, and StoreEntry::repl.

Referenced by createStoreIO(), and get().

◆ type()

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

Definition at line 230 of file Disk.cc.

References Store::Disk::theType.

Referenced by dump_cachedir(), parse_cachedir(), and Store::Disk::stat().

◆ unlinkdUseful()

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

Implements Store::Disk.

Definition at line 1019 of file RockSwapDir.cc.

◆ updateAnchored()

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

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

References assert, DiskFile::canRead(), StoreEntry::hasDisk(), Store::Disk::index, map, Ipc::StoreMap::readableEntry(), StoreEntry::swap_filen, theFile, and updateAnchoredWith().

◆ updateAnchoredWith()

bool Rock::SwapDir::updateAnchoredWith ( StoreEntry entry,
const Ipc::StoreMapAnchor anchor 
)
protected

◆ updateHeaders()

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

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

References DBG_CRITICAL, debugs, entryLimitAbsolute(), fatal(), max(), Store::Disk::maxObjectSize(), Store::Disk::maxSize(), Store::Disk::path, slotLimitAbsolute(), and slotSize.

Referenced by parse(), and reconfigure().

◆ validSlotId()

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

Definition at line 748 of file RockSwapDir.cc.

References slotLimitActual().

Referenced by entryLimitAbsolute().

◆ writeCleanDone()

void Store::Disk::writeCleanDone ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 224 of file Disk.cc.

◆ writeCleanStart()

int Store::Disk::writeCleanStart ( )
virtualinherited

Reimplemented in Fs::Ufs::UFSSwapDir.

Definition at line 218 of file Disk.cc.

Referenced by storeDirWriteCleanLogs().

◆ writeCompleted() [1/2]

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

◆ writeCompleted() [2/2]

◆ writeError()

Friends And Related Function Documentation

◆ HeaderUpdater

friend class HeaderUpdater
friend

Definition at line 135 of file RockSwapDir.h.

Referenced by updateHeaders().

◆ IoState

friend class IoState
friend

Definition at line 134 of file RockSwapDir.h.

Referenced by createStoreIO(), createUpdateIO(), and openStoreIO().

◆ Rebuild

friend class Rebuild
friend

Definition at line 133 of file RockSwapDir.h.

Referenced by rebuild().

Member Data Documentation

◆ blksize

int Store::Disk::blksize
inherited

Definition at line 146 of file Disk.h.

◆ cleanLog

CleanLog* Store::Disk::cleanLog
inherited

◆ disker

int Store::Disk::disker
inherited

Definition at line 104 of file Disk.h.

Referenced by Store::Disk::active(), and configDoConfigure().

◆ fileConfig

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

Definition at line 151 of file RockSwapDir.h.

Referenced by dumpRateOption(), dumpTimeOption(), init(), parseRateOption(), and parseTimeOption().

◆ filePath

const char* Rock::SwapDir::filePath
protected

◆ flags

◆ freeSlots

◆ fs

◆ HeaderSize

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

Definition at line 153 of file RockSwapDir.h.

Referenced by create(), createUpdateIO(), slotLimitActual(), and Rock::Rebuild::start().

◆ index

◆ io

DiskIOStrategy* Rock::SwapDir::io
private

Definition at line 145 of file RockSwapDir.h.

Referenced by canStore(), init(), and ~SwapDir().

◆ map

◆ max_objsize

int64_t Store::Disk::max_objsize
protectedinherited

◆ max_size

uint64_t Store::Disk::max_size
protectedinherited

Definition at line 97 of file Disk.h.

Referenced by Store::Disk::diskFull(), Store::Disk::maxSize(), and parseSize().

◆ min_objsize

int64_t Store::Disk::min_objsize
protectedinherited

◆ path

◆ removals

int Store::Disk::removals
inherited

Definition at line 106 of file Disk.h.

◆ repl

◆ scanned

int Store::Disk::scanned
inherited

Definition at line 107 of file Disk.h.

◆ slotSize

uint64_t Rock::SwapDir::slotSize

◆ theFile

◆ waitingForPage

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

Definition at line 148 of file RockSwapDir.h.

Referenced by noteFreeMapSlice(), and reserveSlotForWriting().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors