1#ifndef XRPL_APP_MISC_SHAMAPSTOREIMP_H_INCLUDED
2#define XRPL_APP_MISC_SHAMAPSTOREIMP_H_INCLUDED
4#include <xrpld/app/ledger/LedgerMaster.h>
5#include <xrpld/app/misc/SHAMapStore.h>
6#include <xrpld/app/rdb/State.h>
7#include <xrpld/core/DatabaseCon.h>
9#include <xrpl/nodestore/DatabaseRotating.h>
10#include <xrpl/nodestore/Scheduler.h>
171 template <
class CacheInstance>
177 for (
auto const& key : cache.getKeys())
A generic endpoint for log messages.
Holds unparsed configuration information.
Provides server functionality for clients.
std::shared_ptr< NodeObject > fetchNodeObject(uint256 const &hash, std::uint32_t ledgerSeq=0, FetchType fetchType=FetchType::synchronous, bool duplicate=false)
Fetch a node object.
Scheduling for asynchronous backend activity.
LedgerIndex setCanDelete(LedgerIndex canDelete)
void setState(SavedState const &state)
beast::Journal const journal_
void setLastRotated(LedgerIndex seq)
LedgerIndex getCanDelete()
void init(BasicConfig const &config, std::string const &dbName)
std::condition_variable rendezvous_
std::condition_variable cond_
bool freshenCache(CacheInstance &cache)
void rendezvous() const override
NodeStore::DatabaseRotating * dbRotating_
std::chrono::milliseconds backOff_
void clearSql(LedgerIndex lastRotated, std::string const &TableName, std::function< std::optional< LedgerIndex >()> const &getMinSeq, std::function< void(LedgerIndex)> const &deleteBeforeSeq)
delete from sqlite table in batches to not lock the db excessively.
bool advisoryDelete() const override
Whether advisory delete is enabled.
static constexpr auto nodeStoreName_
void clearPrior(LedgerIndex lastRotated)
std::atomic< LedgerIndex > canDelete_
std::unique_ptr< NodeStore::Backend > makeBackendRotating(std::string path=std::string())
TreeNodeCache * treeNodeCache_
std::uint32_t deleteInterval_
LedgerIndex setCanDelete(LedgerIndex seq) override
Highest ledger that may be deleted.
LedgerMaster * ledgerMaster_
void onLedgerClosed(std::shared_ptr< Ledger const > const &ledger) override
Called by LedgerMaster every time a ledger validates.
std::chrono::seconds recoveryWaitTime_
If the node is out of sync during an online_delete healthWait() call, sleep the thread for this time,...
std::string const dbPrefix_
std::uint32_t deleteBatch_
std::uint32_t clampFetchDepth(std::uint32_t fetch_depth) const override
LedgerIndex getCanDelete() override
Highest ledger that may be deleted.
std::chrono::seconds ageThreshold_
std::atomic< LedgerIndex > minimumOnline_
std::uint64_t const checkHealthInterval_
std::unique_ptr< NodeStore::Database > makeNodeStore(int readThreads) override
std::string const dbName_
std::atomic< bool > working_
FullBelowCache * fullBelowCache_
LedgerIndex getLastRotated() override
Maximum ledger that has been deleted, or will be deleted if currently in the act of online deletion.
std::optional< LedgerIndex > minimumOnline() const override
The minimum ledger to try and maintain in our database.
HealthResult
This is a health check for online deletion that waits until rippled is stable before returning.
beast::Journal const journal_
NodeStore::Scheduler & scheduler_
static std::uint32_t const minimumDeletionIntervalSA_
int fdRequired() const override
Returns the number of file descriptors that are needed.
bool copyNode(std::uint64_t &nodeCount, SHAMapTreeNode const &node)
std::shared_ptr< Ledger const > newLedger_
HealthResult healthWait()
static std::uint32_t const minimumDeletionInterval_
void clearCaches(LedgerIndex validatedSeq)
class to create database, launch online delete thread, and related SQLite database
Remembers which tree keys have all descendants resident.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.