20 #ifndef RIPPLE_NODESTORE_BACKEND_H_INCLUDED
21 #define RIPPLE_NODESTORE_BACKEND_H_INCLUDED
23 #include <ripple/nodestore/Types.h>
70 open(
bool createIfMissing =
true) = 0;
146 virtual Counters
const&
std::atomic< std::uint64_t > writeRetries
bool backed() const
Returns true if the backend uses permanent storage.
virtual int getWriteLoad()=0
Estimate the number of write operations pending.
virtual Counters const & counters() const =0
std::atomic< std::uint64_t > readRetries
virtual void store(std::shared_ptr< NodeObject > const &object)=0
Store a single object.
std::atomic< std::uint64_t > writesDelayed
virtual void close()=0
Close the backend.
virtual void for_each(std::function< void(std::shared_ptr< NodeObject >)> f)=0
Visit every object in the database This is usually called during import.
std::atomic< std::uint64_t > writeDurationUs
virtual ~Backend()=default
Destroy the backend.
virtual std::pair< std::vector< std::shared_ptr< NodeObject > >, Status > fetchBatch(std::vector< uint256 const * > const &hashes)=0
Fetch a batch synchronously.
std::atomic< std::uint64_t > readErrors
virtual bool isOpen()=0
Returns true is the database is open.
Status
Return codes from Backend operations.
virtual void setDeletePath()=0
Remove contents on disk upon destruction.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual int fdRequired() const =0
Returns the number of file descriptors the backend expects to need.
virtual std::string getName()=0
Get the human-readable name of this backend.
virtual bool canFetchBatch()=0
Return true if batch fetches are optimized.
virtual void storeBatch(Batch const &batch)=0
Store a group of objects.
virtual void open(bool createIfMissing=true)=0
Open the backend.
virtual void verify()=0
Perform consistency checks on database.
virtual Status fetch(void const *key, std::shared_ptr< NodeObject > *pObject)=0
Fetch a single object.
A backend used for the NodeStore.