xrpld
Loading...
Searching...
No Matches
SHAMapStore.h
1#pragma once
2
3#include <xrpld/app/main/Application.h>
4
5#include <xrpl/beast/utility/Journal.h>
6#include <xrpl/ledger/Ledger.h>
7#include <xrpl/nodestore/Database.h>
8#include <xrpl/nodestore/Scheduler.h>
9#include <xrpl/protocol/Protocol.h>
10
11#include <chrono>
12#include <cstdint>
13#include <memory>
14#include <optional>
15
16namespace xrpl {
17
19
25{
26public:
27 virtual ~SHAMapStore() = default;
28
32 virtual void
34
35 virtual void
36 start() = 0;
37
38 [[nodiscard]] virtual bool
40
41 virtual void
42 stop() = 0;
43
44 [[nodiscard]] virtual std::uint32_t
45 clampFetchDepth(std::uint32_t fetchDepth) const = 0;
46
48 makeNodeStore(int readThreads) = 0;
49
53 virtual LedgerIndex
54 setCanDelete(LedgerIndex canDelete) = 0;
55
59 [[nodiscard]] virtual bool
60 advisoryDelete() const = 0;
61
66 virtual LedgerIndex
68
72 virtual LedgerIndex
74
78 [[nodiscard]] virtual int
79 fdRequired() const = 0;
80
98 [[nodiscard]] virtual std::optional<LedgerIndex>
99 minimumOnline() const = 0;
100};
101
102//------------------------------------------------------------------------------
103
106} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
class to create database, launch online delete thread, and related SQLite database
Definition SHAMapStore.h:25
virtual void stop()=0
virtual std::unique_ptr< node_store::Database > makeNodeStore(int readThreads)=0
virtual LedgerIndex getCanDelete()=0
Highest ledger that may be deleted.
virtual std::uint32_t clampFetchDepth(std::uint32_t fetchDepth) const =0
virtual ~SHAMapStore()=default
virtual std::optional< LedgerIndex > minimumOnline() const =0
The minimum ledger to try and maintain in our database.
virtual bool advisoryDelete() const =0
Whether advisory delete is enabled.
virtual LedgerIndex getLastRotated()=0
Maximum ledger that has been deleted, or will be deleted if currently in the act of online deletion.
virtual bool rendezvous(std::optional< std::chrono::milliseconds > const &timeout={}) const =0
virtual LedgerIndex setCanDelete(LedgerIndex canDelete)=0
Highest ledger that may be deleted.
virtual void start()=0
virtual void onLedgerClosed(std::shared_ptr< Ledger const > const &ledger)=0
Called by LedgerMaster every time a ledger validates.
virtual int fdRequired() const =0
Returns the number of file descriptors that are needed.
Scheduling for asynchronous backend activity.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::uint32_t LedgerIndex
A ledger index.
Definition Protocol.h:382
std::unique_ptr< SHAMapStore > makeSHAMapStore(Application &app, node_store::Scheduler &scheduler, beast::Journal journal)