19 #ifndef PAGESPEED_SYSTEM_APR_MEM_CACHE_H_
20 #define PAGESPEED_SYSTEM_APR_MEM_CACHE_H_
30 #include "pagespeed/kernel/cache/cache_interface.h"
33 struct apr_memcache2_t;
34 struct apr_memcache2_server_t;
37 namespace net_instaweb {
85 virtual void MultiGet(MultiGetRequest* request);
91 bool valid_server_spec()
const {
return valid_server_spec_; }
97 static GoogleString FormatName() {
return "AprMemCache"; }
125 void DecodeValueMatchingKeyAndCallCallback(
126 const GoogleString& key,
const char* data,
size_t data_len,
127 const char* calling_method, Callback* callback);
135 bool valid_server_spec_;
139 apr_memcache2_t* memcached_;
140 std::vector<apr_memcache2_server_t*> servers_;
Definition: atomic_bool.h:31
Definition: apr_mem_cache.h:50
Abstract interface for a cache.
Definition: cache_interface.h:32
Definition: statistics.h:43
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
virtual bool IsBlocking() const
Definition: apr_mem_cache.h:100
static const int64 kMaxErrorBurst
Definition: apr_mem_cache.h:68
static const int64 kSecondMs
Definition: timer.h:34
virtual void PutWithKeyInValue(const GoogleString &key, const SharedString &key_and_value)
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual void MultiGet(MultiGetRequest *request)
static const int64 kHealthCheckpointIntervalMs
Amount of time after a burst of errors to retry memcached operations.
Definition: apr_mem_cache.h:63
virtual void Put(const GoogleString &key, const SharedString &value)
Definition: shared_string.h:40
virtual GoogleString Name() const
Definition: apr_mem_cache.h:98
virtual bool MustEncodeKeyInValueOnPut() const
Definition: apr_mem_cache.h:116
static const size_t kValueSizeThreshold
Definition: apr_mem_cache.h:60
bool GetStatus(GoogleString *status_string)
Definition: statistics.h:73
Definition: message_handler.h:39
Definition: external_server_spec.h:44
void set_timeout_us(int timeout_us)
AprMemCache(const ExternalClusterSpec &cluster, int thread_limit, Hasher *hasher, Statistics *statistics, Timer *timer, MessageHandler *handler)
Timer interface, made virtual so it can be mocked for tests.
Definition: timer.h:27
virtual void ShutDown()
Close down the connection to the memcached servers.
virtual void Get(const GoogleString &key, Callback *callback)
As mentioned above, Get and MultiGet are blocking in this implementation.
virtual bool IsHealthy() const