allows testing of methods without having all the other components live More...

#include <testStore.h>

Inheritance diagram for TestStore:
Collaboration diagram for TestStore:

Public Member Functions

 TestStore ()
 
virtual int callback ()
 called once every main loop iteration; TODO: Move to UFS code. More...
 
virtual StoreEntryget (const cache_key *)
 
virtual void get (String, void(*)(StoreEntry *, void *), void *)
 
virtual void init ()
 
virtual void maintain ()
 perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain More...
 
virtual uint64_t maxSize () const
 
virtual uint64_t minSize () const
 the minimum size the store will shrink to via normal housekeeping More...
 
virtual uint64_t currentSize () const
 current size More...
 
virtual uint64_t currentCount () const
 the total number of objects stored right now More...
 
virtual int64_t maxObjectSize () const
 the maximum size of a storable object; -1 if unlimited More...
 
virtual void getStats (StoreInfoStats &) const
 collect statistics More...
 
virtual void stat (StoreEntry &) const
 
virtual void reference (StoreEntry &)
 
virtual bool dereference (StoreEntry &)
 
virtual StoreSearchsearch ()
 
virtual void create () override
 create system resources needed for this store to operate in the future More...
 
virtual void sync () override
 prepare for shutdown More...
 
virtual void evictCached (StoreEntry &) override
 
virtual void evictIfFound (const cache_key *) override
 
virtual bool smpAware () const override
 
StoreEntryfind (const cache_key *)
 
StoreEntrypeek (const cache_key *)
 
StoreEntryfindCallbackXXX (const cache_key *)
 
bool markedForDeletion (const cache_key *key) const
 
bool markedForDeletionAndAbandoned (const StoreEntry &) const
 
bool hasReadableDiskEntry (const StoreEntry &) const
 whether there is a disk entry with e.key More...
 
int64_t accumulateMore (StoreEntry &) const
 
void updateLimits ()
 slowly calculate (and cache) hi/lo watermarks and similar limits More...
 
void handleIdleEntry (StoreEntry &)
 called when the entry is no longer needed by any transaction More...
 
void freeMemorySpace (const int spaceRequired)
 
void memoryOut (StoreEntry &, const bool preserveSwappable)
 called to get rid of no longer needed entry data in RAM, if any More...
 
void updateOnNotModified (StoreEntry *old, const StoreEntry &newer)
 update old entry metadata and HTTP headers using a newer entry More...
 
bool allowCollapsing (StoreEntry *, const RequestFlags &, const HttpRequestMethod &)
 tries to make the entry available for collapsing future requests More...
 
void addReading (StoreEntry *, const cache_key *)
 
void addWriting (StoreEntry *, const cache_key *)
 
bool transientsReader (const StoreEntry &) const
 whether the entry is in "reading from Transients" I/O state More...
 
bool transientsWriter (const StoreEntry &) const
 whether the entry is in "writing to Transients" I/O state More...
 
void transientsCompleteWriting (StoreEntry &)
 marks the entry completed for collapsed requests More...
 
void syncCollapsed (const sfileno)
 Update local intransit entry after changes made by appending worker. More...
 
void stopSharing (StoreEntry &)
 stop any current (and prevent any future) SMP sharing of the given entry More...
 
int transientReaders (const StoreEntry &) const
 number of the transient entry readers some time ago More...
 
void transientsDisconnect (StoreEntry &)
 disassociates the entry from the intransit table More...
 
void memoryDisconnect (StoreEntry &)
 disassociates the entry from the memory cache, preserving cached data More...
 

Public Attributes

bool statsCalled
 

Static Public Attributes

static int store_dirs_rebuilding = 1
 the number of cache_dirs being rebuilt; TODO: move to Disks::Rebuilding More...
 

Detailed Description

Definition at line 40 of file testStore.h.

Constructor & Destructor Documentation

TestStore::TestStore ( )
inline

Definition at line 44 of file testStore.h.

Member Function Documentation

int64_t Store::Controller::accumulateMore ( StoreEntry entry) const
inherited

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

