19 #ifndef PAGESPEED_KERNEL_CACHE_LRU_CACHE_H_
20 #define PAGESPEED_KERNEL_CACHE_LRU_CACHE_H_
30 namespace net_instaweb {
73 size_t num_evictions()
const {
return base_.num_evictions(); }
74 size_t num_hits()
const {
return base_.num_hits(); }
75 size_t num_misses()
const {
return base_.num_misses(); }
76 size_t num_inserts()
const {
return base_.num_inserts(); }
77 size_t num_identical_reinserts()
const {
78 return base_.num_identical_reinserts();
80 size_t num_deletes()
const {
return base_.num_deletes(); }
95 virtual bool IsHealthy()
const {
return is_healthy_; }
96 virtual void ShutDown() { set_is_healthy(
false); }
98 void set_is_healthy(
bool x) { is_healthy_ = x; }
101 struct SharedStringHelper {
102 size_t size(
const SharedString& ss)
const {
105 bool Equal(
const SharedString& a,
const SharedString& b)
const {
106 return a.Value() == b.Value();
108 void EvictNotify(
const SharedString& a) {}
109 bool ShouldReplace(
const SharedString& old_value,
110 const SharedString& new_value)
const {
114 typedef LRUCacheBase<SharedString, SharedStringHelper> Base;
118 SharedStringHelper value_helper_;
size_t size_bytes() const
Total size in bytes of keys and values stored.
Definition: lru_cache_base.h:246
virtual void ShutDown()
Definition: lru_cache.h:96
Abstract interface for a cache.
Definition: cache_interface.h:32
size_t max_bytes_in_cache() const
Maximum capacity.
Definition: lru_cache.h:68
virtual bool IsHealthy() const
Definition: lru_cache.h:95
void Clear()
Definition: lru_cache_base.h:292
void DeleteWithPrefixForTesting(StringPiece prefix)
void SanityCheck()
Sanity check the cache data structures.
Definition: lru_cache_base.h:262
void ClearStats()
Clear the stats – note that this will not clear the content.
Definition: lru_cache.h:90
size_t num_elements() const
Number of elements stored.
Definition: lru_cache.h:71
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual void Put(const GoogleString &key, const SharedString &new_value)
size_t num_elements() const
Number of elements stored.
Definition: lru_cache_base.h:252
Definition: lru_cache.h:44
Definition: shared_string.h:40
virtual bool IsBlocking() const
Definition: lru_cache.h:94
Definition: cache_interface.h:42
virtual GoogleString Name() const
Definition: lru_cache.h:93
size_t max_bytes_in_cache() const
Maximum capacity.
Definition: lru_cache_base.h:249
void Clear()
Definition: lru_cache.h:87
size_t size_bytes() const
Total size in bytes of keys and values stored.
Definition: lru_cache.h:65
virtual void Get(const GoogleString &key, Callback *callback)
void ClearStats()
Clear the stats – note that this will not clear the content.
Definition: lru_cache_base.h:305
void SanityCheck()
Sanity check the cache data structures.
Definition: lru_cache.h:83