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/nodestore/DatabaseRotating.h>
184 boost::optional<LedgerIndex>
199 template <
class CacheInstance>
205 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_
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.
std::int32_t ageThreshold_
NodeStore::DatabaseRotating * dbRotating_
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.
virtual std::shared_ptr< NodeObject > fetch(uint256 const &hash, std::uint32_t seq)=0
Fetch an object.
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.
boost::optional< LedgerIndex > minimumOnline() const override
The minimum ledger to try and maintain in our database.
bool copyNode(std::uint64_t &nodeCount, SHAMapAbstractNode const &node)
void clearPrior(LedgerIndex lastRotated)
A generic endpoint for log messages.
Scheduling for asynchronous backend activity.
const std::uint64_t checkHealthInterval_
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 onPrepare() override
Override called during preparation.
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_
void onChildrenStopped() override
Override called when all children have stopped.
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
bool 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 pause briefly to extend access tim...
std::condition_variable rendezvous_