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!");
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(
81 return std::make_unique<DatabaseNodeImp>(
82 scheduler, readThreads, std::move(backend), config, journal);
89 list_.push_back(&factory);
98 return other == &factory;
100 assert(iter !=
list_.end());
110 return boost::iequals(name, other->getName());
112 if (iter ==
list_.end())
Holds a collection of configuration values.
Singleton for managing NodeStore factories and back ends.
Base class for backend factories.
void insert(Factory &factory) override
Add a factory.
static void missing_backend()
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.
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.
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_
static Manager & instance()
Returns the instance of the manager singleton.
void erase(Factory &factory) override
Remove a factory.
T & get(EitherAmount &amt)