#include "flat_file.hpp"


Public Types | |
| using | BlockIdCollectionType = std::set< Identifier > |
Public Types inherited from iroha::ametsuchi::KeyValueStorage | |
| using | Identifier = uint32_t |
| using | Bytes = std::vector< uint8_t > |
Public Member Functions | |
| bool | add (Identifier id, const Bytes &blob) override |
| boost::optional< Bytes > | get (Identifier id) const override |
| std::string | directory () const override |
| Identifier | last_id () const override |
| void | dropAll () override |
| const BlockIdCollectionType & | blockIdentifiers () const |
| FlatFile (const FlatFile &rhs)=delete | |
| FlatFile (FlatFile &&rhs)=delete | |
| FlatFile & | operator= (const FlatFile &rhs)=delete |
| FlatFile & | operator= (FlatFile &&rhs)=delete |
| FlatFile (std::string path, BlockIdCollectionType existing_files, FlatFile::private_tag, logger::LoggerPtr log) | |
| ~FlatFile ()=default | |
Public Member Functions inherited from iroha::ametsuchi::KeyValueStorage | |
| virtual | ~KeyValueStorage ()=default |
Static Public Member Functions | |
| static std::string | id_to_name (Identifier id) |
| static boost::optional< Identifier > | name_to_id (const std::string &name) |
| static boost::optional< std::unique_ptr< FlatFile > > | create (const std::string &path, logger::LoggerPtr log) |
Static Public Attributes | |
| static const uint32_t | DIGIT_CAPACITY = 16 |
Solid storage based on raw files
| using iroha::ametsuchi::FlatFile::BlockIdCollectionType = std::set<Identifier> |
|
delete |
|
delete |
| FlatFile::FlatFile | ( | std::string | path, |
| BlockIdCollectionType | existing_files, | ||
| FlatFile::private_tag | , | ||
| logger::LoggerPtr | log | ||
| ) |
Create storage in path
| path | - folder of storage |
| existing_files | - collection of existing files names |
| log | to print progress |
|
default |
|
overridevirtual |
Add entity with binary data
| id | - reference key |
| blob | - data associated with key |
Implements iroha::ametsuchi::KeyValueStorage.

| const BlockIdCollectionType & FlatFile::blockIdentifiers | ( | ) | const |
|
static |
Create storage in paths
| path | - target path for creating |
| log | - logger |


|
overridevirtual |
Implements iroha::ametsuchi::KeyValueStorage.
|
overridevirtual |
|
overridevirtual |
Get data associated with
| id | - reference key |
Implements iroha::ametsuchi::KeyValueStorage.

|
static |
Convert id to a string representation. The string representation is always DIGIT_CAPACITY-character width regardless of the value of id. If the length of the string representation of id is less than DIGIT_CAPACITY, then the returned value is filled with leading zeros.
For example, if str_rep(id) is "123", then the returned value is "0000000000000123".
| id | - for conversion |

|
overridevirtual |
Implements iroha::ametsuchi::KeyValueStorage.
|
static |
Converts aligned string (see above) to number.
| name | - name to convert |

|
static |