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);
49 if (
object ||
nCache_->touch_if_exists(hash))
std::shared_ptr< Backend > backend_
void store(NodeObjectType type, Blob &&data, uint256 const &hash, std::uint32_t seq) override
Store the object.
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.
std::shared_ptr< TaggedCache< uint256, NodeObject > > pCache_
void storeStats(size_t sz)
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 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.