20 #include <ripple/nodestore/impl/DatabaseNodeImp.h>
21 #include <ripple/nodestore/impl/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!");
51 std::string const type{get<std::string>(parameters,
"type")};
55 auto factory{
find(type)};
58 #ifndef RIPPLED_REPORTING
59 if (boost::iequals(type,
"cassandra"))
60 Throw<std::runtime_error>(
61 "To use Cassandra as a nodestore, build rippled with "
67 return factory->createInstance(
83 return std::make_unique<DatabaseNodeImp>(
97 list_.push_back(&factory);
106 return other == &factory;
108 assert(iter !=
list_.end());
118 return boost::iequals(name, other->getName());
120 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.