rippled
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ripple::NodeStore::ManagerImp Class Reference
Inheritance diagram for ripple::NodeStore::ManagerImp:
Inheritance graph
[legend]
Collaboration diagram for ripple::NodeStore::ManagerImp:
Collaboration graph
[legend]

Public Member Functions

 ManagerImp ()=default
 
 ~ManagerImp ()=default
 
Factoryfind (std::string const &name) override
 Return a pointer to the matching factory if it exists. More...
 
void insert (Factory &factory) override
 Add a factory. More...
 
void erase (Factory &factory) override
 Remove a factory. More...
 
std::unique_ptr< Backendmake_Backend (Section const &parameters, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal) override
 Create a backend. More...
 
std::unique_ptr< Databasemake_Database (std::size_t burstSize, Scheduler &scheduler, int readThreads, Section const &config, beast::Journal journal) override
 Construct a NodeStore database. More...
 

Static Public Member Functions

static ManagerImpinstance ()
 
static void missing_backend ()
 

Private Attributes

std::mutex mutex_
 
std::vector< Factory * > list_
 

Detailed Description

Definition at line 29 of file ManagerImp.h.

Constructor & Destructor Documentation

◆ ManagerImp()

ripple::NodeStore::ManagerImp::ManagerImp ( )
default

◆ ~ManagerImp()

ripple::NodeStore::ManagerImp::~ManagerImp ( )
default

Member Function Documentation

◆ instance()

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

Definition at line 30 of file ManagerImp.cpp.

◆ missing_backend()

void ripple::NodeStore::ManagerImp::missing_backend ( )
static

Definition at line 37 of file ManagerImp.cpp.

◆ find()

Factory * ripple::NodeStore::ManagerImp::find ( std::string const &  name)
overridevirtual

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.

Implements ripple::NodeStore::Manager.

Definition at line 105 of file ManagerImp.cpp.

◆ insert()

void ripple::NodeStore::ManagerImp::insert ( Factory factory)
overridevirtual

Add a factory.

Implements ripple::NodeStore::Manager.

Definition at line 86 of file ManagerImp.cpp.

◆ erase()

void ripple::NodeStore::ManagerImp::erase ( Factory factory)
overridevirtual

Remove a factory.

Implements ripple::NodeStore::Manager.

Definition at line 93 of file ManagerImp.cpp.

◆ make_Backend()

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

Create a backend.

Implements ripple::NodeStore::Manager.

Definition at line 45 of file ManagerImp.cpp.

◆ make_Database()

std::unique_ptr< Database > ripple::NodeStore::ManagerImp::make_Database ( std::size_t  burstSize,
Scheduler scheduler,
int  readThreads,
Section const &  backendParameters,
beast::Journal  journal 
)
overridevirtual

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.

Implements ripple::NodeStore::Manager.

Definition at line 72 of file ManagerImp.cpp.

Member Data Documentation

◆ mutex_

std::mutex ripple::NodeStore::ManagerImp::mutex_
private

Definition at line 32 of file ManagerImp.h.

◆ list_

std::vector<Factory*> ripple::NodeStore::ManagerImp::list_
private

Definition at line 33 of file ManagerImp.h.