#include "storage_impl.hpp"
Public Member Functions | |
expected::Result< std::unique_ptr< TemporaryWsv >, std::string > | createTemporaryWsv () override |
expected::Result< std::unique_ptr< MutableStorage >, std::string > | createMutableStorage () override |
boost::optional< std::shared_ptr< PeerQuery > > | createPeerQuery () const override |
boost::optional< std::shared_ptr< BlockQuery > > | createBlockQuery () const override |
boost::optional< std::shared_ptr< QueryExecutor > > | createQueryExecutor (std::shared_ptr< PendingTransactionStorage > pending_txs_storage, std::shared_ptr< shared_model::interface::QueryResponseFactory > response_factory) const override |
bool | insertBlock (const shared_model::interface::Block &block) override |
bool | insertBlocks (const std::vector< std::shared_ptr< shared_model::interface::Block >> &blocks) override |
void | reset () override |
void | dropStorage () override |
void | freeConnections () override |
boost::optional< std::unique_ptr< LedgerState > > | commit (std::unique_ptr< MutableStorage > mutableStorage) override |
boost::optional< std::unique_ptr< LedgerState > > | commitPrepared (const shared_model::interface::Block &block) override |
std::shared_ptr< WsvQuery > | getWsvQuery () const override |
std::shared_ptr< BlockQuery > | getBlockQuery () const override |
rxcpp::observable< std::shared_ptr< shared_model::interface::Block > > | on_commit () override |
void | prepareBlock (std::unique_ptr< TemporaryWsv > wsv) override |
~StorageImpl () override | |
![]() | |
virtual | ~Storage ()=default |
![]() | |
virtual | ~TemporaryFactory ()=default |
![]() | |
virtual | ~MutableFactory ()=default |
![]() | |
virtual | ~PeerQueryFactory ()=default |
![]() | |
virtual | ~BlockQueryFactory ()=default |
![]() | |
virtual | ~QueryExecutorFactory ()=default |
Static Public Member Functions | |
static expected::Result< std::shared_ptr< StorageImpl >, std::string > | create (std::string block_store_dir, std::string postgres_connection, std::shared_ptr< shared_model::interface::CommonObjectsFactory > factory, std::shared_ptr< shared_model::interface::BlockJsonConverter > converter, std::shared_ptr< shared_model::interface::PermissionToString > perm_converter, size_t pool_size=10) |
Protected Member Functions | |
StorageImpl (std::string block_store_dir, PostgresOptions postgres_options, std::unique_ptr< KeyValueStorage > block_store, std::shared_ptr< soci::connection_pool > connection, std::shared_ptr< shared_model::interface::CommonObjectsFactory > factory, std::shared_ptr< shared_model::interface::BlockJsonConverter > converter, std::shared_ptr< shared_model::interface::PermissionToString > perm_converter, size_t pool_size, bool enable_prepared_blocks, logger::Logger log=logger::log("StorageImpl")) | |
Static Protected Member Functions | |
static expected::Result< bool, std::string > | createDatabaseIfNotExist (const std::string &dbname, const std::string &options_str_without_dbname) |
static expected::Result< ConnectionContext, std::string > | initConnections (std::string block_store_dir) |
static expected::Result< std::shared_ptr< soci::connection_pool >, std::string > | initPostgresConnection (std::string &options_str, size_t pool_size) |
Protected Attributes | |
const std::string | block_store_dir_ |
const PostgresOptions | postgres_options_ |
Static Protected Attributes | |
static const std::string & | drop_ |
static const std::string & | reset_ |
static const std::string & | init_ |
|
override |
|
protected |
|
overridevirtual |
Commit mutable storage to Ametsuchi. This transforms Ametsuchi to the new state consistent with MutableStorage.
mutableStorage |
Implements iroha::ametsuchi::MutableFactory.
|
overridevirtual |
Try to apply prepared block to Ametsuchi.
Implements iroha::ametsuchi::MutableFactory.
|
static |
|
overridevirtual |
Creates a block query from the current state.
Implements iroha::ametsuchi::BlockQueryFactory.
|
staticprotected |
|
overridevirtual |
Creates a mutable storage from the current state. Mutable storage is the only way to commit the block to the ledger.
Implements iroha::ametsuchi::MutableFactory.
|
overridevirtual |
Creates a peer query from the current state.
Implements iroha::ametsuchi::PeerQueryFactory.
|
overridevirtual |
Creates a query executor from the current state
Implements iroha::ametsuchi::QueryExecutorFactory.
|
overridevirtual |
Creates a temporary world state view from the current state. Temporary state will be not committed and will be erased on destructor call. Temporary state might be used for transaction validation.
Implements iroha::ametsuchi::TemporaryFactory.
|
overridevirtual |
Remove all information from ledger Tables and the database will be removed too
Implements iroha::ametsuchi::Storage.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
staticprotected |
|
staticprotected |
|
overridevirtual |
Insert block without validation
blocks | - block for insertion |
Implements iroha::ametsuchi::Storage.
|
overridevirtual |
Insert blocks without validation
blocks | - collection of blocks for insertion |
Implements iroha::ametsuchi::Storage.
|
overridevirtual |
method called when block is written to the storage
Implements iroha::ametsuchi::Storage.
|
overridevirtual |
Prepare state which was accumulated in temporary WSV. After preparation, this state is not visible until commited.
wsv | - state which will be prepared. |
Implements iroha::ametsuchi::TemporaryFactory.
|
overridevirtual |
Remove all records from the tables and remove all the blocks
Implements iroha::ametsuchi::Storage.
|
protected |
Folder with raw blocks
|
staticprotected |
|
staticprotected |
|
protected |
|
staticprotected |