xrpld
Loading...
Searching...
No Matches
xrpl::NodeStore::Manager Class Referenceabstract

Singleton for managing NodeStore factories and back ends. More...

#include <Manager.h>

Inheritance diagram for xrpl::NodeStore::Manager:

Public Member Functions

virtual ~Manager ()=default
 Manager ()=default
 Manager (Manager const &)=delete
Manageroperator= (Manager const &)=delete
virtual void insert (Factory &factory)=0
 Add a factory.
virtual void erase (Factory &factory)=0
 Remove a factory.
virtual Factoryfind (std::string const &name)=0
 Return a pointer to the matching factory if it exists.
virtual std::unique_ptr< BackendmakeBackend (Section const &parameters, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal)=0
 Create a backend.
virtual std::unique_ptr< DatabasemakeDatabase (std::size_t burstSize, Scheduler &scheduler, int readThreads, Section const &backendParameters, beast::Journal journal)=0
 Construct a NodeStore database.

Static Public Member Functions

static Managerinstance ()
 Returns the instance of the manager singleton.

Detailed Description

Singleton for managing NodeStore factories and back ends.

Definition at line 9 of file Manager.h.

Constructor & Destructor Documentation

◆ ~Manager()

virtual xrpl::NodeStore::Manager::~Manager ( )
virtualdefault

◆ Manager() [1/2]

xrpl::NodeStore::Manager::Manager ( )
default

◆ Manager() [2/2]

xrpl::NodeStore::Manager::Manager ( Manager const & )
delete

Member Function Documentation

◆ operator=()

Manager & xrpl::NodeStore::Manager::operator= ( Manager const & )
delete

◆ instance()

Manager & xrpl::NodeStore::Manager::instance ( )
static

Returns the instance of the manager singleton.

Definition at line 133 of file ManagerImp.cpp.

◆ insert()

virtual void xrpl::NodeStore::Manager::insert ( Factory & factory)
pure virtual

Add a factory.

Implemented in xrpl::NodeStore::ManagerImp.

◆ erase()

virtual void xrpl::NodeStore::Manager::erase ( Factory & factory)
pure virtual

Remove a factory.

Implemented in xrpl::NodeStore::ManagerImp.

◆ find()

virtual Factory * xrpl::NodeStore::Manager::find ( std::string const & name)
pure virtual

Return a pointer to the matching factory if it exists.

Parameters
nameThe name to match, performed case-insensitive.
Returns
nullptr if a match was not found.

Implemented in xrpl::NodeStore::ManagerImp.

◆ makeBackend()

virtual std::unique_ptr< Backend > xrpl::NodeStore::Manager::makeBackend ( Section const & parameters,
std::size_t burstSize,
Scheduler & scheduler,
beast::Journal journal )
pure virtual

Create a backend.

Implemented in xrpl::NodeStore::ManagerImp.

◆ makeDatabase()

virtual std::unique_ptr< Database > xrpl::NodeStore::Manager::makeDatabase ( std::size_t burstSize,
Scheduler & scheduler,
int readThreads,
Section const & backendParameters,
beast::Journal journal )
pure virtual

Construct a NodeStore database.

The parameters are key value pairs passed to the backend. The 'type' key must exist, it defines the choice of backend. Most backends also require a 'path' field.

Some choices for 'type' are: HyperLevelDB, LevelDBFactory, SQLite, MDB

If the fastBackendParameter is omitted or empty, no ephemeral database is used. If the scheduler parameter is omitted or unspecified, a synchronous scheduler is used which performs all tasks immediately on the caller's thread.

Note
If the database cannot be opened or created, an exception is thrown.
Parameters
nameA diagnostic label for the database.
burstSizeBackend burst size in bytes.
schedulerThe scheduler to use for performing asynchronous tasks.
readThreadsThe number of async read threads to create
backendParametersThe parameter string for the persistent backend.
fastBackendParameters[optional] The parameter string for the ephemeral backend.
Returns
The opened database.

Implemented in xrpl::NodeStore::ManagerImp.