20 #ifndef RIPPLE_APP_MISC_SHAMAPSTOREIMP_H_INCLUDED
21 #define RIPPLE_APP_MISC_SHAMAPSTOREIMP_H_INCLUDED
23 #include <ripple/app/ledger/LedgerMaster.h>
24 #include <ripple/app/misc/SHAMapStore.h>
25 #include <ripple/core/DatabaseCon.h>
26 #include <ripple/core/Stoppable.h>
27 #include <ripple/nodestore/DatabaseRotating.h>
192 boost::optional<LedgerIndex>
207 template <
class CacheInstance>
213 for (
auto const& key : cache.getKeys())
Provides server functionality for clients.
LedgerIndex setCanDelete(LedgerIndex canDelete)
SHAMapStoreImp(Application &app, Stoppable &parent, NodeStore::Scheduler &scheduler, beast::Journal journal)
NodeStore::Scheduler & scheduler_
std::shared_ptr< Ledger const > newLedger_
void onLedgerClosed(std::shared_ptr< Ledger const > const &ledger) override
Called by LedgerMaster every time a ledger validates.
static const std::uint32_t minimumDeletionInterval_
const std::string dbPrefix_
LedgerMaster * ledgerMaster_
Remembers which tree keys have all descendants resident.
void onStart() override
Override called during start.
LedgerIndex setCanDelete(LedgerIndex seq) override
Highest ledger that may be deleted.
const beast::Journal journal_
class to create database, launch online delete thread, and related SQLite database
DatabaseCon * transactionDb_
const beast::Journal journal_
std::condition_variable cond_
LedgerIndex getCanDelete()
static constexpr auto nodeStoreName_
static Sink & getNullSink()
Returns a Sink which does nothing.
bool copyNode(std::uint64_t &nodeCount, SHAMapTreeNode const &node)
NodeStore::DatabaseRotating * dbRotating_
void clearSql(DatabaseCon &database, LedgerIndex lastRotated, std::string const &minQuery, std::string const &deleteQuery)
delete from sqlite table in batches to not lock the db excessively.
std::uint32_t clampFetchDepth(std::uint32_t fetch_depth) const override
LedgerIndex getCanDelete() override
Highest ledger that may be deleted.
Provides an interface for starting and stopping.
bool advisoryDelete() const override
Whether advisory delete is enabled.
std::atomic< LedgerIndex > minimumOnline_
void setState(SavedState const &state)
TreeNodeCache * treeNodeCache_
std::atomic< bool > working_
std::uint32_t deleteInterval_
void onStop() override
Override called when the stop notification is issued.
std::chrono::seconds ageThreshold_
boost::optional< LedgerIndex > minimumOnline() const override
The minimum ledger to try and maintain in our database.
void clearPrior(LedgerIndex lastRotated)
A generic endpoint for log messages.
boost::optional< std::chrono::seconds > recoveryWaitTime_
If set, and the node is out of sync during an online_delete health check, sleep the thread for this t...
Scheduling for asynchronous backend activity.
std::shared_ptr< NodeObject > fetchNodeObject(uint256 const &hash, std::uint32_t ledgerSeq=0, FetchType fetchType=FetchType::synchronous)
Fetch a node object.
const std::uint64_t checkHealthInterval_
std::chrono::milliseconds backOff_
void init(BasicConfig const &config, std::string const &dbName)
const std::string dbName_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
int fdRequired() const override
Returns the number of file descriptors that are needed.
void setLastRotated(LedgerIndex seq)
LedgerIndex getLastRotated() override
Maximum ledger that has been deleted, or will be deleted if currently in the act of online deletion.
std::atomic< LedgerIndex > canDelete_
static const std::uint32_t minimumDeletionIntervalSA_
std::uint32_t deleteBatch_
FullBelowCache * fullBelowCache_
void clearCaches(LedgerIndex validatedSeq)
std::unique_ptr< NodeStore::Backend > makeBackendRotating(std::string path=std::string())
std::unique_ptr< NodeStore::Database > makeNodeStore(std::string const &name, std::int32_t readThreads) override
bool freshenCache(CacheInstance &cache)
Holds unparsed configuration information.
void rendezvous() const override
std::condition_variable rendezvous_