20 #ifndef RIPPLE_NODESTORE_DATABASENODEIMP_H_INCLUDED
21 #define RIPPLE_NODESTORE_DATABASENODEIMP_H_INCLUDED
23 #include <ripple/nodestore/Database.h>
24 #include <ripple/basics/chrono.h>
44 :
Database(name, parent, scheduler, readThreads, config, j)
Holds a collection of configuration values.
std::shared_ptr< Backend > backend_
std::int32_t getWriteLoad() const override
Retrieve the estimated number of pending write operations.
void store(NodeObjectType type, Blob &&data, uint256 const &hash, std::uint32_t seq) override
Store the object.
Persistency layer for NodeObject.
std::shared_ptr< NodeObject > doFetch(uint256 const &hash, std::uint32_t seq, TaggedCache< uint256, NodeObject > &pCache, KeyCache< uint256 > &nCache, bool isAsync)
std::shared_ptr< NodeObject > fetchFrom(uint256 const &hash, std::uint32_t seq) override
NodeObjectType
The types of node objects.
Stopwatch & stopwatch()
Returns an instance of a wall clock.
void tune(int size, std::chrono::seconds age) override
Set the maximum number of entries and maximum cache age for both caches.
void for_each(std::function< void(std::shared_ptr< NodeObject >)> f) override
Visit every object in the database This is usually called during import.
void setParent(Stoppable &parent)
Set the parent of this Stoppable.
float getCacheHitRate() override
Get the positive cache hits to total attempts ratio.
Provides an interface for starting and stopping.
void importInternal(Backend &dstBackend, Database &srcDB)
int getDesiredAsyncReadCount(std::uint32_t seq) override
Get the maximum number of async reads the node store prefers.
std::shared_ptr< TaggedCache< uint256, NodeObject > > pCache_
constexpr std::chrono::seconds cacheTargetAge
A generic endpoint for log messages.
Scheduling for asynchronous backend activity.
DatabaseNodeImp & operator=(DatabaseNodeImp const &)=delete
std::shared_ptr< NodeObject > fetchInternal(uint256 const &hash, std::shared_ptr< Backend > backend)
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.
virtual bool storeLedger(std::shared_ptr< Ledger const > const &srcLedger)=0
Copies a ledger stored in a different database to this one.
bool storeLedger(std::shared_ptr< Ledger const > const &srcLedger) override
Copies a ledger stored in a different database to this one.
void sweep() override
Remove expired entries from the positive and negative caches.
std::shared_ptr< NodeObject > fetch(uint256 const &hash, std::uint32_t seq) override
Fetch an object.
A simple object that the Ledger uses to store entries.
DatabaseNodeImp(std::string const &name, Scheduler &scheduler, int readThreads, Stoppable &parent, std::shared_ptr< Backend > backend, Section const &config, beast::Journal j)
Maintains a cache of keys with no associated data.
std::string getName() const override
Retrieve the name associated with this backend.
~DatabaseNodeImp() override