xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
app
misc
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
16
namespace
xrpl
{
17
18
class
TransactionMaster
;
19
24
class
SHAMapStore
25
{
26
public
:
27
virtual
~SHAMapStore
() =
default
;
28
32
virtual
void
33
onLedgerClosed
(
std::shared_ptr<Ledger const>
const
& ledger) = 0;
34
35
virtual
void
36
start
() = 0;
37
38
[[nodiscard]]
virtual
bool
39
rendezvous
(
std::optional<std::chrono::milliseconds>
const
& timeout = {})
const
= 0;
40
41
virtual
void
42
stop
() = 0;
43
44
[[nodiscard]]
virtual
std::uint32_t
45
clampFetchDepth
(
std::uint32_t
fetchDepth)
const
= 0;
46
47
virtual
std::unique_ptr<node_store::Database>
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
67
getLastRotated
() = 0;
68
72
virtual
LedgerIndex
73
getCanDelete
() = 0;
74
78
[[nodiscard]]
virtual
int
79
fdRequired
()
const
= 0;
80
98
[[nodiscard]]
virtual
std::optional<LedgerIndex>
99
minimumOnline
()
const
= 0;
100
};
101
102
//------------------------------------------------------------------------------
103
104
std::unique_ptr<SHAMapStore>
105
makeSHAMapStore
(
Application
& app,
node_store::Scheduler
& scheduler,
beast::Journal
journal);
106
}
// namespace xrpl
chrono
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:44
xrpl::Application
Definition
Application.h:94
xrpl::SHAMapStore
class to create database, launch online delete thread, and related SQLite database
Definition
SHAMapStore.h:25
xrpl::SHAMapStore::stop
virtual void stop()=0
xrpl::SHAMapStore::makeNodeStore
virtual std::unique_ptr< node_store::Database > makeNodeStore(int readThreads)=0
xrpl::SHAMapStore::getCanDelete
virtual LedgerIndex getCanDelete()=0
Highest ledger that may be deleted.
xrpl::SHAMapStore::clampFetchDepth
virtual std::uint32_t clampFetchDepth(std::uint32_t fetchDepth) const =0
xrpl::SHAMapStore::~SHAMapStore
virtual ~SHAMapStore()=default
xrpl::SHAMapStore::minimumOnline
virtual std::optional< LedgerIndex > minimumOnline() const =0
The minimum ledger to try and maintain in our database.
xrpl::SHAMapStore::advisoryDelete
virtual bool advisoryDelete() const =0
Whether advisory delete is enabled.
xrpl::SHAMapStore::getLastRotated
virtual LedgerIndex getLastRotated()=0
Maximum ledger that has been deleted, or will be deleted if currently in the act of online deletion.
xrpl::SHAMapStore::rendezvous
virtual bool rendezvous(std::optional< std::chrono::milliseconds > const &timeout={}) const =0
xrpl::SHAMapStore::setCanDelete
virtual LedgerIndex setCanDelete(LedgerIndex canDelete)=0
Highest ledger that may be deleted.
xrpl::SHAMapStore::start
virtual void start()=0
xrpl::SHAMapStore::onLedgerClosed
virtual void onLedgerClosed(std::shared_ptr< Ledger const > const &ledger)=0
Called by LedgerMaster every time a ledger validates.
xrpl::SHAMapStore::fdRequired
virtual int fdRequired() const =0
Returns the number of file descriptors that are needed.
xrpl::TransactionMaster
Definition
TransactionMaster.h:28
xrpl::node_store::Scheduler
Scheduling for asynchronous backend activity.
Definition
include/xrpl/nodestore/Scheduler.h:46
cstdint
std::uint32_t
memory
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::LedgerIndex
std::uint32_t LedgerIndex
A ledger index.
Definition
Protocol.h:382
xrpl::makeSHAMapStore
std::unique_ptr< SHAMapStore > makeSHAMapStore(Application &app, node_store::Scheduler &scheduler, beast::Journal journal)
Definition
SHAMapStoreImp.cpp:894
optional
std::shared_ptr
std::unique_ptr
Generated by
1.17.0