20 #include <ripple/app/ledger/Ledger.h>
21 #include <ripple/nodestore/impl/DatabaseRotatingImp.h>
22 #include <ripple/protocol/HashPrefix.h>
48 , writableBackend_(
std::move(writableBackend))
49 , archiveBackend_(
std::move(archiveBackend))
77 pCache_->canonicalize_replace_cache(hash, nObj);
Holds a collection of configuration values.
std::shared_ptr< Backend > archiveBackend_
bool erase(key_type const &key)
Remove the specified cache entry.
void sweep() override
Remove expired entries from the positive and negative caches.
void tune(int size, std::chrono::seconds age) override
Set the maximum number of entries and maximum cache age for both caches.
NodeObjectType
The types of node objects.
static std::shared_ptr< NodeObject > createObject(NodeObjectType type, Blob &&data, uint256 const &hash)
Create an object from fields.
std::shared_ptr< Backend > const & archiveBackend
DatabaseRotatingImp()=delete
void store(NodeObjectType type, Blob &&data, uint256 const &hash, std::uint32_t seq) override
Store the object.
std::shared_ptr< Backend > const & getWritableBackend() const override
Stopwatch & stopwatch()
Returns an instance of a wall clock.
void setParent(Stoppable &parent)
Set the parent of this Stoppable.
bool touch_if_exists(KeyComparable const &key)
Refresh the last access time on a key if present.
Provides an interface for starting and stopping.
bool asyncFetch(uint256 const &hash, std::uint32_t seq, std::shared_ptr< NodeObject > &object) override
Fetch an object without waiting.
Backends getBackends() const
constexpr std::chrono::seconds cacheTargetAge
void storeStats(size_t sz)
A generic endpoint for log messages.
Scheduling for asynchronous backend activity.
void sweep()
Remove stale entries from the cache.
std::shared_ptr< NodeObject > fetchInternal(uint256 const &hash, std::shared_ptr< Backend > backend)
std::shared_ptr< NodeObject > fetchFrom(uint256 const &hash, std::uint32_t seq) override
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void setTargetSize(size_type s)
std::shared_ptr< Backend > const & writableBackend
virtual bool asyncFetch(uint256 const &hash, std::uint32_t seq, std::shared_ptr< NodeObject > &object)=0
Fetch an object without waiting.
void setTargetAge(std::chrono::seconds s)
A simple object that the Ledger uses to store entries.
Maintains a cache of keys with no associated data.
std::shared_ptr< Backend > rotateBackends(std::shared_ptr< Backend > newBackend, std::lock_guard< std::mutex > const &) override
std::shared_ptr< Backend > writableBackend_
std::shared_ptr< KeyCache< uint256 > > nCache_
std::shared_ptr< TaggedCache< uint256, NodeObject > > pCache_