Definition at line 437 of file Controller.cc.

Referenced by StoreEntry::mayStartSwapOut().

void Store::Controller::addReading ( StoreEntry e,
const cache_key key 
)
inherited

register a being-read StoreEntry (to optimize concurrent cache reads and to receive remote DELETE events)

Definition at line 697 of file Controller.cc.

References StoreEntry::hashInsert(), and Store::ioReading.

void Store::Controller::addWriting ( StoreEntry e,
const cache_key key 
)
inherited

register a being-written StoreEntry (to support concurrent cache reads and to receive remote DELETE events)

Definition at line 705 of file Controller.cc.

References assert, EBIT_TEST, ENTRY_SPECIAL, StoreEntry::flags, and Store::ioWriting.

Referenced by StoreEntry::setPublicKey().

bool Store::Controller::allowCollapsing ( StoreEntry e,
const RequestFlags reqFlags,
const HttpRequestMethod reqMethod 
)
inherited
int TestStore::callback ( )
virtual

Reimplemented from Store::Controller.

Definition at line 17 of file testStore.cc.

void Store::Controller::create ( )
overridevirtualinherited

Implements Store::Storage.

Definition at line 75 of file Controller.cc.

References pid, and WaitForAnyPid().

Referenced by SquidMain().

uint64_t TestStore::currentCount ( ) const
virtual

Reimplemented from Store::Controller.

Definition at line 55 of file testStore.cc.

uint64_t TestStore::currentSize ( ) const
virtual

Reimplemented from Store::Controller.

Definition at line 49 of file testStore.cc.

virtual bool TestStore::dereference ( StoreEntry )
inlinevirtual

Definition at line 74 of file testStore.h.

void Store::Controller::evictCached ( StoreEntry e)
overridevirtualinherited

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 447 of file Controller.cc.

References debugs.

Referenced by StoreEntry::release(), and StoreEntry::setPrivateKey().

void Store::Controller::evictIfFound ( const cache_key )
overridevirtualinherited

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 458 of file Controller.cc.

References debugs, and storeKeyText().

Referenced by purgeEntriesByUrl().

StoreEntry * Store::Controller::find ( const cache_key key)
inherited
Returns
a locally indexed and SMP-tracked matching StoreEntry (or nil) Slower than peek() but does not restrict StoreEntry use and storage. Counts as an entry reference from the removal policy p.o.v.

Definition at line 315 of file Controller.cc.

References debugs, and NULL.

Referenced by storeGetPublic(), and storeGetPublicByRequestMethod().

StoreEntry * Store::Controller::findCallbackXXX ( const cache_key key)
inherited
Returns
matching StoreEntry associated with local ICP/HTCP transaction Warning: The returned StoreEntry is not synced and may be marked for deletion. It can only be used for extracting transaction callback details. New code should be designed to avoid this deprecated API.

Definition at line 352 of file Controller.cc.

References hash_lookup(), and store_table.

Referenced by neighborsHtcpReply().

void Store::Controller::freeMemorySpace ( const int  spaceRequired)
inherited

Evict memory cache entries to free at least spaceRequired bytes. Should be called via storeGetMemSpace(). Unreliable: Fails if enough victims cannot be found fast enough.

Definition at line 487 of file Controller.cc.

References debugs, hot_obj_count, mem_policy, RemovalPolicy::PurgeInit, SM_PAGE_SIZE, and squid_curtime.

Referenced by storeGetMemSpace().

StoreEntry * TestStore::get ( const cache_key )
virtual

Definition at line 23 of file testStore.cc.

References NULL.

void TestStore::get ( String  ,
void(*)(StoreEntry *, void *)  ,
void *   
)
virtual

Definition at line 29 of file testStore.cc.

void TestStore::getStats ( StoreInfoStats stats) const
virtual

Reimplemented from Store::Controller.

Definition at line 67 of file testStore.cc.

bool Store::Controller::hasReadableDiskEntry ( const StoreEntry e) const
inherited

Definition at line 309 of file Controller.cc.

void TestStore::init ( )
virtual

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

