20 #ifndef RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
21 #define RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
23 #include <ripple/nodestore/DatabaseRotating.h>
Holds a collection of configuration values.
float getCacheHitRate() override
Get the positive cache hits to total attempts ratio.
std::shared_ptr< Backend > archiveBackend_
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 > fetch(uint256 const &hash, std::uint32_t seq) override
Fetch an object.
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.
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
std::string getName() const override
Retrieve the name associated with this backend.
TaggedCache< uint256, NodeObject > const & getPositiveCache() override
std::int32_t getWriteLoad() const override
Retrieve the estimated number of pending write operations.
std::mutex & peekMutex() const override
Provides an interface for starting and stopping.
void importInternal(Backend &dstBackend, Database &srcDB)
bool asyncFetch(uint256 const &hash, std::uint32_t seq, std::shared_ptr< NodeObject > &object) override
Fetch an object without waiting.
Backends getBackends() const
bool storeLedger(std::shared_ptr< Ledger const > const &srcLedger) override
Copies a ledger stored in a different database to this one.
A generic endpoint for log messages.
Scheduling for asynchronous backend activity.
~DatabaseRotatingImp() override
std::shared_ptr< NodeObject > fetchFrom(uint256 const &hash, std::uint32_t seq) override
int getDesiredAsyncReadCount(std::uint32_t seq) override
Get the maximum number of async reads the node store prefers.
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.
std::shared_ptr< Backend > const & writableBackend
DatabaseRotatingImp & operator=(DatabaseRotatingImp const &)=delete
std::shared_ptr< Backend > rotateBackends(std::shared_ptr< Backend > newBackend, std::lock_guard< std::mutex > const &) override
void for_each(std::function< void(std::shared_ptr< NodeObject >)> f) override
Visit every object in the database This is usually called during import.
std::shared_ptr< Backend > writableBackend_
std::shared_ptr< KeyCache< uint256 > > nCache_
std::shared_ptr< TaggedCache< uint256, NodeObject > > pCache_