20 #ifndef RIPPLE_NODESTORE_BACKEND_H_INCLUDED
21 #define RIPPLE_NODESTORE_BACKEND_H_INCLUDED
23 #include <ripple/nodestore/Types.h>
57 virtual void open(
bool createIfMissing =
true) = 0;
62 virtual void close() = 0;
113 virtual void verify() = 0;
bool backed() const
Returns true if the backend uses permanent storage.
virtual int getWriteLoad()=0
Estimate the number of write operations pending.
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 ~Backend()=default
Destroy the backend.
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 std::vector< std::shared_ptr< NodeObject > > fetchBatch(std::size_t n, void const *const *keys)=0
Fetch a batch synchronously.
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.