hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::ametsuchi Namespace Reference

Namespaces

 tx_cache_response_details
 
 tx_cache_status_responses
 The namespace contains concrete result types of transaction cache.
 

Classes

class  BlockIndex
 
class  BlockQuery
 
class  BlockQueryFactory
 
class  BlockStorage
 
class  BlockStorageFactory
 
struct  CommandError
 
class  CommandExecutor
 
struct  ConnectionContext
 
class  FailoverCallback
 
class  FailoverCallbackFactory
 
class  FlatFile
 
class  FlatFileBlockStorage
 
class  FlatFileBlockStorageFactory
 
class  InMemoryBlockStorage
 
class  InMemoryBlockStorageFactory
 
class  KeyValueStorage
 
class  KTimesReconnectionStrategy
 
class  KTimesReconnectionStrategyFactory
 
class  MutableFactory
 
class  MutableStorage
 
class  MutableStorageImpl
 
class  PeerQuery
 
class  PeerQueryFactory
 
class  PeerQueryWsv
 
class  PostgresBlockIndex
 
class  PostgresBlockQuery
 
class  PostgresCommandExecutor
 
class  PostgresOptions
 
class  PostgresQueryExecutor
 
class  PostgresQueryExecutorVisitor
 
class  PostgresWsvCommand
 
class  PostgresWsvQuery
 
class  QueryExecutor
 
class  QueryExecutorFactory
 
class  ReconnectionStrategy
 
class  ReconnectionStrategyFactory
 
class  Storage
 
class  StorageImpl
 
class  TemporaryFactory
 
class  TemporaryWsv
 
class  TemporaryWsvImpl
 
class  TransactionExecutor
 
struct  TxExecutionError
 
class  TxPresenceCache
 
class  TxPresenceCacheImpl
 
class  WsvCommand
 
class  WsvQuery
 
class  WsvRestorer
 
class  WsvRestorerImpl
 

Typedefs

using CommandResult = expected::Result< void, CommandError >
 
using QueryErrorType = shared_model::interface::QueryResponseFactory::ErrorQueryType
 
using ErrorQueryResponse = shared_model::interface::ErrorQueryResponse
 
using QueryErrorMessageType = ErrorQueryResponse::ErrorMessageType
 
using QueryErrorCodeType = ErrorQueryResponse::ErrorCodeType
 
template<std::size_t N, typename T >
using element_t = typename boost::tuples::element< N, T >::type
 tuple element type shortcut More...
 
template<class Tuple1 , class Tuple2 >
using concat = decltype(concat_impl< Tuple1, Tuple2 >(std::make_index_sequence< length_v< std::decay_t< Tuple1 >>>{}, std::make_index_sequence< length_v< std::decay_t< Tuple2 >>>{}))
 tuple with types from two given tuples More...
 
using QueryExecutorResult = std::unique_ptr< shared_model::interface::QueryResponse >
 
using TxCacheStatusType = boost::variant< tx_cache_status_responses::Committed, tx_cache_status_responses::Rejected, tx_cache_status_responses::Missing >
 Sum type of all possible concrete responses from the tx cache. More...
 
using WsvError = std::string
 
using WsvCommandResult = expected::Result< void, WsvError >
 

Functions

static const std::regex e ("\\bdbname=([^ ]*)")
 
template<typename Function >
WsvCommandResult execute (soci::statement &st, Function &&error)
 
template<typename ParamType , typename Function >
void processSoci (soci::statement &st, soci::indicator &ind, ParamType &row, Function f)
 
template<class Tuple1 , class Tuple2 , std::size_t... Is, std::size_t... Js>
auto concat_impl (std::index_sequence< Is... >, std::index_sequence< Js... >) -> boost::tuple< element_t< Is, std::decay_t< Tuple1 >>..., element_t< Js, std::decay_t< Tuple2 >>... >
 index sequence helper for concat More...
 
