|
Clio
develop
The XRP Ledger API server.
|
Cache for an entire ledger. More...
#include <LedgerCacheInterface.hpp>

Public Member Functions | |
| LedgerCacheInterface (LedgerCacheInterface &&)=delete | |
| LedgerCacheInterface (LedgerCacheInterface const &)=delete | |
| LedgerCacheInterface & | operator= (LedgerCacheInterface &&)=delete |
| LedgerCacheInterface & | operator= (LedgerCacheInterface const &)=delete |
| virtual void | update (std::vector< LedgerObject > const &objs, uint32_t seq, bool isBackground=false)=0 |
| Update the cache with new ledger objects. | |
| virtual void | update (std::vector< etl::model::Object > const &objs, uint32_t seq)=0 |
| Update the cache with new ledger objects. | |
| virtual std::optional< Blob > | get (ripple::uint256 const &key, uint32_t seq) const =0 |
| Fetch a cached object by its key and sequence number. | |
| virtual std::optional< Blob > | getDeleted (ripple::uint256 const &key, uint32_t seq) const =0 |
| Fetch a recently deleted object by its key and sequence number. | |
| virtual std::optional< LedgerObject > | getSuccessor (ripple::uint256 const &key, uint32_t seq) const =0 |
| Gets a cached successor. | |
| virtual std::optional< LedgerObject > | getPredecessor (ripple::uint256 const &key, uint32_t seq) const =0 |
| Gets a cached predcessor. | |
| virtual void | setDisabled ()=0 |
| Disables the cache. | |
| virtual bool | isDisabled () const =0 |
| virtual void | setFull ()=0 |
| Sets the full flag to true. | |
| virtual uint32_t | latestLedgerSequence () const =0 |
| virtual bool | isFull () const =0 |
| virtual size_t | size () const =0 |
| virtual float | getObjectHitRate () const =0 |
| virtual float | getSuccessorHitRate () const =0 |
| virtual void | waitUntilCacheContainsSeq (uint32_t seq)=0 |
| Waits until the cache contains a specific sequence. | |
| virtual std::expected< void, std::string > | saveToFile (std::string const &path) const =0 |
| Save the cache to file. | |
| virtual std::expected< void, std::string > | loadFromFile (std::string const &path, uint32_t minLatestSequence)=0 |
| Load the cache from file. | |
Cache for an entire ledger.
|
pure virtual |
Fetch a cached object by its key and sequence number.
| key | The key to fetch for |
| seq | The sequence to fetch for |
Implemented in data::LedgerCache.
|
pure virtual |
Fetch a recently deleted object by its key and sequence number.
| key | The key to fetch for |
| seq | The sequence to fetch for |
Implemented in data::LedgerCache.
|
pure virtual |
Implemented in data::LedgerCache.
|
pure virtual |
Gets a cached predcessor.
Note: This function always returns std::nullopt when isFull() returns false.
| key | The key to fetch for |
| seq | The sequence to fetch for |
Implemented in data::LedgerCache.
|
pure virtual |
Gets a cached successor.
Note: This function always returns std::nullopt when isFull() returns false.
| key | The key to fetch for |
| seq | The sequence to fetch for |
Implemented in data::LedgerCache.
|
pure virtual |
Implemented in data::LedgerCache.
|
pure virtual |
Implemented in data::LedgerCache.
|
pure virtual |
Implemented in data::LedgerCache.
|
pure virtual |
Implemented in data::LedgerCache.
|
nodiscardpure virtual |
Load the cache from file.
| path | The file path to load data from |
| minLatestSequence | The minimum allowed value of the latestLedgerSequence in cache file |
Implemented in data::LedgerCache.
|
nodiscardpure virtual |
Save the cache to file.
| path | The file path to save the cache to |
Implemented in data::LedgerCache.
|
pure virtual |
Disables the cache.
Implemented in data::LedgerCache.
|
pure virtual |
Sets the full flag to true.
This is used when cache loaded in its entirety at startup of the application. This can be either loaded from DB, populated together with initial ledger download (on first run) or downloaded from a peer node (specified in config).
Implemented in data::LedgerCache.
|
pure virtual |
Implemented in data::LedgerCache.
|
pure virtual |
Update the cache with new ledger objects.
| objs | The ledger objects to update cache with |
| seq | The sequence to update cache for |
Implemented in data::LedgerCache.
|
pure virtual |
Update the cache with new ledger objects.
| objs | The ledger objects to update cache with |
| seq | The sequence to update cache for |
| isBackground | Should be set to true when writing old data from a background thread |
Implemented in data::LedgerCache.
|
pure virtual |
Waits until the cache contains a specific sequence.
| seq | The sequence to wait for |
Implemented in data::LedgerCache.