|
rippled
|


Public Member Functions | |
| MemoryBackend (size_t keyBytes, Section const &keyValues, beast::Journal journal) | |
| ~MemoryBackend () override | |
| std::string | getName () override |
| Get the human-readable name of this backend. | |
| void | open (bool) override |
| Open the backend. | |
| bool | isOpen () override |
| Returns true is the database is open. | |
| void | close () override |
| Close the backend. | |
| Status | fetch (void const *key, std::shared_ptr< NodeObject > *pObject) override |
| Fetch a single object. | |
| std::pair< std::vector< std::shared_ptr< NodeObject > >, Status > | fetchBatch (std::vector< uint256 const * > const &hashes) override |
| Fetch a batch synchronously. | |
| void | store (std::shared_ptr< NodeObject > const &object) override |
| Store a single object. | |
| void | storeBatch (Batch const &batch) override |
| Store a group of objects. | |
| void | sync () override |
| void | for_each (std::function< void(std::shared_ptr< NodeObject >)> f) override |
| Visit every object in the database This is usually called during import. | |
| int | getWriteLoad () override |
| Estimate the number of write operations pending. | |
| void | setDeletePath () override |
| Remove contents on disk upon destruction. | |
| int | fdRequired () const override |
| Returns the number of file descriptors the backend expects to need. | |
| virtual std::optional< std::size_t > | getBlockSize () const |
| Get the block size for backends that support it. | |
| 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. | |
Private Types | |
| using | Map = std::map< uint256 const, std::shared_ptr< NodeObject > > |
Private Attributes | |
| std::string | name_ |
| beast::Journal const | journal_ |
| MemoryDB * | db_ {nullptr} |
Definition at line 69 of file MemoryFactory.cpp.
|
private |
Definition at line 72 of file MemoryFactory.cpp.
| ripple::NodeStore::MemoryBackend::MemoryBackend | ( | size_t | keyBytes, |
| Section const & | keyValues, | ||
| beast::Journal | journal | ||
| ) |
Definition at line 79 of file MemoryFactory.cpp.
|
override |
Definition at line 90 of file MemoryFactory.cpp.
|
overridevirtual |
Get the human-readable name of this backend.
This is used for diagnostic output.
Implements ripple::NodeStore::Backend.
Definition at line 96 of file MemoryFactory.cpp.
|
overridevirtual |
Open the backend.
| createIfMissing | Create the database files if necessary. This allows the caller to catch exceptions. |
Implements ripple::NodeStore::Backend.
Definition at line 102 of file MemoryFactory.cpp.
|
overridevirtual |
Returns true is the database is open.
Implements ripple::NodeStore::Backend.
Definition at line 108 of file MemoryFactory.cpp.
|
overridevirtual |
Close the backend.
This allows the caller to catch exceptions.
Implements ripple::NodeStore::Backend.
Definition at line 114 of file MemoryFactory.cpp.
|
overridevirtual |
Fetch a single object.
If the object is not found or an error is encountered, the result will indicate the condition.
| key | A pointer to the key data. |
| pObject | [out] The created object if successful. |
Implements ripple::NodeStore::Backend.
Definition at line 122 of file MemoryFactory.cpp.
|
overridevirtual |
Fetch a batch synchronously.
Implements ripple::NodeStore::Backend.
Definition at line 141 of file MemoryFactory.cpp.
|
overridevirtual |
Store a single object.
Depending on the implementation this may happen immediately or deferred using a scheduled task.
| object | The object to store. |
Implements ripple::NodeStore::Backend.
Definition at line 159 of file MemoryFactory.cpp.
|
overridevirtual |
Store a group of objects.
Implements ripple::NodeStore::Backend.
Definition at line 168 of file MemoryFactory.cpp.
|
overridevirtual |
Implements ripple::NodeStore::Backend.
Definition at line 175 of file MemoryFactory.cpp.
|
overridevirtual |
Visit every object in the database This is usually called during import.
Implements ripple::NodeStore::Backend.
Definition at line 180 of file MemoryFactory.cpp.
|
overridevirtual |
Estimate the number of write operations pending.
Implements ripple::NodeStore::Backend.
Definition at line 190 of file MemoryFactory.cpp.
|
overridevirtual |
Remove contents on disk upon destruction.
Implements ripple::NodeStore::Backend.
Definition at line 196 of file MemoryFactory.cpp.
|
overridevirtual |
Returns the number of file descriptors the backend expects to need.
Implements ripple::NodeStore::Backend.
Definition at line 201 of file MemoryFactory.cpp.
|
virtualinherited |
Get the block size for backends that support it.
Reimplemented in ripple::NodeStore::NuDBBackend.
|
virtualinherited |
Open the backend.
| createIfMissing | Create the database files if necessary. |
| appType | Deterministic appType used to create a backend. |
| uid | Deterministic uid used to create a backend. |
| salt | Deterministic salt used to create a backend. |
| std::runtime_error | is function is called not for NuDB backend. |
Reimplemented in ripple::NodeStore::NuDBBackend.
|
virtualinherited |
Perform consistency checks on database.
This method is implemented only by NuDBBackend. It is not yet called anywhere, but it might be a good idea to one day call it at startup to avert a crash.
Reimplemented in ripple::NodeStore::NuDBBackend.
|
private |
Definition at line 74 of file MemoryFactory.cpp.
|
private |
Definition at line 75 of file MemoryFactory.cpp.
|
private |
Definition at line 76 of file MemoryFactory.cpp.