template<typename F , std::size_t... Is>
decltype(auto) constexpr index_apply_impl (F &&f, std::index_sequence< Is... >)
 index sequence helper for index_apply More...
 
template<size_t N, typename F >
decltype(auto) constexpr index_apply (F &&f)
 apply F to an integer sequence [0, N) More...
 
template<typename Tuple , typename F >
decltype(auto) constexpr apply (Tuple &&t, F &&f)
 apply F to Tuple More...
 
template<typename R , typename T >
constexpr auto viewQuery (T &&t)
 view first length_v<R> elements of T without copying More...
 
template<typename R , typename T >
constexpr auto viewPermissions (T &&t)
 view last length_v<R> elements of T without copying More...
 
template<typename T >
constexpr auto rebind (T &&t)
 map tuple<optional<Ts>...> to optional<tuple<Ts...>> More...
 
template<typename C , typename T , typename F >
auto mapValues (T &t, F &&f)
 
template<typename C , typename T , typename F >
boost::optional< C > flatMapValues (T &t, F &&f)
 
template<typename R , typename T , typename F >
auto flatMapValue (T &t, F &&f)
 
template<typename RollbackFunction >
void initializeConnectionPool (soci::connection_pool &connection_pool, size_t pool_size, const std::string &prepare_tables_sql, RollbackFunction try_rollback, FailoverCallbackFactory &callback_factory, ReconnectionStrategyFactory &reconnection_strategy_factory, const std::string &pg_reconnection_options, logger::LoggerManagerTreePtr log_manager)
 
bool isAlreadyProcessed (const TxCacheStatusType &tx_status) noexcept
 
tx_cache_response_details::HashType getHash (const TxCacheStatusType &status) noexcept
 

Variables

template<typename T >
constexpr std::size_t length_v = boost::tuples::length<T>::value
 tuple length shortcut More...
 
const char * kCommandExecutorError = "Cannot create CommandExecutorFactory"
 
const char * kPsqlBroken = "Connection to PostgreSQL broken: %s"
 
const char * kTmpWsv = "TemporaryWsv"
 

Typedef Documentation

using iroha::ametsuchi::CommandResult = typedef expected::Result<void, CommandError>

If command is successful, we assume changes are made, and do not need anything If something goes wrong, Result will contain Error with additional information

template<class Tuple1 , class Tuple2 >
using iroha::ametsuchi::concat = typedef decltype(concat_impl<Tuple1, Tuple2>( std::make_index_sequence<length_v<std::decay_t<Tuple1>>>{}, std::make_index_sequence<length_v<std::decay_t<Tuple2>>>{}))

tuple with types from two given tuples

template<std::size_t N, typename T >
using iroha::ametsuchi::element_t = typedef typename boost::tuples::element<N, T>::type

tuple element type shortcut

Sum type of all possible concrete responses from the tx cache.

using iroha::ametsuchi::WsvCommandResult = typedef expected::Result<void, WsvError>

If command is successful, we assume changes are made, and do not need anything If something goes wrong, Result will contain WsvError with additional information

using iroha::ametsuchi::WsvError = typedef std::string

Error returned by wsv command. It is a string which contains what action has failed (e.g, "failed to insert role"), and an error which was provided by underlying implementation (e.g, database exception info)

Function Documentation

template<typename Tuple , typename F >
decltype(auto) constexpr iroha::ametsuchi::apply ( Tuple &&  t,
F &&  f 
)

apply F to Tuple

Here is the caller graph for this function:

template<class Tuple1 , class Tuple2 , std::size_t... Is, std::size_t... Js>
auto iroha::ametsuchi::concat_impl ( std::index_sequence< Is... >  ,
std::index_sequence< Js... >   
) -> boost::tuple< element_t< Is, std::decay_t< Tuple1 >>..., element_t< Js, std::decay_t< Tuple2 >>... >

index sequence helper for concat

static const std::regex iroha::ametsuchi::e ( )
static

Here is the caller graph for this function:

template<typename Function >
WsvCommandResult iroha::ametsuchi::execute ( soci::statement &  st,
Function &&  error 
)

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename R , typename T , typename F >
auto iroha::ametsuchi::flatMapValue ( T &  t,
F &&  f 
)

Here is the call graph for this function:

template<typename C , typename T , typename F >
boost::optional<C> iroha::ametsuchi::flatMapValues ( T &  t,
F &&  f 
)

Here is the call graph for this function:

Here is the caller graph for this function:

tx_cache_response_details::HashType iroha::ametsuchi::getHash ( const TxCacheStatusType status)
inlinenoexcept

Retrieve hash from status

Parameters
status- transaction status obtained from cache
Returns
hash of the transaction

Here is the caller graph for this function:

template<size_t N, typename F >
decltype(auto) constexpr iroha::ametsuchi::index_apply ( F &&  f)

apply F to an integer sequence [0, N)

Here is the call graph for this function:

template<typename F , std::size_t... Is>
decltype(auto) constexpr iroha::ametsuchi::index_apply_impl ( F &&  f,
std::index_sequence< Is... >   
)

index sequence helper for index_apply

Here is the caller graph for this function:

template<typename RollbackFunction >
void iroha::ametsuchi::initializeConnectionPool ( soci::connection_pool &  connection_pool,
size_t  pool_size,
const std::string &  prepare_tables_sql,
RollbackFunction  try_rollback,
FailoverCallbackFactory callback_factory,
ReconnectionStrategyFactory reconnection_strategy_factory,
const std::string &  pg_reconnection_options,
logger::LoggerManagerTreePtr  log_manager 
)

Function initializes existing connection pool

Parameters
connection_pool- pool with connections
pool_size- number of connections in pool
prepare_tables_sql- sql code for db initialization
try_rollback- function which performs blocks rollback before initialization
callback_factory- factory for reconnect callbacks
reconnection_strategy_factory- factory which creates strategies for each connection
pg_reconnection_options- parameter of connection startup on reconnect
log_manager- log manager of storage
Template Parameters
RollbackFunction- type of rollback function

lambda contains special actions which should be execute once

lambda contains actions which should be invoked once for each session

Here is the call graph for this function:

Here is the caller graph for this function:

bool iroha::ametsuchi::isAlreadyProcessed ( const TxCacheStatusType tx_status)
inlinenoexcept

Determine if transaction was already processed by its status

Parameters
tx_status- status obtained from transaction cache
Returns
true if transaction was committed or rejected

Here is the caller graph for this function:

template<typename C , typename T , typename F >
auto iroha::ametsuchi::mapValues ( T &  t,
F &&  f 
)

Here is the call graph for this function:

template<typename ParamType , typename Function >
void iroha::ametsuchi::processSoci ( soci::statement &  st,
soci::indicator &  ind,
ParamType &  row,
Function  f 
)
inline
template<typename T >
constexpr auto iroha::ametsuchi::rebind ( T &&  t)

map tuple<optional<Ts>...> to optional<tuple<Ts...>>

Here is the call graph for this function:

template<typename R , typename T >
constexpr auto iroha::ametsuchi::viewPermissions ( T &&  t)

view last length_v<R> elements of T without copying

template<typename R , typename T >
constexpr auto iroha::ametsuchi::viewQuery ( T &&  t)

view first length_v<R> elements of T without copying

Variable Documentation

const char* iroha::ametsuchi::kCommandExecutorError = "Cannot create CommandExecutorFactory"
const char* iroha::ametsuchi::kPsqlBroken = "Connection to PostgreSQL broken: %s"
const char* iroha::ametsuchi::kTmpWsv = "TemporaryWsv"
template<typename T >
constexpr std::size_t iroha::ametsuchi::length_v = boost::tuples::length<T>::value

tuple length shortcut