20 #ifndef RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
21 #define RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
23 #include <ripple/nodestore/DatabaseRotating.h>
55 std::string const& writableBackendName)>
const& f)
override;
Holds a collection of configuration values.
void rotateWithLock(std::function< std::unique_ptr< NodeStore::Backend >(std::string const &writableBackendName)> const &f) override
Rotates the backends.
float getCacheHitRate() override
Get the positive cache hits to total attempts ratio.
std::shared_ptr< Backend > archiveBackend_
Persistency layer for NodeObject.
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.
DatabaseRotatingImp()=delete
std::shared_ptr< NodeObject > fetchNodeObject(uint256 const &hash, std::uint32_t, FetchReport &fetchReport) override
Contains information about a fetch operation.
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.
Provides an interface for starting and stopping.
bool storeLedger(std::shared_ptr< Ledger const > const &srcLedger) override
Store a ledger from a different database.
A generic endpoint for log messages.
Scheduling for asynchronous backend activity.
~DatabaseRotatingImp() override
bool asyncFetch(uint256 const &hash, std::uint32_t ledgerSeq, std::shared_ptr< NodeObject > &nodeObject) override
Fetch an object without waiting.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void store(NodeObjectType type, Blob &&data, uint256 const &hash, std::uint32_t) override
Store the object.
int getDesiredAsyncReadCount(std::uint32_t) override
Get the maximum number of async reads the node store prefers.
DatabaseRotatingImp & operator=(DatabaseRotatingImp const &)=delete
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_