|
rippled
|


Public Member Functions | |
| 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. More... | |
| std::int32_t | getWriteLoad () const override |
| Retrieve the estimated number of pending write operations. More... | |
| void | importDatabase (Database &source) override |
| Import objects from another database. More... | |
| void | store (NodeObjectType type, Blob &&data, uint256 const &hash, std::uint32_t) override |
| Store the object. More... | |
| bool | isSameDB (std::uint32_t, std::uint32_t) override |
| void | sync () override |
| std::vector< std::shared_ptr< NodeObject > > | fetchBatch (std::vector< uint256 > const &hashes) |
| bool | storeLedger (std::shared_ptr< Ledger const > const &srcLedger) override |
| Store a ledger from a different database. More... | |
| void | sweep () override |
| Remove expired entries from the positive and negative caches. More... | |
| std::shared_ptr< NodeObject > | fetchNodeObject (uint256 const &hash, std::uint32_t ledgerSeq=0, FetchType fetchType=FetchType::synchronous) |
| Fetch a node object. More... | |
| void | asyncFetch (uint256 const &hash, std::uint32_t ledgerSeq, std::function< void(std::shared_ptr< NodeObject > const &)> &&callback) |
| Fetch an object without waiting. More... | |
| std::uint64_t | getStoreCount () const |
| Gather statistics pertaining to read and write activities. More... | |
| 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. More... | |
| virtual void | stop () |
| bool | isStopping () const |
| std::uint32_t | ledgersPerShard () const noexcept |
| std::uint32_t | earliestLedgerSeq () const noexcept |
| std::uint32_t | earliestShardIndex () const noexcept |
| std::uint32_t | firstLedgerSeq (std::uint32_t shardIndex) const noexcept |
| Calculates the first ledger sequence for a given shard index. More... | |
| std::uint32_t | lastLedgerSeq (std::uint32_t shardIndex) const noexcept |
| Calculates the last ledger sequence for a given shard index. More... | |
| std::uint32_t | seqToShardIndex (std::uint32_t ledgerSeq) const noexcept |
| Calculates the shard index for a given ledger sequence. More... | |
| std::uint32_t | maxLedgers (std::uint32_t shardIndex) const noexcept |
| Calculates the maximum ledgers for a given shard index. More... | |
Protected Member Functions | |
| bool | storeLedger (Ledger const &srcLedger, std::shared_ptr< Backend > dstBackend) |
| void | storeStats (std::uint64_t count, std::uint64_t sz) |
| void | importInternal (Backend &dstBackend, Database &srcDB) |
| void | updateFetchMetrics (uint64_t fetches, uint64_t hits, uint64_t duration) |
Protected Attributes | |
| const beast::Journal | j_ |
| Scheduler & | scheduler_ |
| int | fdRequired_ {0} |
| std::atomic< std::uint32_t > | fetchHitCount_ {0} |
| std::atomic< std::uint32_t > | fetchSz_ {0} |
| const std::uint32_t | ledgersPerShard_ |
| const std::uint32_t | earliestLedgerSeq_ |
| const std::uint32_t | earliestShardIndex_ |
Private Member Functions | |
| std::shared_ptr< NodeObject > | fetchNodeObject (uint256 const &hash, std::uint32_t, FetchReport &fetchReport) 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. More... | |
| std::optional< Backend::Counters< std::uint64_t > > | getCounters () const override |
| Retrieve backend read and write stats. More... | |
| void | threadEntry () |
Private Attributes | |
| std::shared_ptr< TaggedCache< uint256, NodeObject > > | cache_ |
| std::shared_ptr< Backend > | backend_ |
| std::atomic< std::uint64_t > | storeCount_ {0} |
| std::atomic< std::uint64_t > | storeSz_ {0} |
| std::atomic< std::uint64_t > | fetchTotalCount_ {0} |
| std::atomic< std::uint64_t > | fetchDurationUs_ {0} |
| std::atomic< std::uint64_t > | storeDurationUs_ {0} |
| std::mutex | readLock_ |
| std::condition_variable | readCondVar_ |
| std::map< uint256, std::vector< std::pair< std::uint32_t, std::function< void(std::shared_ptr< NodeObject > const &)> > > > | read_ |
| uint256 | readLastHash_ |
| std::vector< std::thread > | readThreads_ |
| bool | readStopping_ {false} |
Definition at line 30 of file DatabaseNodeImp.h.
|
delete |
|
delete |
| ripple::NodeStore::DatabaseNodeImp::DatabaseNodeImp | ( | Scheduler & | scheduler, |
| int | readThreads, | ||
| std::shared_ptr< Backend > | backend, | ||
| Section const & | config, | ||
| beast::Journal | j | ||
| ) |
Definition at line 38 of file DatabaseNodeImp.h.
| ripple::NodeStore::DatabaseNodeImp::~DatabaseNodeImp | ( | ) |
Definition at line 82 of file DatabaseNodeImp.h.
|
delete |
|
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 88 of file DatabaseNodeImp.h.
|
overridevirtual |
Retrieve the estimated number of pending write operations.
This is used for diagnostics.
Implements ripple::NodeStore::Database.
Definition at line 94 of file DatabaseNodeImp.h.
|
overridevirtual |
Import objects from another database.
Implements ripple::NodeStore::Database.
Definition at line 100 of file DatabaseNodeImp.h.
|
overridevirtual |
Store the object.
The caller's Blob parameter is overwritten.
| 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. |
true if the object was stored? Implements ripple::NodeStore::Database.
Definition at line 28 of file DatabaseNodeImp.cpp.
|
overridevirtual |
Implements ripple::NodeStore::Database.
Definition at line 109 of file DatabaseNodeImp.h.
|
overridevirtual |
Implements ripple::NodeStore::Database.
Definition at line 115 of file DatabaseNodeImp.h.
| std::vector< std::shared_ptr< NodeObject > > ripple::NodeStore::DatabaseNodeImp::fetchBatch | ( | std::vector< uint256 > const & | hashes | ) |
Definition at line 104 of file DatabaseNodeImp.cpp.
|
overridevirtual |
Store a ledger from a different database.
| srcLedger | The ledger to store. |
Implements ripple::NodeStore::Database.
Definition at line 124 of file DatabaseNodeImp.h.
|
overridevirtual |
Remove expired entries from the positive and negative caches.
Implements ripple::NodeStore::Database.
Definition at line 40 of file DatabaseNodeImp.cpp.
|
overrideprivatevirtual |
Implements ripple::NodeStore::Database.
Definition at line 47 of file DatabaseNodeImp.cpp.
|
overrideprivatevirtual |
Visit every object in the database This is usually called during import.
Implements ripple::NodeStore::Database.
Definition at line 146 of file DatabaseNodeImp.h.
|
overrideprivatevirtual |
Retrieve backend read and write stats.
Reimplemented from ripple::NodeStore::Database.
Definition at line 152 of file DatabaseNodeImp.h.
|
inherited |
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.
| 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. |
Definition at line 158 of file Database.cpp.
|
inherited |
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
| hash | The key of the object to retrieve |
| ledgerSeq | The sequence of the ledger where the object is stored, used by the shard store. |
| callback | Callback function when read completes |
Definition at line 107 of file Database.cpp.
|
protectedinherited |
Definition at line 183 of file Database.cpp.
|
inherited |
Gather statistics pertaining to read and write activities.
| obj | Json object reference into which to place counters. |
Definition at line 181 of file Database.h.
|
inherited |
Definition at line 187 of file Database.h.
|
inherited |
Definition at line 193 of file Database.h.
|
inherited |
Definition at line 199 of file Database.h.
|
inherited |
Definition at line 205 of file Database.h.
|
inherited |
Definition at line 329 of file Database.cpp.
|
inherited |
Returns the number of file descriptors the database expects to need.
Definition at line 215 of file Database.h.
|
virtualinherited |
Reimplemented in ripple::NodeStore::DatabaseShardImp.
Definition at line 89 of file Database.cpp.
|
inherited |
Definition at line 69 of file Database.cpp.
|
noexceptinherited |
Definition at line 229 of file Database.h.
|
noexceptinherited |
Definition at line 237 of file Database.h.
|
noexceptinherited |
Definition at line 245 of file Database.h.
|
noexceptinherited |
Calculates the first ledger sequence for a given shard index.
| shardIndex | The shard index considered |
Definition at line 256 of file Database.h.
|
noexceptinherited |
Calculates the last ledger sequence for a given shard index.
| shardIndex | The shard index considered |
Definition at line 270 of file Database.h.
|
noexceptinherited |
Calculates the shard index for a given ledger sequence.
| ledgerSeq | ledger sequence |
Definition at line 282 of file Database.h.
|
noexceptinherited |
Calculates the maximum ledgers for a given shard index.
| shardIndex | The shard index considered |
Definition at line 76 of file Database.cpp.
|
protectedinherited |
Definition at line 327 of file Database.h.
|
protectedinherited |
Definition at line 119 of file Database.cpp.
|
protectedinherited |
Definition at line 343 of file Database.h.
|
privateinherited |
Definition at line 283 of file Database.cpp.
|
private |
Definition at line 135 of file DatabaseNodeImp.h.
|
private |
Definition at line 137 of file DatabaseNodeImp.h.
|
protectedinherited |
Definition at line 300 of file Database.h.
|
protectedinherited |
Definition at line 301 of file Database.h.
|
protectedinherited |
Definition at line 302 of file Database.h.
|
protectedinherited |
Definition at line 304 of file Database.h.
|
protectedinherited |
Definition at line 305 of file Database.h.
|
protectedinherited |
Definition at line 313 of file Database.h.
|
protectedinherited |
Definition at line 321 of file Database.h.
|
protectedinherited |
Definition at line 324 of file Database.h.
|
privateinherited |
Definition at line 351 of file Database.h.
|
privateinherited |
Definition at line 352 of file Database.h.
|
privateinherited |
Definition at line 353 of file Database.h.
|
privateinherited |
Definition at line 354 of file Database.h.
|
privateinherited |
Definition at line 355 of file Database.h.
|
mutableprivateinherited |
Definition at line 357 of file Database.h.
|
privateinherited |
Definition at line 358 of file Database.h.
|
privateinherited |
Definition at line 366 of file Database.h.
|
privateinherited |
Definition at line 369 of file Database.h.
|
privateinherited |
Definition at line 371 of file Database.h.
|
privateinherited |
Definition at line 372 of file Database.h.
1.8.17