xrpld
Loading...
Searching...
No Matches
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
12namespace 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
20{
21public:
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
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
A generic endpoint for log messages.
Definition Journal.h:44
Holds a collection of configuration values.
Definition BasicConfig.h:29
virtual void setRotationInFlight(bool inFlight)=0
Marks an online-delete rotation as in progress (or completed).
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.
DatabaseRotating(Scheduler &scheduler, int readThreads, Section const &config, beast::Journal journal)
Scheduling for asynchronous backend activity.