stub_libstore.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #include "squid.h"
10 
11 #define STUB_API "store/libstore.la"
12 #include "tests/STUB.h"
13 
14 #include "store/Controller.h"
15 namespace Store
16 {
21 uint64_t Controller::maxSize() const STUB_RETVAL(0)
22 uint64_t Controller::minSize() const STUB_RETVAL(0)
23 uint64_t Controller::currentSize() const STUB_RETVAL(0)
24 uint64_t Controller::currentCount() const STUB_RETVAL(0)
25 int64_t Controller::maxObjectSize() const STUB_RETVAL(0)
27 void Controller::stat(StoreEntry &) const STUB
36 bool Controller::markedForDeletion(const cache_key *) const STUB_RETVAL(false)
42 void Controller::freeMemorySpace(const int) STUB
43 void Controller::memoryOut(StoreEntry &, const bool) STUB
48 bool Controller::transientsReader(const StoreEntry &) const STUB_RETVAL(false)
49 bool Controller::transientsWriter(const StoreEntry &) const STUB_RETVAL(false)
62 void Init(Controller *) STUB
63 void FreeMemory() STUB
64 }
65 
66 #include "store/Disk.h"
67 namespace Store
68 {
69 Disk::Disk(char const *) {STUB}
70 Disk::~Disk() {STUB}
71 char const *Disk::type() const STUB_RETVAL(nullptr)
72 bool Disk::needsDiskStrand() const STUB_RETVAL(false)
73 bool Disk::active() const STUB_RETVAL(false)
74 void Disk::diskFull() STUB
75 void Disk::create() STUB
76 StoreEntry *Disk::get(const cache_key *) STUB_RETVAL(nullptr)
77 uint64_t Disk::minSize() const STUB_RETVAL(0)
78 int64_t Disk::maxObjectSize() const STUB_RETVAL(0)
80 void Disk::stat(StoreEntry &) const STUB
83 void Disk::maintain() STUB
84 int64_t Disk::minObjectSize() const STUB_RETVAL(0)
85 void Disk::maxObjectSize(int64_t) STUB
86 bool Disk::objectSizeIsAcceptable(int64_t) const STUB_RETVAL(false)
87 void Disk::parseOptions(int) STUB
88 void Disk::dumpOptions(StoreEntry *) const STUB
90 void Disk::dump(StoreEntry &) const STUB
92 void Disk::statfs(StoreEntry &) const STUB
93 bool Disk::canLog(StoreEntry const &) const STUB_RETVAL(false)
94 void Disk::openLog() STUB
95 void Disk::closeLog() STUB
96 void Disk::logEntry(const StoreEntry &, int) const STUB
99 }
100 
101 #include "store/Disks.h"
102 namespace Store
103 {
104 Disks::Disks() {STUB}
105 void Disks::create() STUB
106 void Disks::init() STUB
107 StoreEntry *Disks::get(const cache_key *) STUB_RETVAL(nullptr)
108 uint64_t Disks::maxSize() const STUB_RETVAL(0)
109 uint64_t Disks::minSize() const STUB_RETVAL(0)
110 uint64_t Disks::currentSize() const STUB_RETVAL(0)
111 uint64_t Disks::currentCount() const STUB_RETVAL(0)
112 int64_t Disks::maxObjectSize() const STUB_RETVAL(0)
113 void Disks::getStats(StoreInfoStats &) const STUB
114 void Disks::stat(StoreEntry &) const STUB
115 void Disks::sync() STUB
116 void Disks::reference(StoreEntry &) STUB
117 bool Disks::dereference(StoreEntry &) STUB_RETVAL(false)
118 void Disks::updateHeaders(StoreEntry *) STUB
119 void Disks::maintain() STUB
120 bool Disks::anchorToCache(StoreEntry &, bool &) STUB_RETVAL(false)
121 bool Disks::updateAnchored(StoreEntry &) STUB_RETVAL(false)
122 void Disks::evictCached(StoreEntry &) STUB
123 void Disks::evictIfFound(const cache_key *) STUB
124 int Disks::callback() STUB_RETVAL(0)
125 void Disks::configure() STUB
126 int64_t Disks::accumulateMore(const StoreEntry&) const STUB_RETVAL(0)
127 bool Disks::SmpAware() STUB_RETVAL(false)
128 bool Disks::hasReadableEntry(const StoreEntry &) const STUB_RETVAL(false)
129 void Disks::Parse(DiskConfig &) STUB
130 void Disks::Dump(const DiskConfig &, StoreEntry &, const char *) STUB
131 SwapDir *Disks::SelectSwapDir(const StoreEntry *) STUB_RETVAL(nullptr)
132 }
133 void storeDirOpenSwapLogs(void) STUB
135 void storeDirCloseSwapLogs(void) STUB
136 void allocate_new_swapdir(Store::DiskConfig &) STUB
137 void free_cachedir(Store::DiskConfig *) STUB;
138 void storeDirSwapLog(const StoreEntry *, int) STUB
139 
140 #include "store/LocalSearch.h"
141 namespace Store
142 {
144 }
145 
int transientReaders(const StoreEntry &) const
number of the transient entry readers some time ago
Definition: Controller.cc:651
virtual void dump(StoreEntry &) const
Definition: Disk.cc:43
void memoryDisconnect(StoreEntry &)
disassociates the entry from the memory cache, preserving cached data
Definition: Controller.cc:622
virtual bool doubleCheck(StoreEntry &)
Definition: Disk.cc:46
virtual uint64_t minSize() const override
the minimum size the store will shrink to via normal housekeeping
Definition: Controller.cc:166
void memoryOut(StoreEntry &, const bool preserveSwappable)
called to get rid of no longer needed entry data in RAM, if any
Definition: Controller.cc:594
virtual bool active() const
Definition: Disk.cc:236
virtual void stat(StoreEntry &) const override
Definition: Disk.cc:63
virtual void reference(StoreEntry &e) override
somebody needs this entry (many cache replacement policies need to know)
Definition: Disk.cc:136
virtual void logEntry(const StoreEntry &e, int op) const
Definition: Disk.cc:227
virtual void create() override
create system resources needed for this store to operate in the future
Definition: Controller.cc:78
manages a single cache_dir
Definition: Disk.h:22
unsigned char cache_key
Store key.
Definition: forward.h:29
bool hasReadableDiskEntry(const StoreEntry &) const
whether there is a disk entry with e.key
Definition: Controller.cc:321
virtual void sync() override
prepare for shutdown
Definition: Controller.cc:218
#define STUB_RETVAL(x)
Definition: STUB.h:41
static bool SmpAware()
whether there are any SMP-aware storages
Definition: Controller.cc:916
void addReading(StoreEntry *, const cache_key *)
Definition: Controller.cc:771
void FreeMemory()
undo Init()
Definition: Controller.cc:947
virtual StoreEntry * get(const cache_key *) override
Definition: Disk.cc:393
virtual void init() override
Definition: Controller.cc:58
void configure()
update configuration, including limits (re)calculation
Definition: Controller.cc:194
virtual void closeLog()
Definition: Disk.cc:215
bool transientsReader(const StoreEntry &) const
whether the entry is in "reading from Transients" I/O state
Definition: Controller.cc:473
virtual int callback() override
called once every main loop iteration; TODO: Move to UFS code.
Definition: Controller.cc:229
virtual int64_t maxObjectSize() const override
the maximum size of a storable object; -1 if unlimited
Definition: Disk.cc:103
void storeDirOpenSwapLogs(void) STUB int storeDirWriteCleanLogs(int) STUB_RETVAL(0) void storeDirCloseSwapLogs(void) STUB void allocate_new_swapdir(Store void storeDirSwapLog(const StoreEntry *, int) STUB namespace Store
virtual void statfs(StoreEntry &) const
Definition: Disk.cc:83
virtual void create() override
create system resources needed for this store to operate in the future
Definition: Disks.cc:220
int64_t minObjectSize() const
the size of the smallest entry this cache_dir can store
Definition: Disk.cc:96
void transientsCompleteWriting(StoreEntry &)
marks the entry completed for collapsed requests
Definition: Controller.cc:640
virtual void evictCached(StoreEntry &) override
Definition: Controller.cc:495
char const * type() const
Definition: Disk.cc:230
bool allowCollapsing(StoreEntry *, const RequestFlags &, const HttpRequestMethod &)
tries to make the entry available for collapsing future requests
Definition: Controller.cc:754
int64_t accumulateMore(StoreEntry &) const
Definition: Controller.cc:485
virtual ~Disk()
Definition: Disk.cc:33
void addWriting(StoreEntry *, const cache_key *)
Definition: Controller.cc:779
virtual void openLog()
Definition: Disk.cc:212
void transientsDisconnect(StoreEntry &)
disassociates the entry from the intransit table
Definition: Controller.cc:658
StoreEntry * find(const cache_key *)
Definition: Controller.cc:349
virtual bool dereference(StoreEntry &e) override
Definition: Disk.cc:139
void stopSharing(StoreEntry &)
stop any current (and prevent any future) SMP sharing of the given entry
Definition: Controller.cc:630
virtual void diskFull()
Definition: Disk.cc:145
virtual void evictIfFound(const cache_key *) override
Definition: Controller.cc:506
virtual bool needsDiskStrand() const
needs a dedicated kid process
Definition: Disk.cc:249
void free_cachedir(Store::DiskConfig *swap)
Definition: Disks.cc:802
bool markedForDeletion(const cache_key *key) const
Definition: Controller.cc:305
Disk(char const *aType)
Definition: Disk.cc:24
virtual void getStats(StoreInfoStats &stats) const override
collect statistics
Definition: Controller.cc:111
virtual void stat(StoreEntry &) const override
Definition: Controller.cc:137
StoreSearch * NewLocalSearch()
Definition: LocalSearch.cc:44
bool objectSizeIsAcceptable(int64_t objSize) const
Definition: Disk.cc:156
bool canLog(StoreEntry const &e) const
Definition: Disk.cc:188
void syncCollapsed(const sfileno)
Update local intransit entry after changes made by appending worker.
Definition: Controller.cc:791
void allocate_new_swapdir(Store::DiskConfig &swap)
Definition: Disks.cc:783
#define STUB
macro to stub a void function.
Definition: STUB.h:33
virtual ConfigOption * getOptionTree() const
Definition: Disk.cc:258
StoreSearch * search()
Definition: Controller.cc:211
void parseOptions(int reconfiguring)
Definition: Disk.cc:267
static int store_dirs_rebuilding
the number of cache_dirs being rebuilt; TODO: move to Disks::Rebuilding
Definition: Controller.h:139
void transientsClearCollapsingRequirement(StoreEntry &e)
removes collapsing requirement (for future hits)
Definition: Controller.cc:665
signed_int32_t sfileno
Definition: forward.h:22
void storeDirCloseSwapLogs()
Definition: Disks.cc:680
void Init(Controller *root=nullptr)
initialize the storage module; a custom root is used by unit tests only
Definition: Controller.cc:941
void dumpOptions(StoreEntry *e) const
Definition: Disk.cc:307
virtual uint64_t currentSize() const override
current size
Definition: Controller.cc:173
virtual int writeCleanStart()
Definition: Disk.cc:218
virtual void maintain() override
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
Definition: Disk.cc:86
virtual uint64_t maxSize() const override
Definition: Controller.cc:159
int storeDirWriteCleanLogs(int reopen)
Definition: Disks.cc:696
virtual void writeCleanDone()
Definition: Disk.cc:224
virtual int64_t maxObjectSize() const override
the maximum size of a storable object; -1 if unlimited
Definition: Controller.cc:187
StoreEntry * findCallbackXXX(const cache_key *)
Definition: Controller.cc:400
void updateOnNotModified(StoreEntry *old, StoreEntry &e304)
using a 304 response, update the old entry (metadata and reply headers)
Definition: Controller.cc:721
virtual void maintain() override
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
Definition: Controller.cc:92
#define STUB_NOP
Definition: STUB.h:37
void handleIdleEntry(StoreEntry &)
called when the entry is no longer needed by any transaction
Definition: Controller.cc:672
virtual uint64_t minSize() const override
the minimum size the store will shrink to via normal housekeeping
Definition: Disk.cc:89
StoreEntry * peek(const cache_key *)
Definition: Controller.cc:432
void Controller::create() STUB void Controller Controller nil
bool transientsWriter(const StoreEntry &) const
whether the entry is in "writing to Transients" I/O state
Definition: Controller.cc:479
void freeMemorySpace(const int spaceRequired)
Definition: Controller.cc:535
virtual uint64_t currentCount() const override
the total number of objects stored right now
Definition: Controller.cc:180
void storeDirOpenSwapLogs()
Definition: Disks.cc:673
virtual void getStats(StoreInfoStats &stats) const override
collect statistics
Definition: Disk.cc:52
bool markedForDeletionAndAbandoned(const StoreEntry &) const
Definition: Controller.cc:312
#define false
Definition: GnuRegex.c:233
static Parsed Parse(const SBuf &buf)
extracts PROXY protocol v1 header from the given buffer
Definition: Parser.cc:113
virtual void create() override
create system resources needed for this store to operate in the future
Definition: Disk.cc:40
High-level store statistics used by mgr:info action. Used inside PODs!
Definition: StoreStats.h:14
virtual ~Controller() override
Definition: Controller.cc:44
Controller & Root()
safely access controller singleton
Definition: Controller.cc:934

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors