Kagome
Polkadot Runtime Engine in C++17
|
#include <trie_storage_provider_impl.hpp>
Public Types | |
enum | Error { Error::NO_BATCH = 1 } |
Public Types inherited from kagome::runtime::TrieStorageProvider | |
using | Batch = storage::trie::TrieBatch |
using | PersistentBatch = storage::trie::PersistentTrieBatch |
Public Member Functions | |
TrieStorageProviderImpl (std::shared_ptr< storage::trie::TrieStorage > trie_storage, std::shared_ptr< storage::trie::TrieSerializer > trie_serializer) | |
~TrieStorageProviderImpl () override=default | |
outcome::result< void > | setToEphemeralAt (const common::Hash256 &state_root) override |
outcome::result< void > | setToPersistentAt (const common::Hash256 &state_root) override |
std::shared_ptr< Batch > | getCurrentBatch () const override |
std::optional< std::shared_ptr< PersistentBatch > > | tryGetPersistentBatch () const override |
bool | isCurrentlyPersistent () const override |
outcome::result< std::shared_ptr< PersistentBatch > > | getChildBatchAt (const common::Buffer &root_path) override |
Get (or create new) Child Batch with given root hash. More... | |
outcome::result< storage::trie::RootHash > | forceCommit () override |
outcome::result< void > | startTransaction () override |
Start nested transaction. More... | |
outcome::result< void > | rollbackTransaction () override |
Rollback and finish last started transaction. More... | |
outcome::result< void > | commitTransaction () override |
Commit and finish last started transaction. More... | |
void | clearChildBatches () noexceptoverride |
Public Member Functions inherited from kagome::runtime::TrieStorageProvider | |
virtual | ~TrieStorageProvider ()=default |
Private Attributes | |
std::shared_ptr< storage::trie::TrieStorage > | trie_storage_ |
std::shared_ptr< storage::trie::TrieSerializer > | trie_serializer_ |
std::stack< std::shared_ptr< Batch > > | stack_of_batches_ |
std::shared_ptr< Batch > | current_batch_ |
std::shared_ptr< PersistentBatch > | persistent_batch_ |
std::unordered_map< common::Buffer, std::shared_ptr< PersistentBatch > > | child_batches_ |
log::Logger | logger_ |
Definition at line 22 of file trie_storage_provider_impl.hpp.
|
strong |
Enumerator | |
---|---|
NO_BATCH |
Definition at line 24 of file trie_storage_provider_impl.hpp.
|
explicit |
Definition at line 29 of file trie_storage_provider_impl.cpp.
|
overridedefault |
|
overridevirtualnoexcept |
Clear internal map of child storages batches
Implements kagome::runtime::TrieStorageProvider.
Definition at line 97 of file trie_storage_provider_impl.cpp.
|
overridevirtual |
Commit and finish last started transaction.
Implements kagome::runtime::TrieStorageProvider.
Definition at line 141 of file trie_storage_provider_impl.cpp.
|
overridevirtual |
Commits persistent changes even if the current batch is not persistent
Implements kagome::runtime::TrieStorageProvider.
Definition at line 102 of file trie_storage_provider_impl.cpp.
|
overridevirtual |
Get (or create new) Child Batch with given root hash.
root | root hash value of a new (or cached) batch |
Implements kagome::runtime::TrieStorageProvider.
Definition at line 76 of file trie_storage_provider_impl.cpp.
|
overridevirtual |
Implements kagome::runtime::TrieStorageProvider.
Definition at line 60 of file trie_storage_provider_impl.cpp.
|
overridevirtual |
Implements kagome::runtime::TrieStorageProvider.
Definition at line 70 of file trie_storage_provider_impl.cpp.
|
overridevirtual |
Rollback and finish last started transaction.
Implements kagome::runtime::TrieStorageProvider.
Definition at line 128 of file trie_storage_provider_impl.cpp.
|
overridevirtual |
Sets the current batch to a new ephemeral batch
Implements kagome::runtime::TrieStorageProvider.
Definition at line 38 of file trie_storage_provider_impl.cpp.
|
overridevirtual |
Sets the current batch to a new persistent batch at specified storage state
Implements kagome::runtime::TrieStorageProvider.
Definition at line 48 of file trie_storage_provider_impl.cpp.
|
overridevirtual |
Start nested transaction.
Implements kagome::runtime::TrieStorageProvider.
Definition at line 118 of file trie_storage_provider_impl.cpp.
|
overridevirtual |
Implements kagome::runtime::TrieStorageProvider.
Definition at line 65 of file trie_storage_provider_impl.cpp.
|
private |
Definition at line 69 of file trie_storage_provider_impl.hpp.
|
private |
Definition at line 62 of file trie_storage_provider_impl.hpp.
|
private |
Definition at line 71 of file trie_storage_provider_impl.hpp.
|
private |
Definition at line 66 of file trie_storage_provider_impl.hpp.
|
private |
Definition at line 60 of file trie_storage_provider_impl.hpp.
|
private |
Definition at line 58 of file trie_storage_provider_impl.hpp.
|
private |
Definition at line 57 of file trie_storage_provider_impl.hpp.