Storage.h
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 #ifndef SQUID_SRC_STORE_STORAGE_H
10 #define SQUID_SRC_STORE_STORAGE_H
11 
12 #include "base/RefCount.h"
13 #include "http/RequestMethod.h"
14 #include "store/forward.h"
15 #include "store_key_md5.h"
16 
17 class StoreInfoStats;
18 
19 namespace Store {
20 
23 class Storage: public RefCountable
24 {
25 public:
26  ~Storage() override {}
27 
29  virtual void create() = 0;
30 
33  virtual void init() = 0;
34 
39  virtual uint64_t maxSize() const = 0;
40 
42  virtual uint64_t minSize() const = 0;
43 
45  virtual uint64_t currentSize() const = 0;
46 
48  virtual uint64_t currentCount() const = 0;
49 
51  virtual int64_t maxObjectSize() const = 0;
52 
54  virtual void getStats(StoreInfoStats &stats) const = 0;
55 
60  virtual void stat(StoreEntry &e) const = 0;
61 
65  virtual void evictCached(StoreEntry &e) = 0;
66 
69  virtual void evictIfFound(const cache_key *) = 0;
70 
72  virtual int callback() { return 0; }
73 
75  virtual void maintain() = 0;
76 
78  virtual void sync() {}
79 };
80 
81 } // namespace Store
82 
83 #endif /* SQUID_SRC_STORE_STORAGE_H */
84 
virtual void sync()
prepare for shutdown
Definition: Storage.h:78
virtual void getStats(StoreInfoStats &stats) const =0
collect statistics
unsigned char cache_key
Store key.
Definition: forward.h:29
virtual uint64_t currentCount() const =0
the total number of objects stored right now
virtual void init()=0
virtual void stat(StoreEntry &e) const =0
virtual int callback()
called once every main loop iteration; TODO: Move to UFS code.
Definition: Storage.h:72
virtual void create()=0
create system resources needed for this store to operate in the future
~Storage() override
Definition: Storage.h:26
virtual uint64_t maxSize() const =0
virtual uint64_t currentSize() const =0
current size
virtual void maintain()=0
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
virtual int64_t maxObjectSize() const =0
the maximum size of a storable object; -1 if unlimited
virtual uint64_t minSize() const =0
the minimum size the store will shrink to via normal housekeeping
virtual void evictIfFound(const cache_key *)=0
High-level store statistics used by mgr:info action. Used inside PODs!
Definition: StoreStats.h:13
virtual void evictCached(StoreEntry &e)=0

 

Introduction

Documentation

Support

Miscellaneous