stub_libstore.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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)
58 Controller &Root() STUB_RETREF(Controller)
59 }
60 
61 #include "store/Disk.h"
62 namespace Store
63 {
64 Disk::Disk(char const *) {STUB}
65 Disk::~Disk() {STUB}
66 char const *Disk::type() const STUB_RETVAL(nullptr)
67 bool Disk::needsDiskStrand() const STUB_RETVAL(false)
68 bool Disk::active() const STUB_RETVAL(false)
69 void Disk::diskFull() STUB
70 void Disk::create() STUB
71 StoreEntry *Disk::get(const cache_key *) STUB_RETVAL(nullptr)
72 uint64_t Disk::minSize() const STUB_RETVAL(0)
73 int64_t Disk::maxObjectSize() const STUB_RETVAL(0)
74 void Disk::getStats(StoreInfoStats &) const STUB
75 void Disk::stat(StoreEntry &) const STUB
76 void Disk::reference(StoreEntry &) STUB
77 bool Disk::dereference(StoreEntry &) STUB_RETVAL(false)
78 void Disk::maintain() STUB
79 int64_t Disk::minObjectSize() const STUB_RETVAL(0)
80 void Disk::maxObjectSize(int64_t) STUB
81 bool Disk::objectSizeIsAcceptable(int64_t) const STUB_RETVAL(false)
82 void Disk::parseOptions(int) STUB
83 void Disk::dumpOptions(StoreEntry *) const STUB
84 ConfigOption *Disk::getOptionTree() const STUB_RETVAL(nullptr)
85 void Disk::dump(StoreEntry &) const STUB
86 bool Disk::doubleCheck(StoreEntry &) STUB_RETVAL(false)
87 void Disk::statfs(StoreEntry &) const STUB
88 bool Disk::canLog(StoreEntry const &) const STUB_RETVAL(false)
89 void Disk::openLog() STUB
90 void Disk::closeLog() STUB
91 void Disk::logEntry(const StoreEntry &, int) const STUB
92 int Disk::writeCleanStart() STUB_RETVAL(0)
93 void Disk::writeCleanDone() STUB
94 }
95 
96 #include "store/Disks.h"
97 namespace Store
98 {
100 void Disks::create() STUB
101 void Disks::init() STUB
102 StoreEntry *Disks::get(const cache_key *) STUB_RETVAL(nullptr)
103 uint64_t Disks::maxSize() const STUB_RETVAL(0)
104 uint64_t Disks::minSize() const STUB_RETVAL(0)
105 uint64_t Disks::currentSize() const STUB_RETVAL(0)
106 uint64_t Disks::currentCount() const STUB_RETVAL(0)
107 int64_t Disks::maxObjectSize() const STUB_RETVAL(0)
108 void Disks::getStats(StoreInfoStats &) const STUB
109 void Disks::stat(StoreEntry &) const STUB
110 void Disks::sync() STUB
111 void Disks::reference(StoreEntry &) STUB
112 bool Disks::dereference(StoreEntry &) STUB_RETVAL(false)
113 void Disks::updateHeaders(StoreEntry *) STUB
114 void Disks::maintain() STUB
115 bool Disks::anchorToCache(StoreEntry &) STUB_RETVAL(false)
116 bool Disks::updateAnchored(StoreEntry &) STUB_RETVAL(false)
117 void Disks::evictCached(StoreEntry &) STUB
118 void Disks::evictIfFound(const cache_key *) STUB
119 int Disks::callback() STUB_RETVAL(0)
120 void Disks::configure() STUB
121 int64_t Disks::accumulateMore(const StoreEntry&) const STUB_RETVAL(0)
122 bool Disks::SmpAware() STUB_RETVAL(false)
123 bool Disks::hasReadableEntry(const StoreEntry &) const STUB_RETVAL(false)
124 void Disks::Parse(DiskConfig &) STUB
125 void Disks::Dump(const DiskConfig &, StoreEntry &, const char *) STUB
126 SwapDir *Disks::SelectSwapDir(const StoreEntry *) STUB_RETVAL(nullptr)
127 }
128 void storeDirOpenSwapLogs(void) STUB
130 void storeDirCloseSwapLogs(void) STUB
131 void allocate_new_swapdir(Store::DiskConfig &) STUB
132 void free_cachedir(Store::DiskConfig *) STUB;
133 void storeDirSwapLog(const StoreEntry *, int) STUB
134 
135 #include "store/LocalSearch.h"
136 namespace Store
137 {
139 }
140 
141 #include "store/SwapMetaIn.h"
142 size_t Store::UnpackSwapMetaSize(const SBuf &) STUB_RETVAL(0)
144 void Store::UnpackHitSwapMeta(char const *, ssize_t, StoreEntry &) STUB
145 
146 #include "store/SwapMetaOut.h"
147 AllocedBuf Store::PackSwapMeta(const StoreEntry &, size_t &) STUB_RETVAL(nullptr)
148 
int transientReaders(const StoreEntry &) const
number of the transient entry readers some time ago
Definition: Controller.cc:624
void memoryDisconnect(StoreEntry &)
disassociates the entry from the memory cache, preserving cached data
Definition: Controller.cc:609
void noteStoppedSharedWriting(StoreEntry &)
adjust shared state after this worker stopped changing the entry
Definition: Controller.cc:617
uint64_t minSize() const override
the minimum size the store will shrink to via normal housekeeping
Definition: Controller.cc:160
AllocedBuf PackSwapMeta(const StoreEntry &, size_t &size)
Definition: SwapMetaOut.cc:77
void memoryOut(StoreEntry &, const bool preserveSwappable)
called to get rid of no longer needed entry data in RAM, if any
Definition: Controller.cc:581
void UnpackHitSwapMeta(char const *, ssize_t, StoreEntry &)
deserializes entry metadata from the given buffer into the cache hit entry
Definition: SwapMetaIn.cc:310
void create() override
create system resources needed for this store to operate in the future
Definition: Controller.cc:73
manages a single cache_dir
Definition: Disk.h:21
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:315
void sync() override
prepare for shutdown
Definition: Controller.cc:212
#define STUB_RETVAL(x)
Definition: STUB.h:42
static bool SmpAware()
whether there are any SMP-aware storages
Definition: Controller.cc:912
void addReading(StoreEntry *, const cache_key *)
Definition: Controller.cc:745
Definition: SBuf.h:93
void init() override
Definition: Controller.cc:53
void configure()
update configuration, including limits (re)calculation
Definition: Controller.cc:188
bool transientsReader(const StoreEntry &) const
whether the entry is in "reading from Transients" I/O state
Definition: Controller.cc:460
int callback() override
called once every main loop iteration; TODO: Move to UFS code.
Definition: Controller.cc:223
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
size_t UnpackSwapMetaSize(const SBuf &)
Definition: SwapMetaIn.cc:237
void create() override
create system resources needed for this store to operate in the future
Definition: Disks.cc:221
void evictCached(StoreEntry &) override
Definition: Controller.cc:482
bool allowCollapsing(StoreEntry *, const RequestFlags &, const HttpRequestMethod &)
tries to make the entry available for collapsing future requests
Definition: Controller.cc:727
int64_t accumulateMore(StoreEntry &) const
Definition: Controller.cc:472
int const char size_t
Definition: stub_liblog.cc:83
void addWriting(StoreEntry *, const cache_key *)
Definition: Controller.cc:753
void transientsDisconnect(StoreEntry &)
disassociates the entry from the intransit table
Definition: Controller.cc:631
StoreEntry * find(const cache_key *)
Definition: Controller.cc:343
Definition: MemBuf.h:23
const char * type() const
Definition: Disk.cc:230
void evictIfFound(const cache_key *) override
Definition: Controller.cc:492
void free_cachedir(Store::DiskConfig *swap)
Definition: Disks.cc:806
bool markedForDeletion(const cache_key *key) const
Definition: Controller.cc:299
#define STUB_RETREF(x)
Definition: STUB.h:52
Disk(char const *aType)
Definition: Disk.cc:24
void getStats(StoreInfoStats &stats) const override
collect statistics
Definition: Controller.cc:106
void stat(StoreEntry &) const override
Definition: Controller.cc:132
StoreSearch * NewLocalSearch()
Definition: LocalSearch.cc:44
void syncCollapsed(const sfileno)
Update local intransit entry after changes made by appending worker.
Definition: Controller.cc:765
void allocate_new_swapdir(Store::DiskConfig &swap)
Definition: Disks.cc:787
#define STUB
macro to stub a void function.
Definition: STUB.h:34
~Disk() override
Definition: Disk.cc:33
StoreSearch * search()
Definition: Controller.cc:205
static int store_dirs_rebuilding
the number of cache_dirs being rebuilt; TODO: move to Disks::Rebuilding
Definition: Controller.h:133
signed_int32_t sfileno
Definition: forward.h:22
void storeDirCloseSwapLogs()
Definition: Disks.cc:684
uint64_t currentSize() const override
current size
Definition: Controller.cc:167
bool updateOnNotModified(StoreEntry *old, StoreEntry &e304)
Definition: Controller.cc:687
uint64_t maxSize() const override
Definition: Controller.cc:153
int storeDirWriteCleanLogs(int reopen)
Definition: Disks.cc:700
void Parse()
interprets (and partially applies) squid.conf or equivalent configuration
Definition: cache_cf.cc:610
int64_t maxObjectSize() const override
the maximum size of a storable object; -1 if unlimited
Definition: Controller.cc:181
StoreEntry * findCallbackXXX(const cache_key *)
Definition: Controller.cc:389
void maintain() override
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
Definition: Controller.cc:87
#define STUB_NOP
Definition: STUB.h:38
void handleIdleEntry(StoreEntry &)
called when the entry is no longer needed by any transaction
Definition: Controller.cc:638
size_t UnpackIndexSwapMeta(const MemBuf &, StoreEntry &, cache_key *)
Definition: SwapMetaIn.cc:243
StoreEntry * peek(const cache_key *)
Definition: Controller.cc:421
bool transientsWriter(const StoreEntry &) const
whether the entry is in "writing to Transients" I/O state
Definition: Controller.cc:466
void freeMemorySpace(const int spaceRequired)
Definition: Controller.cc:522
uint64_t currentCount() const override
the total number of objects stored right now
Definition: Controller.cc:174
void storeDirOpenSwapLogs()
Definition: Disks.cc:677
bool markedForDeletionAndAbandoned(const StoreEntry &) const
Definition: Controller.cc:306
High-level store statistics used by mgr:info action. Used inside PODs!
Definition: StoreStats.h:13
~Controller() override
this destructor is never called because Controller singleton is immortal
Definition: Controller.cc:46
Controller & Root()
safely access controller singleton
Definition: Controller.cc:926

 

Introduction

Documentation

Support

Miscellaneous