mirror of
https://github.com/XRPLF/rippled.git
synced 2026-02-08 07:52:29 +00:00
This change replaces all include guards in the `src/` and `include/` directories by `#pragma once`.
36 lines
1.0 KiB
C++
36 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <xrpl/nodestore/Database.h>
|
|
|
|
namespace xrpl {
|
|
namespace NodeStore {
|
|
|
|
/* This class has two key-value store Backend objects for persisting SHAMap
|
|
* records. This facilitates online deletion of data. New backends are
|
|
* rotated in. Old ones are rotated out and deleted.
|
|
*/
|
|
|
|
class DatabaseRotating : public Database
|
|
{
|
|
public:
|
|
DatabaseRotating(Scheduler& scheduler, int readThreads, Section const& config, beast::Journal journal)
|
|
: Database(scheduler, readThreads, config, journal)
|
|
{
|
|
}
|
|
|
|
/** Rotates the backends.
|
|
|
|
@param newBackend New writable backend
|
|
@param f A function executed after the rotation outside of lock. The
|
|
values passed to f will be the new backend database names _after_
|
|
rotation.
|
|
*/
|
|
virtual void
|
|
rotate(
|
|
std::unique_ptr<NodeStore::Backend>&& newBackend,
|
|
std::function<void(std::string const& writableName, std::string const& archiveName)> const& f) = 0;
|
|
};
|
|
|
|
} // namespace NodeStore
|
|
} // namespace xrpl
|