Storage.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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_STORE_STORAGE_H
10 #define SQUID_STORE_STORAGE_H
11 
12 #include "base/RefCount.h"
13 #include "store/forward.h"
14 
15 class StoreInfoStats;
16 
17 namespace Store {
18 
21 class Storage: public RefCountable
22 {
23 public:
24  virtual ~Storage() {}
25 
27  virtual void create() = 0;
28 
31  virtual void init() = 0;
32 
34  virtual StoreEntry *get(const cache_key *) = 0;
35 
40  virtual uint64_t maxSize() const = 0;
41 
43  virtual uint64_t minSize() const = 0;
44 
46  virtual uint64_t currentSize() const = 0;
47 
49  virtual uint64_t currentCount() const = 0;
50 
52  virtual int64_t maxObjectSize() const = 0;
53 
55  virtual void getStats(StoreInfoStats &stats) const = 0;
56 
61  virtual void stat(StoreEntry &e) const = 0;
62 
64  virtual void markForUnlink(StoreEntry &e) = 0;
65 
67  virtual void unlink(StoreEntry &e) = 0;
68 
70  virtual int callback() { return 0; }
71 
73  virtual void maintain() = 0;
74 
76  virtual void sync() {}
77 
81  virtual bool smpAware() const = 0;
82 };
83 
84 } // namespace Store
85 
86 #endif /* SQUID_STORE_STORAGE_H */
87 
virtual void sync()
prepare for shutdown
Definition: Storage.h:76
virtual uint64_t maxSize() const =0
unsigned char cache_key
Store key.
Definition: forward.h:29
virtual void stat(StoreEntry &e) const =0
virtual uint64_t currentCount() const =0
the total number of objects stored right now
class Ping::pingStats_ stats
virtual uint64_t currentSize() const =0
current size
High-level store statistics used by mgr:info action. Used inside PODs!
Definition: StoreStats.h:13
virtual bool smpAware() const =0
virtual void getStats(StoreInfoStats &stats) const =0
collect statistics
virtual ~Storage()
Definition: Storage.h:24
virtual void maintain()=0
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
virtual void create()=0
create system resources needed for this store to operate in the future
virtual int callback()
called once every main loop iteration; TODO: Move to UFS code.
Definition: Storage.h:70
virtual uint64_t minSize() const =0
the minimum size the store will shrink to via normal housekeeping
virtual void init()=0
virtual int64_t maxObjectSize() const =0
the maximum size of a storable object; -1 if unlimited
virtual void markForUnlink(StoreEntry &e)=0
expect an unlink() call after the entry becomes idle
virtual void unlink(StoreEntry &e)=0
remove the entry from the store

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors