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!");
50 std::string const type{get<std::string>(parameters,
"type")};
54 auto factory{
find(type)};
58 return factory->createInstance(
74 return std::make_unique<DatabaseNodeImp>(
88 list_.push_back(&factory);
97 return other == &factory;
99 assert(iter !=
list_.end());
109 return boost::iequals(name, other->getName());
111 if (iter ==
list_.end())
Holds a collection of configuration values.
Singleton for managing NodeStore factories and back ends.
Base class for backend factories.
std::unique_ptr< Backend > make_Backend(Section const &config, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal)
Create a Backend.
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.
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_
virtual std::unique_ptr< Backend > make_Backend(Section const ¶meters, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal)=0
Create a backend.
static Manager & instance()
Returns the instance of the manager singleton.
void erase(Factory &factory) override
Remove a factory.
std::unique_ptr< Database > make_Database(std::string const &name, std::size_t burstSize, Scheduler &scheduler, int readThreads, Stoppable &parent, Section const &config, beast::Journal journal) override
Construct a NodeStore database.