summary view of all disk caches (cache_dirs) combined More...

#include <Disks.h>

Inheritance diagram for Store::Disks:
Collaboration diagram for Store::Disks:

Public Member Functions

 Disks ()
 
virtual void create () override
 create system resources needed for this store to operate in the future More...
 
virtual void init () override
 
virtual StoreEntryget (const cache_key *) override
 Retrieve a store entry from the store (blocking) More...
 
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 uint64_t currentSize () const override
 current size More...
 
virtual uint64_t currentCount () const override
 the total number of objects stored right now More...
 
virtual int64_t maxObjectSize () const override
 the maximum size of a storable object; -1 if unlimited More...
 
virtual void getStats (StoreInfoStats &stats) const override
 collect statistics More...
 
virtual void stat (StoreEntry &) const override
 
virtual void sync () override
 prepare for shutdown More...
 
virtual void reference (StoreEntry &) override
 somebody needs this entry (many cache replacement policies need to know) More...
 
virtual bool dereference (StoreEntry &e) override
 
virtual void updateHeaders (StoreEntry *) override
 make stored metadata and HTTP headers the same as in the given entry More...
 
virtual void maintain () override
 perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain More...
 
virtual bool anchorCollapsed (StoreEntry &e, bool &inSync) override
 
virtual bool updateCollapsed (StoreEntry &e) 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...
 
virtual int callback () override
 called once every main loop iteration; TODO: Move to UFS code. More...
 
void updateLimits ()
 slowly calculate (and cache) hi/lo watermarks and similar limits More...
 
int64_t accumulateMore (const StoreEntry &) const
 
virtual bool smpAware () const override
 

Private Member Functions

SwapDirstore (int const x) const
 
SwapDirdir (int const idx) const
 

Private Attributes

int64_t largestMinimumObjectSize
 maximum of all Disk::minObjectSize()s More...
 
int64_t largestMaximumObjectSize
 maximum of all Disk::maxObjectSize()s More...
 
int64_t secondLargestMaximumObjectSize
 the second-biggest Disk::maxObjectSize() More...
 

Detailed Description

Definition at line 18 of file Disks.h.

Constructor & Destructor Documentation

Store::Disks::Disks ( )

Definition at line 151 of file Disks.cc.

Member Function Documentation

int64_t Store::Disks::accumulateMore ( const StoreEntry entry) const

Additional unknown-size entry bytes required by disks in order to reduce the risk of selecting the wrong disk cache for the growing entry.

Definition at line 382 of file Disks.cc.

References MemObject::availableForSwapOut(), debugs, and StoreEntry::mem_obj.

bool Store::Disks::anchorCollapsed ( StoreEntry ,
bool &   
)
overridevirtual

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

Definition at line 501 of file Disks.cc.

References Store::Disk::active(), Store::Controlled::anchorCollapsed(), SquidConfig::cacheSwap, Config, debugs, and Store::DiskConfig::n_configured.

int Store::Disks::callback ( )
overridevirtual

Reimplemented from Store::Storage.

Definition at line 173 of file Disks.cc.

References SquidConfig::cacheSwap, Config, fatal(), i, and Store::DiskConfig::n_configured.

void Store::Disks::create ( )
overridevirtual
uint64_t Store::Disks::currentCount ( ) const
overridevirtual

Implements Store::Storage.

Definition at line 339 of file Disks.cc.

References SquidConfig::cacheSwap, Config, i, and Store::DiskConfig::n_configured.

uint64_t Store::Disks::currentSize ( ) const
overridevirtual

Implements Store::Storage.

Definition at line 326 of file Disks.cc.

References SquidConfig::cacheSwap, Config, i, and Store::DiskConfig::n_configured.

bool Store::Disks::dereference ( StoreEntry e)
overridevirtual

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 454 of file Disks.cc.

References Store::Disk::dereference(), and StoreEntry::disk().

SwapDir & Store::Disks::dir ( int const  idx) const
private

Definition at line 165 of file Disks.cc.

References assert, and INDEXSD.

StoreEntry * Store::Disks::get ( const cache_key )
overridevirtual
void Store::Disks::getStats ( StoreInfoStats stats) const
overridevirtual
void Store::Disks::maintain ( )
overridevirtual

Implements Store::Storage.

Definition at line 467 of file Disks.cc.

References SquidConfig::cacheSwap, Config, i, and Store::DiskConfig::n_configured.

void Store::Disks::markForUnlink ( StoreEntry e)
overridevirtual

Implements Store::Storage.

Definition at line 489 of file Disks.cc.

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

int64_t Store::Disks::maxObjectSize ( ) const
overridevirtual

Implements Store::Storage.

Definition at line 352 of file Disks.cc.

uint64_t Store::Disks::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.

Implements Store::Storage.

Definition at line 300 of file Disks.cc.

References SquidConfig::cacheSwap, Config, i, and Store::DiskConfig::n_configured.

uint64_t Store::Disks::minSize ( ) const
overridevirtual

Implements Store::Storage.

Definition at line 313 of file Disks.cc.

References SquidConfig::cacheSwap, Config, i, and Store::DiskConfig::n_configured.

void Store::Disks::reference ( StoreEntry e)
overridevirtual

Implements Store::Controlled.

Definition at line 448 of file Disks.cc.

References StoreEntry::disk(), and Store::Disk::reference().

bool Store::Disks::smpAware ( ) const
overridevirtual

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.

Definition at line 534 of file Disks.cc.

References SquidConfig::cacheSwap, Config, i, and Store::DiskConfig::n_configured.

void Store::Disks::stat ( StoreEntry e) const
overridevirtual

Output stats to the provided store entry.

Todo:
make these calls asynchronous

Implements Store::Storage.

Definition at line 435 of file Disks.cc.

References SquidConfig::cacheSwap, Config, i, Store::DiskConfig::n_configured, and storeAppendPrintf().

SwapDir * Store::Disks::store ( int const  x) const
private

Definition at line 159 of file Disks.cc.

References INDEXSD.

void Store::Disks::sync ( void  )
overridevirtual

Reimplemented from Store::Storage.

Definition at line 482 of file Disks.cc.

References SquidConfig::cacheSwap, Config, i, and Store::DiskConfig::n_configured.

void Store::Disks::unlink ( StoreEntry e)
overridevirtual

Implements Store::Storage.

Definition at line 495 of file Disks.cc.

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

bool Store::Disks::updateCollapsed ( StoreEntry )
overridevirtual

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

Definition at line 527 of file Disks.cc.

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

void Store::Disks::updateHeaders ( StoreEntry )
overridevirtual

Reimplemented from Store::Controlled.

Definition at line 460 of file Disks.cc.

References StoreEntry::disk(), Must, and Store::Controlled::updateHeaders().

void Store::Disks::updateLimits ( )

Definition at line 358 of file Disks.cc.

References SquidConfig::cacheSwap, Config, i, and Store::DiskConfig::n_configured.

Member Data Documentation

int64_t Store::Disks::largestMaximumObjectSize
private

Definition at line 59 of file Disks.h.

int64_t Store::Disks::largestMinimumObjectSize
private

Definition at line 58 of file Disks.h.

int64_t Store::Disks::secondLargestMaximumObjectSize
private

Definition at line 60 of file Disks.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors