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 <cstdint>
12#include <memory>
13#include <optional>
14
15namespace xrpl {
16
18
24{
25public:
26 virtual ~SHAMapStore() = default;
27
31 virtual void
33
34 virtual void
35 start() = 0;
36
37 virtual void
38 rendezvous() const = 0;
39
40 virtual void
41 stop() = 0;
42
43 [[nodiscard]] virtual std::uint32_t
44 clampFetchDepth(std::uint32_t fetchDepth) const = 0;
45
47 makeNodeStore(int readThreads) = 0;
48
52 virtual LedgerIndex
53 setCanDelete(LedgerIndex canDelete) = 0;
54
58 [[nodiscard]] virtual bool
59 advisoryDelete() const = 0;
60
65 virtual LedgerIndex
67
71 virtual LedgerIndex
73
77 [[nodiscard]] virtual int
78 fdRequired() const = 0;
79
97 [[nodiscard]] virtual std::optional<LedgerIndex>
98 minimumOnline() const = 0;
99};
100
101//------------------------------------------------------------------------------
102
105} // 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:24
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 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 void rendezvous() const =0
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:370
std::unique_ptr< SHAMapStore > makeSHAMapStore(Application &app, node_store::Scheduler &scheduler, beast::Journal journal)