proxygen
|
#include <LRUPersistentCache.h>
Public Member Functions | |
CachePersistence () | |
virtual | ~CachePersistence ()=default |
bool | persistVersionedData (const folly::dynamic &kvPairs, const CacheDataVersion &version) |
virtual CacheDataVersion | getLastPersistedVersion () const |
virtual void | setPersistedVersion (CacheDataVersion version) noexcept |
virtual bool | persist (const folly::dynamic &kvPairs) noexcept=0 |
virtual folly::Optional< folly::dynamic > | load () noexcept=0 |
virtual void | clear ()=0 |
Private Attributes | |
CacheDataVersion | persistedVersion_ |
The underlying persistence layer interface. Implementations may write to file, db, /dev/null, etc.
Definition at line 39 of file LRUPersistentCache.h.
|
inline |
Definition at line 41 of file LRUPersistentCache.h.
References wangle::CachePersistence< K, V >::~CachePersistence().
|
virtualdefault |
Referenced by wangle::CachePersistence< K, V >::CachePersistence().
|
pure virtual |
Clears Persistent cache
Implemented in wangle::FilePersistenceLayer< K, V >.
Referenced by wangle::CachePersistence< K, V >::setPersistedVersion().
|
inlinevirtual |
Get the last version of the data that was successfully persisted.
Definition at line 61 of file LRUPersistentCache.h.
References wangle::CachePersistence< K, V >::persistedVersion_.
Referenced by MockPersistenceLayer::getLastPersistedVersionConcrete(), and wangle::LRUPersistentCache< K, V, MutexT >::syncNow().
|
pure virtualnoexcept |
Returns a list of key value pairs that are present in this persistence store.
Implemented in MockPersistenceLayer, and wangle::FilePersistenceLayer< K, V >.
Referenced by wangle::CachePersistence< K, V >::setPersistedVersion(), and wangle::LRUPersistentCache< K, V, M >::setSyncOnDestroy().
|
pure virtualnoexcept |
Persist a folly::dynamic array of key value pairs. Returns true on success.
Implemented in MockPersistenceLayer, and wangle::FilePersistenceLayer< K, V >.
Referenced by wangle::CachePersistence< K, V >::persistVersionedData(), and wangle::CachePersistence< K, V >::setPersistedVersion().
|
inline |
Persist a folly::dynamic array of key value pairs at the specified version. Returns true if persistence succeeded.
Definition at line 49 of file LRUPersistentCache.h.
References wangle::CachePersistence< K, V >::persist(), wangle::CachePersistence< K, V >::persistedVersion_, and version.
Referenced by wangle::LRUPersistentCache< K, V, MutexT >::syncNow().
|
inlinevirtualnoexcept |
Force set a persisted version. This is primarily for when a persistence layer acts as the initial source of data for some version tracking cache.
Definition at line 69 of file LRUPersistentCache.h.
References wangle::CachePersistence< K, V >::clear(), wangle::CachePersistence< K, V >::load(), folly::pushmi::__adl::noexcept(), wangle::CachePersistence< K, V >::persist(), wangle::CachePersistence< K, V >::persistedVersion_, and version.
Referenced by MockPersistenceLayer::setPersistedVersionConcrete().
|
private |
Definition at line 91 of file LRUPersistentCache.h.
Referenced by wangle::CachePersistence< K, V >::getLastPersistedVersion(), wangle::CachePersistence< K, V >::persistVersionedData(), and wangle::CachePersistence< K, V >::setPersistedVersion().