#include <DatabaseNodeImp.h>
|
| | DatabaseNodeImp ()=delete |
| |
| | DatabaseNodeImp (DatabaseNodeImp const &)=delete |
| |
| DatabaseNodeImp & | operator= (DatabaseNodeImp const &)=delete |
| |
| | DatabaseNodeImp (Scheduler &scheduler, int readThreads, std::shared_ptr< Backend > backend, Section const &config, beast::Journal j) |
| |
| | ~DatabaseNodeImp () |
| |
| std::string | getName () const override |
| | Retrieve the name associated with this backend.
|
| |
| std::int32_t | getWriteLoad () const override |
| | Retrieve the estimated number of pending write operations.
|
| |
| void | importDatabase (Database &source) override |
| | Import objects from another database.
|
| |
| void | store (NodeObjectType type, Blob &&data, uint256 const &hash, std::uint32_t) override |
| | Store the object.
|
| |
| bool | isSameDB (std::uint32_t, std::uint32_t) override |
| |
| void | sync () override |
| |
| std::vector< std::shared_ptr< NodeObject > > | fetchBatch (std::vector< uint256 > const &hashes) |
| |
| void | asyncFetch (uint256 const &hash, std::uint32_t ledgerSeq, std::function< void(std::shared_ptr< NodeObject > const &)> &&callback) override |
| | Fetch an object without waiting.
|
| |
| void | sweep () override |
| | Remove expired entries from the positive and negative caches.
|
| |
| std::shared_ptr< NodeObject > | fetchNodeObject (uint256 const &hash, std::uint32_t ledgerSeq=0, FetchType fetchType=FetchType::synchronous, bool duplicate=false) |
| | Fetch a node object.
|
| |
| std::uint64_t | getStoreCount () const |
| | Gather statistics pertaining to read and write activities.
|
| |
| std::uint32_t | getFetchTotalCount () const |
| |
| std::uint32_t | getFetchHitCount () const |
| |
| std::uint64_t | getStoreSize () const |
| |
| std::uint32_t | getFetchSize () const |
| |
| void | getCountsJson (Json::Value &obj) |
| |
| int | fdRequired () const |
| | Returns the number of file descriptors the database expects to need.
|
| |
| virtual void | stop () |
| |
| bool | isStopping () const |
| |
| std::uint32_t | earliestLedgerSeq () const noexcept |
| |
Definition at line 11 of file DatabaseNodeImp.h.
◆ DatabaseNodeImp() [1/3]
| ripple::NodeStore::DatabaseNodeImp::DatabaseNodeImp |
( |
| ) |
|
|
delete |
◆ DatabaseNodeImp() [2/3]
| ripple::NodeStore::DatabaseNodeImp::DatabaseNodeImp |
( |
DatabaseNodeImp const & |
| ) |
|
|
delete |
◆ DatabaseNodeImp() [3/3]
◆ ~DatabaseNodeImp()
| ripple::NodeStore::DatabaseNodeImp::~DatabaseNodeImp |
( |
| ) |
|
◆ operator=()
◆ getName()
| std::string ripple::NodeStore::DatabaseNodeImp::getName |
( |
| ) |
const |
|
overridevirtual |
Retrieve the name associated with this backend.
This is used for diagnostics and may not reflect the actual path or paths used by the underlying backend.
Implements ripple::NodeStore::Database.
Definition at line 72 of file DatabaseNodeImp.h.
◆ getWriteLoad()
| std::int32_t ripple::NodeStore::DatabaseNodeImp::getWriteLoad |
( |
| ) |
const |
|
overridevirtual |
◆ importDatabase()
| void ripple::NodeStore::DatabaseNodeImp::importDatabase |
( |
Database & |
source | ) |
|
|
overridevirtual |
◆ store()
Store the object.
The caller's Blob parameter is overwritten.
- Parameters
-
| type | The type of object. |
| data | The payload of the object. The caller's variable is overwritten. |
| hash | The 256-bit hash of the payload data. |
| ledgerSeq | The sequence of the ledger the object belongs to. |
- Returns
true if the object was stored?
Implements ripple::NodeStore::Database.
Definition at line 7 of file DatabaseNodeImp.cpp.
◆ isSameDB()
◆ sync()
| void ripple::NodeStore::DatabaseNodeImp::sync |
( |
| ) |
|
|
overridevirtual |
◆ fetchBatch()
◆ asyncFetch()
Fetch an object without waiting.
If I/O is required to determine whether or not the object is present, false is returned. Otherwise, true is returned and object is set to refer to the object, or nullptr if the object is not present. If I/O is required, the I/O is scheduled and true is returned
- Note
- This can be called concurrently.
- Parameters
-
| hash | The key of the object to retrieve |
| ledgerSeq | The sequence of the ledger where the object is stored. |
| callback | Callback function when read completes |
Reimplemented from ripple::NodeStore::Database.
Definition at line 28 of file DatabaseNodeImp.cpp.
◆ sweep()
| void ripple::NodeStore::DatabaseNodeImp::sweep |
( |
| ) |
|
|
overridevirtual |
◆ fetchNodeObject() [1/2]
◆ for_each()
Visit every object in the database This is usually called during import.
- Note
- This routine will not be called concurrently with itself or other methods.
- See also
- import
Implements ripple::NodeStore::Database.
Definition at line 134 of file DatabaseNodeImp.h.
◆ fetchNodeObject() [2/2]
Fetch a node object.
If the object is known to be not in the database, isn't found in the database during the fetch, or failed to load correctly during the fetch, nullptr is returned.
- Note
- This can be called concurrently.
- Parameters
-
| hash | The key of the object to retrieve. |
| ledgerSeq | The sequence of the ledger where the object is stored. |
| fetchType | the type of fetch, synchronous or asynchronous. |
- Returns
- The object, or nullptr if it couldn't be retrieved.
Definition at line 221 of file Database.cpp.
◆ getStoreCount()
| std::uint64_t ripple::NodeStore::Database::getStoreCount |
( |
| ) |
const |
|
inherited |
Gather statistics pertaining to read and write activities.
- Parameters
-
| obj | Json object reference into which to place counters. |
Definition at line 154 of file Database.h.
◆ getFetchTotalCount()
| std::uint32_t ripple::NodeStore::Database::getFetchTotalCount |
( |
| ) |
const |
|
inherited |
◆ getFetchHitCount()
| std::uint32_t ripple::NodeStore::Database::getFetchHitCount |
( |
| ) |
const |
|
inherited |
◆ getStoreSize()
| std::uint64_t ripple::NodeStore::Database::getStoreSize |
( |
| ) |
const |
|
inherited |
◆ getFetchSize()
| std::uint32_t ripple::NodeStore::Database::getFetchSize |
( |
| ) |
const |
|
inherited |
◆ getCountsJson()
| void ripple::NodeStore::Database::getCountsJson |
( |
Json::Value & |
obj | ) |
|
|
inherited |
◆ fdRequired()
| int ripple::NodeStore::Database::fdRequired |
( |
| ) |
const |
|
inherited |
Returns the number of file descriptors the database expects to need.
Definition at line 188 of file Database.h.
◆ stop()
| void ripple::NodeStore::Database::stop |
( |
| ) |
|
|
virtualinherited |
◆ isStopping()
| bool ripple::NodeStore::Database::isStopping |
( |
| ) |
const |
|
inherited |
◆ earliestLedgerSeq()
| std::uint32_t ripple::NodeStore::Database::earliestLedgerSeq |
( |
| ) |
const |
|
noexceptinherited |
- Returns
- The earliest ledger sequence allowed
Definition at line 202 of file Database.h.
◆ storeStats()
◆ importInternal()
| void ripple::NodeStore::Database::importInternal |
( |
Backend & |
dstBackend, |
|
|
Database & |
srcDB |
|
) |
| |
|
protectedinherited |
◆ updateFetchMetrics()
| void ripple::NodeStore::Database::updateFetchMetrics |
( |
uint64_t |
fetches, |
|
|
uint64_t |
hits, |
|
|
uint64_t |
duration |
|
) |
| |
|
protectedinherited |
◆ threadEntry()
| void ripple::NodeStore::Database::threadEntry |
( |
| ) |
|
|
privateinherited |
◆ cache_
◆ backend_
◆ j_
◆ scheduler_
| Scheduler& ripple::NodeStore::Database::scheduler_ |
|
protectedinherited |
◆ fdRequired_
| int ripple::NodeStore::Database::fdRequired_ {0} |
|
protectedinherited |
◆ fetchHitCount_
◆ fetchSz_
◆ earliestLedgerSeq_
| std::uint32_t const ripple::NodeStore::Database::earliestLedgerSeq_ |
|
protectedinherited |
◆ requestBundle_
| int const ripple::NodeStore::Database::requestBundle_ |
|
protectedinherited |
◆ storeCount_
◆ storeSz_
◆ fetchTotalCount_
◆ fetchDurationUs_
◆ storeDurationUs_
◆ readLock_
◆ readCondVar_
◆ read_
◆ readStopping_
| std::atomic<bool> ripple::NodeStore::Database::readStopping_ = false |
|
privateinherited |
◆ readThreads_
| std::atomic<int> ripple::NodeStore::Database::readThreads_ = 0 |
|
privateinherited |
◆ runningThreads_
| std::atomic<int> ripple::NodeStore::Database::runningThreads_ = 0 |
|
privateinherited |