rippled
Public Member Functions | Static Public Member Functions | List of all members
ripple::NodeStore::Manager Class Referenceabstract

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

Inheritance diagram for ripple::NodeStore::Manager:
Inheritance graph
[legend]

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. More...
 
virtual void erase (Factory &factory)=0
 Remove a factory. More...
 
virtual Factoryfind (std::string const &name)=0
 Return a pointer to the matching factory if it exists. More...
 
virtual std::unique_ptr< Backendmake_Backend (Section const &parameters, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal)=0
 Create a backend. More...
 
virtual std::unique_ptr< Databasemake_Database (std::size_t burstSize, Scheduler &scheduler, int readThreads, Section const &backendParameters, beast::Journal journal)=0
 Construct a NodeStore database. More...
 

Static Public Member Functions

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

Detailed Description

Singleton for managing NodeStore factories and back ends.

Definition at line 32 of file Manager.h.

Constructor & Destructor Documentation

◆ ~Manager()

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

◆ Manager() [1/2]

ripple::NodeStore::Manager::Manager ( )
default

◆ Manager() [2/2]

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

Member Function Documentation

◆ operator=()

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

◆ instance()

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

Returns the instance of the manager singleton.

Definition at line 120 of file ManagerImp.cpp.

◆ insert()

virtual void ripple::NodeStore::Manager::insert ( Factory factory)
pure virtual

Add a factory.

Implemented in ripple::NodeStore::ManagerImp.

◆ erase()

virtual void ripple::NodeStore::Manager::erase ( Factory factory)
pure virtual

Remove a factory.

Implemented in ripple::NodeStore::ManagerImp.

◆ find()

virtual Factory* ripple::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 ripple::NodeStore::ManagerImp.

◆ make_Backend()

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

Create a backend.

Implemented in ripple::NodeStore::ManagerImp.

◆ make_Database()

virtual std::unique_ptr<Database> ripple::NodeStore::Manager::make_Database ( 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 omited 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 ripple::NodeStore::ManagerImp.