20#include <xrpld/nodestore/detail/DatabaseNodeImp.h>
21#include <xrpld/nodestore/detail/ManagerImp.h>
23#include <boost/algorithm/string/predicate.hpp>
39 Throw<std::runtime_error>(
40 "Your rippled.cfg is missing a [node_db] entry, "
41 "please see the rippled-example.cfg file!");
55 auto factory{
find(type)};
61 return factory->createInstance(
75 return std::make_unique<DatabaseNodeImp>(
76 scheduler, readThreads, std::move(backend), config, journal);
83 list_.push_back(&factory);
92 return other == &factory;
96 "ripple::NodeStore::ManagerImp::erase : valid input");
106 return boost::iequals(name, other->getName());
108 if (iter ==
list_.end())
A generic endpoint for log messages.
static constexpr std::size_t keyBytes
Base class for backend factories.
Factory * find(std::string const &name) override
Return a pointer to the matching factory if it exists.
std::vector< Factory * > list_
std::unique_ptr< Database > make_Database(std::size_t burstSize, Scheduler &scheduler, int readThreads, Section const &config, beast::Journal journal) override
Construct a NodeStore database.
static ManagerImp & instance()
void insert(Factory &factory) override
Add a factory.
static void missing_backend()
std::unique_ptr< Backend > make_Backend(Section const ¶meters, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal) override
Create a backend.
void erase(Factory &factory) override
Remove a factory.
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.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
T get(Section const §ion, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.