xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
nodestore
DatabaseRotating.h
1
#pragma once
2
3
#include <xrpl/beast/utility/Journal.h>
4
#include <xrpl/nodestore/Backend.h>
5
#include <xrpl/nodestore/Database.h>
6
#include <xrpl/nodestore/Scheduler.h>
7
8
#include <
functional
>
9
#include <
memory
>
10
#include <
string
>
11
12
namespace
xrpl::node_store
{
13
14
/* This class has two key-value store Backend objects for persisting SHAMap
15
* records. This facilitates online deletion of data. New backends are
16
* rotated in. Old ones are rotated out and deleted.
17
*/
18
19
class
DatabaseRotating
:
public
Database
20
{
21
public
:
22
DatabaseRotating
(
23
Scheduler
& scheduler,
24
int
readThreads,
25
Section
const
& config,
26
beast::Journal
journal)
27
:
Database
(scheduler, readThreads, config, journal)
28
{
29
}
30
39
virtual
void
40
rotate
(
41
std::unique_ptr<node_store::Backend>
&& newBackend,
42
std::function
<
void
(
std::string
const
& writableName,
std::string
const
& archiveName)>
const
&
43
f) = 0;
44
55
virtual
void
56
setRotationInFlight
(
bool
inFlight) = 0;
57
};
58
59
}
// namespace xrpl::node_store
std::string
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:44
xrpl::Section
Holds a collection of configuration values.
Definition
BasicConfig.h:28
xrpl::node_store::DatabaseRotating::setRotationInFlight
virtual void setRotationInFlight(bool inFlight)=0
Marks an online-delete rotation as in progress (or completed).
xrpl::node_store::DatabaseRotating::rotate
virtual void rotate(std::unique_ptr< node_store::Backend > &&newBackend, std::function< void(std::string const &writableName, std::string const &archiveName)> const &f)=0
Rotates the backends.
xrpl::node_store::DatabaseRotating::DatabaseRotating
DatabaseRotating(Scheduler &scheduler, int readThreads, Section const &config, beast::Journal journal)
Definition
DatabaseRotating.h:22
xrpl::node_store::Database::Database
Database()=delete
xrpl::node_store::Scheduler
Scheduling for asynchronous backend activity.
Definition
include/xrpl/nodestore/Scheduler.h:46
std::function
functional
memory
xrpl::node_store
Definition
ServiceRegistry.h:18
string
std::unique_ptr
Generated by
1.17.0