hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
rocksdb_indexer.hpp
Go to the documentation of this file.
1 
6 #ifndef AMETSUCHI_ROCKSDB_INDEXER_HPP
7 #define AMETSUCHI_ROCKSDB_INDEXER_HPP
8 
9 #include "ametsuchi/indexer.hpp"
10 
11 #include <string>
12 #include <vector>
13 
14 namespace iroha::ametsuchi {
15 
16  struct RocksDBPort;
17  struct RocksDBContext;
18 
19  class RocksDBIndexer final : public Indexer {
20  public:
21  RocksDBIndexer(std::shared_ptr<RocksDBContext> db_context);
22 
23  void committedTxHash(const TxPosition &position,
26  &committed_tx_hash) override;
27 
28  void rejectedTxHash(const TxPosition &position,
31  &rejected_tx_hash) override;
32 
33  void txPositions(
36  boost::optional<shared_model::interface::types::AssetIdType> &&asset_id,
38  TxPosition const &position) override;
39 
41 
42  private:
43  std::shared_ptr<RocksDBContext> db_context_;
44 
46  void txHashStatus(const TxPosition &position,
49  bool is_committed);
50  };
51 
52 } // namespace iroha::ametsuchi
53 
54 #endif // AMETSUCHI_ROCKSDB_INDEXER_HPP
Definition: block_query.hpp:17
Definition: hash.hpp:18
RocksDBIndexer(std::shared_ptr< RocksDBContext > db_context)
Definition: rocksdb_indexer.cpp:17
Definition: result_fwd.hpp:27
void rejectedTxHash(const TxPosition &position, shared_model::interface::types::TimestampType const ts, const shared_model::interface::types::HashType &rejected_tx_hash) override
Store a rejected tx hash.
Definition: rocksdb_indexer.cpp:56
std::string AccountIdType
Type of account id.
Definition: types.hpp:38
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
iroha::expected::Result< void, std::string > flush() override
Definition: rocksdb_indexer.cpp:96
void txPositions(shared_model::interface::types::AccountIdType const &account, shared_model::interface::types::HashType const &hash, boost::optional< shared_model::interface::types::AssetIdType > &&asset_id, shared_model::interface::types::TimestampType const ts, TxPosition const &position) override
Index tx info.
Definition: rocksdb_indexer.cpp:63
Position of a transaction in the ledger.
Definition: indexer.hpp:26
Definition: rocksdb_indexer.hpp:19
Definition: indexer.hpp:21
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:69
void committedTxHash(const TxPosition &position, shared_model::interface::types::TimestampType const ts, const shared_model::interface::types::HashType &committed_tx_hash) override
Store a committed tx hash.
Definition: rocksdb_indexer.cpp:49