Page Speed Optimization Libraries
1.7.30.1
|
#include "property_store.h"
Public Types | |
typedef Callback1< bool > | BoolCallback |
Public Member Functions | |
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)=0 |
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)=0 |
bool | enable_get_cancellation () |
void | set_enable_get_cancellation (bool x) |
Abstract interface for implementing PropertyStore which helps to retrieve and put properties into the storage system.
bool net_instaweb::PropertyStore::enable_get_cancellation | ( | ) | [inline] |
PropertyStore::Get can be cancelled if enable_get_cancellation is true i.e. input done callback will be called as soon as FastFinishLookup() is called on the AbstractPropertyStoreGetCallback callback.
virtual void net_instaweb::PropertyStore::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 | ||
) | [pure virtual] |
Populates the values field for all the cohorts present in the cohort_list and call the BoolCallback after lookup of all the cohorts are done. BoolCallback is called with true if at least one of the cohorts lookup is succeeded. PropertyPage object is used to validate the entries looked up from cache. AbstractPropertyStoreGetCallback is set in callback parameter and can be used to fast finish the lookup. Client must call DeleteWhenDone() on this callback after that it is no more usable. This parameter can be set to NULL.
Implemented in net_instaweb::CachePropertyStore, and net_instaweb::TwoLevelPropertyStore.
virtual void net_instaweb::PropertyStore::Put | ( | const GoogleString & | url, |
const GoogleString & | options_signature_hash, | ||
const GoogleString & | cache_key_suffix, | ||
const PropertyCache::Cohort * | cohort, | ||
const PropertyCacheValues * | values, | ||
BoolCallback * | done | ||
) | [pure virtual] |
Write to storage system for the given key. Callback done can be NULL. BoolCallback done will be called with true if Insert operation is successful.
Implemented in net_instaweb::CachePropertyStore, and net_instaweb::TwoLevelPropertyStore.