20 #include <ripple/app/ledger/Ledger.h>
21 #include <ripple/nodestore/impl/DatabaseNodeImp.h>
22 #include <ripple/protocol/HashPrefix.h>
35 pCache_->canonicalize_replace_cache(hash, nObj);
std::shared_ptr< Backend > backend_
void store(NodeObjectType type, Blob &&data, uint256 const &hash, std::uint32_t seq) override
Store the object.
bool erase(key_type const &key)
Remove the specified cache entry.
NodeObjectType
The types of node objects.
static std::shared_ptr< NodeObject > createObject(NodeObjectType type, Blob &&data, uint256 const &hash)
Create an object from fields.
void tune(int size, std::chrono::seconds age) override
Set the maximum number of entries and maximum cache age for both caches.
bool touch_if_exists(KeyComparable const &key)
Refresh the last access time on a key if present.
std::shared_ptr< TaggedCache< uint256, NodeObject > > pCache_
void storeStats(size_t sz)
void sweep()
Remove stale entries from the cache.
bool asyncFetch(uint256 const &hash, std::uint32_t seq, std::shared_ptr< NodeObject > &object) override
Fetch an object without waiting.
std::shared_ptr< KeyCache< uint256 > > nCache_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void setTargetSize(size_type s)
void sweep() override
Remove expired entries from the positive and negative caches.
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)