20 #include <ripple/nodestore/impl/DatabaseNodeImp.h>
21 #include <ripple/nodestore/impl/ManagerImp.h>
23 #include <boost/algorithm/string/predicate.hpp>
38 Throw<std::runtime_error>(
39 "Your rippled.cfg is missing a [node_db] entry, "
40 "please see the rippled-example.cfg file!");
49 std::string const type{get<std::string>(parameters,
"type")};
53 auto factory{
find(type)};
57 return factory->createInstance(
72 return std::make_unique<DatabaseNodeImp>(
86 list_.push_back(&factory);
95 return other == &factory;
97 assert(iter !=
list_.end());
107 return boost::iequals(name, other->getName());
109 if (iter ==
list_.end())
Holds a collection of configuration values.
Singleton for managing NodeStore factories and back ends.
std::unique_ptr< Database > make_Database(std::string const &name, Scheduler &scheduler, int readThreads, Stoppable &parent, Section const &config, beast::Journal journal) override
Construct a NodeStore database.
Base class for backend factories.
void insert(Factory &factory) override
Add a factory.
static void missing_backend()
virtual std::unique_ptr< Backend > make_Backend(Section const ¶meters, Scheduler &scheduler, beast::Journal journal)=0
Create a backend.
Factory * find(std::string const &name) override
Return a pointer to the matching factory if it exists.
Provides an interface for starting and stopping.
static ManagerImp & instance()
A generic endpoint for log messages.
Scheduling for asynchronous backend activity.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static constexpr std::size_t keyBytes
std::vector< Factory * > list_
std::unique_ptr< Backend > make_Backend(Section const &config, Scheduler &scheduler, beast::Journal journal)
Create a Backend.
std::unique_ptr< Backend > make_Backend(Section const ¶meters, Scheduler &scheduler, beast::Journal journal) override
Create a backend.
static Manager & instance()
Returns the instance of the manager singleton.
void erase(Factory &factory) override
Remove a factory.