proxygen
|
#include <PersistentCache.h>
Public Member Functions | |
virtual | ~PersistentCache () |
virtual folly::Optional< V > | get (const K &key)=0 |
virtual void | put (const K &key, const V &val)=0 |
virtual bool | remove (const K &key)=0 |
virtual void | clear (bool clearPersistence=false)=0 |
virtual size_t | size ()=0 |
Interface for a persistent cache that backs up the cache on storage so that it can be reused. This desribes just the key operations common to any cache. Loading from and syncing to the storage is in the actual implementation of the class and the clients should not have to worry about it.
Definition at line 31 of file PersistentCache.h.
|
inlinevirtual |
Definition at line 33 of file PersistentCache.h.
References wangle::PersistentCache< K, V >::clear(), wangle::PersistentCache< K, V >::put(), wangle::PersistentCache< K, V >::size(), and val.
|
pure virtual |
Empty the contents of the cache
Implemented in wangle::LRUPersistentCache< K, V, MutexT >, wangle::LRUPersistentCache< K, V, M >, and wangle::FilePersistentCache< K, V, M >.
Referenced by wangle::PersistentCache< K, V >::~PersistentCache().
|
pure virtual |
Get a value corresponding to a key
key | string, the key to lookup |
Implemented in wangle::LRUPersistentCache< K, V, MutexT >, wangle::LRUPersistentCache< K, V, M >, and wangle::FilePersistentCache< K, V, M >.
|
pure virtual |
Set a value corresponding to a key
key | string, the key to set |
val | string, the value to set |
overwrites value if key has a value associated in the cache
Implemented in wangle::LRUPersistentCache< K, V, MutexT >, wangle::LRUPersistentCache< K, V, M >, and wangle::FilePersistentCache< K, V, M >.
Referenced by wangle::PersistentCache< K, V >::~PersistentCache().
|
pure virtual |
Clear a cache entry associated with a key
key | string, the key to lookup and clear |
Implemented in wangle::LRUPersistentCache< K, V, MutexT >, wangle::LRUPersistentCache< K, V, M >, and wangle::FilePersistentCache< K, V, M >.
|
pure virtual |
return the size of the cache
Implemented in wangle::LRUPersistentCache< K, V, MutexT >, wangle::LRUPersistentCache< K, V, M >, and wangle::FilePersistentCache< K, V, M >.
Referenced by wangle::PersistentCache< K, V >::~PersistentCache().