Reimplemented from Store::Controller.

Definition at line 33 of file testStore.cc.

virtual void TestStore::maintain ( )
inlinevirtual

Reimplemented from Store::Controller.

Definition at line 56 of file testStore.h.

bool Store::Controller::markedForDeletion ( const cache_key key) const
inherited

Whether a transient entry with the given public key exists and (but) was marked for removal some time ago; get(key) returns nil in such cases.

Definition at line 293 of file Controller.cc.

Referenced by Ipc::StoreMapAnchor::setKey().

bool Store::Controller::markedForDeletionAndAbandoned ( const StoreEntry e) const
inherited

markedForDeletion() with no readers this is one method because the two conditions must be checked in the right order

Definition at line 300 of file Controller.cc.

References hash_link::key.

int64_t TestStore::maxObjectSize ( ) const
virtual

Reimplemented from Store::Controller.

Definition at line 61 of file testStore.cc.

uint64_t TestStore::maxSize ( ) const
virtual

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::Controller.

Definition at line 37 of file testStore.cc.

void Store::Controller::memoryDisconnect ( StoreEntry e)
inherited

Definition at line 574 of file Controller.cc.

Referenced by StoreEntry::destroyMemObject().

void Store::Controller::memoryOut ( StoreEntry e,
const bool  preserveSwappable 
)
inherited

Definition at line 546 of file Controller.cc.

References debugs, HERE(), and StoreEntry::trimMemory().

Referenced by StoreEntry::swapOut().

uint64_t TestStore::minSize ( ) const
virtual

Reimplemented from Store::Controller.

Definition at line 43 of file testStore.cc.

StoreEntry * Store::Controller::peek ( const cache_key key)
inherited
Returns
a matching StoreEntry not suitable for long-term use (or nil) Faster than find() but the returned entry may not receive updates, may lack information from some of the Stores, and should not be updated except that purging peek()ed entries is supported. Does not count as an entry reference from the removal policy p.o.v.

Definition at line 384 of file Controller.cc.

References debugs, HERE(), and storeKeyText().

virtual void TestStore::reference ( StoreEntry )
inlinevirtual

Definition at line 72 of file testStore.h.

StoreSearch * TestStore::search ( )
virtual

Definition at line 78 of file testStore.cc.

References NULL.

bool Store::Controller::smpAware ( ) const
overridevirtualinherited

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 832 of file Controller.cc.

Referenced by clientReplyContext::processExpired().

void TestStore::stat ( StoreEntry e) const
virtual

Output stats to the provided store entry.

Todo:
make these calls asynchronous

Reimplemented from Store::Controller.

Definition at line 72 of file testStore.cc.

References statsCalled.

void Store::Controller::stopSharing ( StoreEntry e)
inherited
void Store::Controller::sync ( void  )
overridevirtualinherited

Reimplemented from Store::Storage.

Definition at line 212 of file Controller.cc.

Referenced by SquidShutdown().

int Store::Controller::transientReaders ( const StoreEntry e) const
inherited

Definition at line 603 of file Controller.cc.

References StoreEntry::hasTransients().

Referenced by CollapsedForwarding::Broadcast().

void Store::Controller::transientsCompleteWriting ( StoreEntry e)
inherited

Definition at line 592 of file Controller.cc.

References StoreEntry::hasTransients().

Referenced by MemStore::completeWriting(), and storeSwapOutFileClosed().

void Store::Controller::transientsDisconnect ( StoreEntry e)
inherited

Definition at line 610 of file Controller.cc.

Referenced by StoreEntry::destroyMemObject().

bool Store::Controller::transientsReader ( const StoreEntry e) const
inherited

Definition at line 425 of file Controller.cc.

References StoreEntry::hasTransients().

bool Store::Controller::transientsWriter ( const StoreEntry e) const
inherited

Definition at line 431 of file Controller.cc.

References StoreEntry::hasTransients().

Member Data Documentation

bool TestStore::statsCalled

Definition at line 46 of file testStore.h.

Referenced by stat(), and testStore::testStats().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors