1#include <xrpl/nodestore/detail/ManagerImp.h>
3#include <xrpl/basics/contract.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/beast/utility/instrumentation.h>
6#include <xrpl/config/BasicConfig.h>
7#include <xrpl/config/Constants.h>
8#include <xrpl/nodestore/Backend.h>
9#include <xrpl/nodestore/Database.h>
10#include <xrpl/nodestore/Manager.h>
11#include <xrpl/nodestore/NodeObject.h>
12#include <xrpl/nodestore/Scheduler.h>
13#include <xrpl/nodestore/detail/DatabaseNodeImp.h>
15#include <boost/algorithm/string/predicate.hpp>
38 "Your xrpld.cfg is missing a [node_db] entry, "
39 "please see the xrpld-example.cfg file!");
48#if XRPL_ROCKSDB_AVAILABLE
50registerRocksDBFactory(
Manager& manager);
60#if XRPL_ROCKSDB_AVAILABLE
61 registerRocksDBFactory(*
this);
78 auto factory{
find(type)};
79 if (factory ==
nullptr)
84 return factory->createInstance(
96 auto backend{
makeBackend(config, burstSize, scheduler, journal)};
99 scheduler, readThreads, std::move(backend), config, journal);
106 list_.push_back(&factory);
115 XRPL_ASSERT(iter !=
list_.end(),
"xrpl::NodeStore::ManagerImp::erase : valid input");
125 if (iter ==
list_.end())
A generic endpoint for log messages.
static constexpr std::size_t kKeyBytes
Base class for backend factories.
virtual std::string getName() const =0
Retrieve the name of this factory.
void insert(Factory &factory) override
Add a factory.
void erase(Factory &factory) override
Remove a factory.
static void missingBackend()
std::vector< Factory * > list_
std::unique_ptr< Database > makeDatabase(std::size_t burstSize, Scheduler &scheduler, int readThreads, Section const &config, beast::Journal journal) override
Construct a NodeStore database.
static ManagerImp & instance()
std::unique_ptr< Backend > makeBackend(Section const ¶meters, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal) override
Create a backend.
Factory * find(std::string const &name) override
Return a pointer to the matching factory if it exists.
Singleton for managing NodeStore factories and back ends.
static Manager & instance()
Returns the instance of the manager singleton.
Scheduling for asynchronous backend activity.
Holds a collection of configuration values.
void registerNuDBFactory(Manager &manager)
void registerNullFactory(Manager &manager)
void registerMemoryFactory(Manager &manager)
T get(Section const §ion, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)
static constexpr auto kType