CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::RocksDatabase Class Reference

RocksDb-backed database. More...

Collaboration diagram for catapult::cache::RocksDatabase:

Public Member Functions

 RocksDatabase ()
 Creates an empty database. More...
 
 RocksDatabase (const RocksDatabaseSettings &settings)
 Creates database around settings. More...
 
 ~RocksDatabase ()
 Destroys database. More...
 
const std::vector< std::string > & columnFamilyNames () const
 Gets the database column family names. More...
 
bool canPrune () const
 Returns true if pruning is enabled. More...
 
void get (size_t columnId, const rocksdb::Slice &key, RdbDataIterator &result)
 Gets key from columnId returning data in result. More...
 
void put (size_t columnId, const rocksdb::Slice &key, const std::string &value)
 Puts value with key in columnId. More...
 
void del (size_t columnId, const rocksdb::Slice &key)
 Deletes key from columnId. More...
 
size_t prune (size_t columnId, uint64_t boundary)
 Prunes elements from columnId below boundary. Returns number of pruned elements. More...
 
void flush ()
 Finalize batched operations. More...
 

Private Member Functions

void saveIfBatchFull ()
 

Private Attributes

const RocksDatabaseSettings m_settings
 
RocksPruningFilter m_pruningFilter
 
std::unique_ptr< rocksdb::WriteBatch > m_pWriteBatch
 
std::unique_ptr< rocksdb::DB > m_pDb
 
std::vector< rocksdb::ColumnFamilyHandle * > m_handles
 

Detailed Description

RocksDb-backed database.

Constructor & Destructor Documentation

◆ RocksDatabase() [1/2]

catapult::cache::RocksDatabase::RocksDatabase ( )
default

Creates an empty database.

◆ RocksDatabase() [2/2]

catapult::cache::RocksDatabase::RocksDatabase ( const RocksDatabaseSettings settings)
explicit

Creates database around settings.

Here is the call graph for this function:

◆ ~RocksDatabase()

catapult::cache::RocksDatabase::~RocksDatabase ( )

Destroys database.

Member Function Documentation

◆ canPrune()

bool catapult::cache::RocksDatabase::canPrune ( ) const

Returns true if pruning is enabled.

◆ columnFamilyNames()

const std::vector< std::string > & catapult::cache::RocksDatabase::columnFamilyNames ( ) const

Gets the database column family names.

◆ del()

void catapult::cache::RocksDatabase::del ( size_t  columnId,
const rocksdb::Slice &  key 
)

Deletes key from columnId.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flush()

void catapult::cache::RocksDatabase::flush ( )

Finalize batched operations.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get()

void catapult::cache::RocksDatabase::get ( size_t  columnId,
const rocksdb::Slice &  key,
RdbDataIterator result 
)

Gets key from columnId returning data in result.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prune()

size_t catapult::cache::RocksDatabase::prune ( size_t  columnId,
uint64_t  boundary 
)

Prunes elements from columnId below boundary. Returns number of pruned elements.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ put()

void catapult::cache::RocksDatabase::put ( size_t  columnId,
const rocksdb::Slice &  key,
const std::string &  value 
)

Puts value with key in columnId.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveIfBatchFull()

void catapult::cache::RocksDatabase::saveIfBatchFull ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_handles

std::vector<rocksdb::ColumnFamilyHandle*> catapult::cache::RocksDatabase::m_handles
private

◆ m_pDb

std::unique_ptr<rocksdb::DB> catapult::cache::RocksDatabase::m_pDb
private

◆ m_pruningFilter

RocksPruningFilter catapult::cache::RocksDatabase::m_pruningFilter
private

◆ m_pWriteBatch

std::unique_ptr<rocksdb::WriteBatch> catapult::cache::RocksDatabase::m_pWriteBatch
private

◆ m_settings

const RocksDatabaseSettings catapult::cache::RocksDatabase::m_settings
private

The documentation for this class was generated from the following files: