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"
15namespace Store
16{
21uint64_t Controller::maxSize() const STUB_RETVAL(0)
22uint64_t Controller::minSize() const STUB_RETVAL(0)
23uint64_t Controller::currentSize() const STUB_RETVAL(0)
24uint64_t Controller::currentCount() const STUB_RETVAL(0)
43void Controller::memoryOut(StoreEntry &, const bool) STUB
60void Init(Controller *) STUB
61void FreeMemory() STUB
62}
63
64#include "store/Disk.h"
65namespace Store
66{
67Disk::Disk(char const *) {STUB}
69char const *Disk::type() const STUB_RETVAL(nullptr)
70bool Disk::needsDiskStrand() const STUB_RETVAL(false)
71bool Disk::active() const STUB_RETVAL(false)
73void Disk::create() STUB
75uint64_t Disk::minSize() const STUB_RETVAL(0)
76int64_t Disk::maxObjectSize() const STUB_RETVAL(0)
78void Disk::stat(StoreEntry &) const STUB
82int64_t Disk::minObjectSize() const STUB_RETVAL(0)
83void Disk::maxObjectSize(int64_t) STUB
84bool Disk::objectSizeIsAcceptable(int64_t) const STUB_RETVAL(false)
88void Disk::dump(StoreEntry &) const STUB
90void Disk::statfs(StoreEntry &) const STUB
91bool Disk::canLog(StoreEntry const &) const STUB_RETVAL(false)
94void Disk::logEntry(const StoreEntry &, int) const STUB
97}
98
99#include "store/Disks.h"
100namespace Store
101{
103void Disks::create() STUB
104void Disks::init() STUB
105StoreEntry *Disks::get(const cache_key *) STUB_RETVAL(nullptr)
106uint64_t Disks::maxSize() const STUB_RETVAL(0)
107uint64_t Disks::minSize() const STUB_RETVAL(0)
108uint64_t Disks::currentSize() const STUB_RETVAL(0)
109uint64_t Disks::currentCount() const STUB_RETVAL(0)
110int64_t Disks::maxObjectSize() const STUB_RETVAL(0)
111void Disks::getStats(StoreInfoStats &) const STUB
112void Disks::stat(StoreEntry &) const STUB
113void Disks::sync() STUB
114void Disks::reference(StoreEntry &) STUB
115bool Disks::dereference(StoreEntry &) STUB_RETVAL(false)
116void Disks::updateHeaders(StoreEntry *) STUB
117void Disks::maintain() STUB
118bool Disks::anchorToCache(StoreEntry &, bool &) STUB_RETVAL(false)
119bool Disks::updateAnchored(StoreEntry &) STUB_RETVAL(false)
120void Disks::evictCached(StoreEntry &) STUB
121void Disks::evictIfFound(const cache_key *) STUB
122int Disks::callback() STUB_RETVAL(0)
123void Disks::configure() STUB
124int64_t Disks::accumulateMore(const StoreEntry&) const STUB_RETVAL(0)
125bool Disks::SmpAware() STUB_RETVAL(false)
126bool Disks::hasReadableEntry(const StoreEntry &) const STUB_RETVAL(false)
127void Disks::Parse(DiskConfig &) STUB
128void Disks::Dump(const DiskConfig &, StoreEntry &, const char *) STUB
129SwapDir *Disks::SelectSwapDir(const StoreEntry *) STUB_RETVAL(nullptr)
130}
131void storeDirOpenSwapLogs(void) STUB
134void allocate_new_swapdir(Store::DiskConfig &) STUB
135void free_cachedir(Store::DiskConfig *) STUB;
137
138#include "store/LocalSearch.h"
139namespace Store
140{
142}
143
144#include "store/SwapMetaIn.h"
147void Store::UnpackHitSwapMeta(char const *, ssize_t, StoreEntry &) STUB
148
149#include "store/SwapMetaOut.h"
150AllocedBuf Store::PackSwapMeta(const StoreEntry &, size_t &) STUB_RETVAL(nullptr)
151
void free_cachedir(Store::DiskConfig *swap)
Definition: Disks.cc:802
void allocate_new_swapdir(Store::DiskConfig &swap)
Definition: Disks.cc:783
void storeDirOpenSwapLogs()
Definition: Disks.cc:673
int storeDirWriteCleanLogs(int reopen)
Definition: Disks.cc:696
void storeDirCloseSwapLogs()
Definition: Disks.cc:680
#define false
Definition: GnuRegex.c:240
#define STUB
macro to stub a void function.
Definition: STUB.h:33
#define STUB_NOP
Definition: STUB.h:37
#define STUB_RETVAL(x)
Definition: STUB.h:41
std::unique_ptr< void, HardFun< void, const void *, &xfree_cpp > > AllocedBuf
memory allocated by xmalloc() or xcalloc(), to be freed by xfree()
Definition: SwapMetaOut.h:24
Definition: MemBuf.h:24
Definition: SBuf.h:94
High-level store statistics used by mgr:info action. Used inside PODs!
Definition: StoreStats.h:14
void memoryOut(StoreEntry &, const bool preserveSwappable)
called to get rid of no longer needed entry data in RAM, if any
Definition: Controller.cc:594
void configure()
update configuration, including limits (re)calculation
Definition: Controller.cc:194
virtual ~Controller() override
Definition: Controller.cc:44
StoreEntry * findCallbackXXX(const cache_key *)
Definition: Controller.cc:400
bool markedForDeletionAndAbandoned(const StoreEntry &) const
Definition: Controller.cc:312
int transientReaders(const StoreEntry &) const
number of the transient entry readers some time ago
Definition: Controller.cc:637
void noteStoppedSharedWriting(StoreEntry &)
adjust shared state after this worker stopped changing the entry
Definition: Controller.cc:630
void addReading(StoreEntry *, const cache_key *)
Definition: Controller.cc:751
void addWriting(StoreEntry *, const cache_key *)
Definition: Controller.cc:759
virtual uint64_t maxSize() const override
Definition: Controller.cc:159
void handleIdleEntry(StoreEntry &)
called when the entry is no longer needed by any transaction
Definition: Controller.cc:651
bool allowCollapsing(StoreEntry *, const RequestFlags &, const HttpRequestMethod &)
tries to make the entry available for collapsing future requests
Definition: Controller.cc:733
virtual void sync() override
prepare for shutdown
Definition: Controller.cc:218
virtual void stat(StoreEntry &) const override
Definition: Controller.cc:137
bool transientsReader(const StoreEntry &) const
whether the entry is in "reading from Transients" I/O state
Definition: Controller.cc:473
void freeMemorySpace(const int spaceRequired)
Definition: Controller.cc:535
virtual void maintain() override
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
Definition: Controller.cc:92
void syncCollapsed(const sfileno)
Update local intransit entry after changes made by appending worker.
Definition: Controller.cc:771
virtual void getStats(StoreInfoStats &stats) const override
collect statistics
Definition: Controller.cc:111
virtual uint64_t minSize() const override
the minimum size the store will shrink to via normal housekeeping
Definition: Controller.cc:166
void memoryDisconnect(StoreEntry &)
disassociates the entry from the memory cache, preserving cached data
Definition: Controller.cc:622
bool hasReadableDiskEntry(const StoreEntry &) const
whether there is a disk entry with e.key
Definition: Controller.cc:321
bool markedForDeletion(const cache_key *key) const
Definition: Controller.cc:305
void transientsDisconnect(StoreEntry &)
disassociates the entry from the intransit table
Definition: Controller.cc:644
int64_t accumulateMore(StoreEntry &) const
Definition: Controller.cc:485
static int store_dirs_rebuilding
the number of cache_dirs being rebuilt; TODO: move to Disks::Rebuilding
Definition: Controller.h:133
StoreSearch * search()
Definition: Controller.cc:211
virtual int64_t maxObjectSize() const override
the maximum size of a storable object; -1 if unlimited
Definition: Controller.cc:187
virtual void init() override
Definition: Controller.cc:58
static bool SmpAware()
whether there are any SMP-aware storages
Definition: Controller.cc:908
bool transientsWriter(const StoreEntry &) const
whether the entry is in "writing to Transients" I/O state
Definition: Controller.cc:479
virtual void create() override
create system resources needed for this store to operate in the future
Definition: Controller.cc:78
virtual uint64_t currentSize() const override
current size
Definition: Controller.cc:173
virtual void evictCached(StoreEntry &) override
Definition: Controller.cc:495
virtual void evictIfFound(const cache_key *) override
Definition: Controller.cc:506
void updateOnNotModified(StoreEntry *old, StoreEntry &e304)
using a 304 response, update the old entry (metadata and reply headers)
Definition: Controller.cc:700
StoreEntry * find(const cache_key *)
Definition: Controller.cc:349
virtual uint64_t currentCount() const override
the total number of objects stored right now
Definition: Controller.cc:180
virtual int callback() override
called once every main loop iteration; TODO: Move to UFS code.
Definition: Controller.cc:229
StoreEntry * peek(const cache_key *)
Definition: Controller.cc:432
manages a single cache_dir
Definition: Disk.h:22
bool canLog(StoreEntry const &e) const
Definition: Disk.cc:188
virtual bool active() const
Definition: Disk.cc:236
virtual void create() override
create system resources needed for this store to operate in the future
Definition: Disk.cc:40
virtual void diskFull()
Definition: Disk.cc:145
virtual ~Disk()
Definition: Disk.cc:33
virtual void openLog()
Definition: Disk.cc:212
virtual bool doubleCheck(StoreEntry &)
Definition: Disk.cc:46
virtual bool needsDiskStrand() const
needs a dedicated kid process
Definition: Disk.cc:249
void parseOptions(int reconfiguring)
Definition: Disk.cc:267
bool objectSizeIsAcceptable(int64_t objSize) const
Definition: Disk.cc:156
virtual void writeCleanDone()
Definition: Disk.cc:224
int64_t minObjectSize() const
the size of the smallest entry this cache_dir can store
Definition: Disk.cc:96
char const * type() const
Definition: Disk.cc:230
virtual int writeCleanStart()
Definition: Disk.cc:218
void dumpOptions(StoreEntry *e) const
Definition: Disk.cc:307
virtual void statfs(StoreEntry &) const
Definition: Disk.cc:83
virtual uint64_t minSize() const override
the minimum size the store will shrink to via normal housekeeping
Definition: Disk.cc:89
virtual void logEntry(const StoreEntry &e, int op) const
Definition: Disk.cc:227
virtual int64_t maxObjectSize() const override
the maximum size of a storable object; -1 if unlimited
Definition: Disk.cc:103
virtual void stat(StoreEntry &) const override
Definition: Disk.cc:63
virtual StoreEntry * get(const cache_key *) override
Definition: Disk.cc:393
virtual void dump(StoreEntry &) const
Definition: Disk.cc:43
virtual ConfigOption * getOptionTree() const
Definition: Disk.cc:258
virtual void reference(StoreEntry &e) override
somebody needs this entry (many cache replacement policies need to know)
Definition: Disk.cc:136
virtual bool dereference(StoreEntry &e) override
Definition: Disk.cc:139
virtual void getStats(StoreInfoStats &stats) const override
collect statistics
Definition: Disk.cc:52
virtual void closeLog()
Definition: Disk.cc:215
virtual void maintain() override
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
Definition: Disk.cc:86
Disk(char const *aType)
Definition: Disk.cc:24
virtual void create() override
create system resources needed for this store to operate in the future
Definition: Disks.cc:220
static Parsed Parse(const SBuf &buf)
extracts PROXY protocol v1 header from the given buffer
Definition: Parser.cc:113
Controller & Root()
safely access controller singleton
Definition: Controller.cc:926
size_t UnpackSwapMetaSize(const SBuf &)
Definition: SwapMetaIn.cc:237
void UnpackHitSwapMeta(char const *, ssize_t, StoreEntry &)
deserializes entry metadata from the given buffer into the cache hit entry
Definition: SwapMetaIn.cc:310
size_t UnpackIndexSwapMeta(const MemBuf &, StoreEntry &, cache_key *)
Definition: SwapMetaIn.cc:243
StoreSearch * NewLocalSearch()
Definition: LocalSearch.cc:44
void Controller::create() STUB void Controller Controller nil
void FreeMemory()
undo Init()
Definition: Controller.cc:939
void Init(Controller *root=nullptr)
initialize the storage module; a custom root is used by unit tests only
Definition: Controller.cc:933
AllocedBuf PackSwapMeta(const StoreEntry &, size_t &size)
Definition: SwapMetaOut.cc:77
unsigned char cache_key
Store key.
Definition: forward.h:29
signed_int32_t sfileno
Definition: forward.h:22
int const char size_t
Definition: stub_liblog.cc:86
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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors