1#ifndef XRPL_NODESTORE_BACKEND_H_INCLUDED 
    2#define XRPL_NODESTORE_BACKEND_H_INCLUDED 
    4#include <xrpl/nodestore/Types.h> 
   50    open(
bool createIfMissing = 
true) = 0;
 
   65    open(
bool createIfMissing, uint64_t appType, uint64_t uid, uint64_t salt)
 
   67        Throw<std::runtime_error>(
 
   68            "Deterministic appType/uid/salt not supported by backend " +
 
 
 
 
A backend used for the NodeStore.
 
virtual std::string getName()=0
Get the human-readable name of this backend.
 
virtual void open(bool createIfMissing=true)=0
Open the backend.
 
virtual std::optional< std::size_t > getBlockSize() const
Get the block size for backends that support it.
 
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.
 
virtual ~Backend()=default
Destroy the backend.
 
virtual Status fetch(void const *key, std::shared_ptr< NodeObject > *pObject)=0
Fetch a single object.
 
virtual void store(std::shared_ptr< NodeObject > const &object)=0
Store a single object.
 
virtual void setDeletePath()=0
Remove contents on disk upon destruction.
 
virtual int fdRequired() const =0
Returns the number of file descriptors the backend expects to need.
 
virtual std::pair< std::vector< std::shared_ptr< NodeObject > >, Status > fetchBatch(std::vector< uint256 const * > const &hashes)=0
Fetch a batch synchronously.
 
virtual int getWriteLoad()=0
Estimate the number of write operations pending.
 
virtual void storeBatch(Batch const &batch)=0
Store a group of objects.
 
virtual bool isOpen()=0
Returns true is the database is open.
 
virtual void open(bool createIfMissing, uint64_t appType, uint64_t uid, uint64_t salt)
Open the backend.
 
virtual void verify()
Perform consistency checks on database.
 
Status
Return codes from Backend operations.
 
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.