Kagome
Polkadot Runtime Engine in C++17
|
#include <rocksdb.hpp>
Classes | |
class | Batch |
Public Member Functions | |
~RocksDB () override | |
std::unique_ptr< BufferBatch > | batch () override |
Creates new Write Batch - an object, which can be used to efficiently write bulk data. More... | |
size_t | size () const override |
std::unique_ptr< Cursor > | cursor () override |
Returns new key-value iterator. More... | |
outcome::result< bool > | contains (const Key &key) const override |
Checks if given key-value binding exists in the storage. More... | |
bool | empty () const override |
Returns true if the storage is empty. More... | |
outcome::result< kagome::storage::Buffer > | load (const Key &key) const override |
Load value by key. More... | |
outcome::result< std::optional< Buffer > > | tryLoad (const Key &key) const override |
Load value by key. More... | |
outcome::result< void > | put (const BufferView &key, const Buffer &value) override |
outcome::result< void > | put (const BufferView &key, Buffer &&value) override |
outcome::result< void > | remove (const BufferView &key) override |
void | compact (const Buffer &first, const Buffer &last) |
Public Member Functions inherited from kagome::storage::face::Iterable< K, V, KView > | |
virtual | ~Iterable ()=default |
Public Member Functions inherited from kagome::storage::face::ReadableStorage< KView, V > | |
virtual | ~ReadableStorage ()=default |
Public Member Functions inherited from kagome::storage::face::ReadableBase< KView > | |
virtual | ~ReadableBase ()=default |
Public Member Functions inherited from kagome::storage::face::Writeable< KView, V > | |
virtual | ~Writeable ()=default |
virtual outcome::result< void > | put (const KView &key, const V &value)=0 |
Store value by key. More... | |
virtual outcome::result< void > | put (const KView &key, V &&value)=0 |
virtual outcome::result< void > | remove (const KView &key)=0 |
Remove value by key. More... | |
Public Member Functions inherited from kagome::storage::face::BatchWriteable< KView, V > | |
virtual | ~BatchWriteable ()=default |
Static Public Member Functions | |
static outcome::result< std::unique_ptr< RocksDB > > | create (const boost::filesystem::path &path, rocksdb::Options options=rocksdb::Options(), bool prevent_destruction=false) |
Factory method to create an instance of RocksDB class. More... | |
Private Member Functions | |
RocksDB (bool prevent_destruction) | |
Private Attributes | |
bool | prevent_destruction_ = false |
std::unique_ptr< rocksdb::DB > | db_ |
rocksdb::ReadOptions | ro_ |
rocksdb::WriteOptions | wo_ |
log::Logger | logger_ |
Additional Inherited Members | |
Public Types inherited from kagome::storage::face::Iterable< K, V, KView > | |
using | Cursor = MapCursor< K, V, KView > |
Public Types inherited from kagome::storage::face::ReadableStorage< KView, V > | |
using | Key = KView |
using | Value = V |
Public Types inherited from kagome::storage::face::ReadableBase< KView > | |
using | Key = KView |
Definition at line 17 of file rocksdb.hpp.
|
override |
Definition at line 24 of file rocksdb.cpp.
|
private |
Definition at line 19 of file rocksdb.cpp.
|
overridevirtual |
Creates new Write Batch - an object, which can be used to efficiently write bulk data.
Implements kagome::storage::face::BatchWriteable< KView, V >.
Definition at line 79 of file rocksdb.cpp.
Definition at line 179 of file rocksdb.cpp.
|
overridevirtual |
Checks if given key-value binding exists in the storage.
key | K |
Implements kagome::storage::face::ReadableBase< KView >.
Definition at line 106 of file rocksdb.cpp.
|
static |
Factory method to create an instance of RocksDB class.
path | filesystem path where database is going to be |
options | rocksdb options, such as caching, logging, etc. |
prevent_destruction | - avoid destruction of underlying db if true |
Definition at line 37 of file rocksdb.cpp.
|
overridevirtual |
Returns new key-value iterator.
Implements kagome::storage::face::Iterable< K, V, KView >.
Definition at line 101 of file rocksdb.cpp.
|
overridevirtual |
Returns true if the storage is empty.
Implements kagome::storage::face::ReadableBase< KView >.
Definition at line 120 of file rocksdb.cpp.
Load value by key.
key | K |
Implements kagome::storage::face::ReadableStorage< KView, V >.
Definition at line 126 of file rocksdb.cpp.
|
override |
Definition at line 155 of file rocksdb.cpp.
|
override |
Definition at line 165 of file rocksdb.cpp.
|
override |
Definition at line 170 of file rocksdb.cpp.
|
overridevirtual |
Reports RAM state size
Implements kagome::storage::face::GenericStorage< K, V, KView >.
Definition at line 83 of file rocksdb.cpp.
|
overridevirtual |
Load value by key.
key | K |
Implements kagome::storage::face::ReadableStorage< KView, V >.
Definition at line 138 of file rocksdb.cpp.
|
private |
Definition at line 65 of file rocksdb.hpp.
|
private |
Definition at line 68 of file rocksdb.hpp.
|
private |
Definition at line 63 of file rocksdb.hpp.
|
private |
Definition at line 66 of file rocksdb.hpp.
|
private |
Definition at line 67 of file rocksdb.hpp.