20 #ifndef RIPPLE_NODESTORE_BACKEND_H_INCLUDED
21 #define RIPPLE_NODESTORE_BACKEND_H_INCLUDED
23 #include <ripple/nodestore/Types.h>
84 open(
bool createIfMissing =
true) = 0;
99 open(
bool createIfMissing, uint64_t appType, uint64_t uid, uint64_t salt)
101 Throw<std::runtime_error>(
102 "Deterministic appType/uid/salt not supported by backend " +
virtual int getWriteLoad()=0
Estimate the number of write operations pending.
virtual void verify()
Perform consistency checks on database.
virtual void store(std::shared_ptr< NodeObject > const &object)=0
Store a single object.
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 std::optional< Counters< std::uint64_t > > counters() const
Returns read and write stats.
Counters(Counters< U > const &other)
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.
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 void open(bool createIfMissing, uint64_t appType, uint64_t uid, uint64_t salt)
Open the backend.
virtual void storeBatch(Batch const &batch)=0
Store a group of objects.
virtual void open(bool createIfMissing=true)=0
Open the backend.
virtual Status fetch(void const *key, std::shared_ptr< NodeObject > *pObject)=0
Fetch a single object.
A backend used for the NodeStore.