25 #ifndef NET_INSTAWEB_UTIL_PUBLIC_CACHE_PROPERTY_STORE_H_
26 #define NET_INSTAWEB_UTIL_PUBLIC_CACHE_PROPERTY_STORE_H_
32 #include "pagespeed/kernel/base/basictypes.h"
33 #include "pagespeed/kernel/base/string_util.h"
34 #include "pagespeed/kernel/base/string.h"
36 namespace net_instaweb {
38 class AbstractPropertyStoreGetCallback;
40 class PropertyCacheValues;
54 CacheInterface* cache,
57 ThreadSystem* thread_system);
63 virtual void Get(
const GoogleString& url,
64 const GoogleString& options_signature_hash,
65 const GoogleString& cache_key_suffix,
66 const PropertyCache::CohortVector& cohort_list,
72 virtual void Put(
const GoogleString& url,
73 const GoogleString& options_signature_hash,
74 const GoogleString& cache_key_suffix,
76 const PropertyCacheValues* values,
80 void AddCohort(
const GoogleString& cohort);
84 CacheInterface* cache);
90 GoogleString
CacheKey(
const StringPiece& url,
91 const StringPiece& options_signature_hash,
92 const StringPiece& cache_key_suffix,
98 virtual GoogleString
Name()
const;
100 static GoogleString FormatName2(StringPiece cohort_name1,
101 StringPiece cohort_cache1,
102 StringPiece cohort_name2,
103 StringPiece cohort_cache2);
106 GoogleString cache_key_prefix_;
107 typedef std::map<GoogleString, CacheInterface*> CohortCacheMap;
108 CohortCacheMap cohort_cache_map_;
109 CacheInterface* default_cache_;
112 ThreadSystem* thread_system_;
static const char kPagePropertyCacheKeyPrefix[]
Property cache key prefixes.
Definition: cache_property_store.h:48
Definition: property_cache.h:186
Definition: property_store.h:41
void AddCohortWithCache(const GoogleString &cohort, CacheInterface *cache)
virtual GoogleString Name() const
Definition: abstract_property_store_get_callback.h:31
const CacheInterface * cache_backend()
Returns default cache backend associated with CachePropertyStore.
Definition: cache_property_store.h:96
Definition: property_cache.h:323
void AddCohort(const GoogleString &cohort)
Establishes a Cohort backed by the CacheInteface passed to the constructor.
GoogleString CacheKey(const StringPiece &url, const StringPiece &options_signature_hash, const StringPiece &cache_key_suffix, const PropertyCache::Cohort *cohort) const
virtual void Put(const GoogleString &url, const GoogleString &options_signature_hash, const GoogleString &cache_key_suffix, const PropertyCache::Cohort *cohort, const PropertyCacheValues *values, BoolCallback *done)
Write to cache.
virtual void Get(const GoogleString &url, const GoogleString &options_signature_hash, const GoogleString &cache_key_suffix, const PropertyCache::CohortVector &cohort_list, PropertyPage *page, BoolCallback *done, AbstractPropertyStoreGetCallback **callback)
Definition: cache_property_store.h:45
CachePropertyStore(const GoogleString &cache_key_prefix, CacheInterface *cache, Timer *timer, Statistics *stats, ThreadSystem *thread_system)