#include <external_map.hpp>
Public Types | |
typedef cmph_map< T > | base_type |
typedef base_type::key_type | key_type |
typedef base_type::value_type | value_type |
typedef base_type::checksum_type | checksum_type |
Public Member Functions | |
~external_map () | |
bool | find (const key_type &key, value_type &value) |
Static Public Member Functions | |
static external_map * | open (const bfs::path &idx_file) |
Private Types | |
typedef value::pair < checksum_type, value_type > | entry_type |
typedef value::value_traits < entry_type > | entry_traits |
Private Member Functions | |
external_map () | |
external_map (const bfs::path &mph_file, const bfs::path &dat_file) | |
Private Attributes | |
FILE * | data_ |
This class implements a hash table with a minimal perfect hash function for addressing buckets. The hash function itself is hold in memory, whereas the table data is stored on disk. Together with the wrapper class big_hash_map this makes it possible to build very large hash maps with millions of keys. Note that this class is designed to build hash maps completely in memory as required by the CMPH library. Also filling the hash table happens in memory, because writing value to disk randomly takes too much time due to seek operations. The class big_hash_map applies a hierarchical approach on very large key sets that cannot be constructed in memory. It first subdivides the key set to smaller key sets and builds a hash map for each of these sets. Although this construction schema is a build-in feature of the CMPH library it turns out that the BRZ algorithm is much more memory consuming.
Definition at line 43 of file external_map.hpp.
typedef cmph_map<T> aitools::bighashmap::core::external_map< T >::base_type |
Definition at line 47 of file external_map.hpp.
typedef base_type::checksum_type aitools::bighashmap::core::external_map< T >::checksum_type |
Reimplemented from aitools::bighashmap::core::cmph_map< T >.
Definition at line 50 of file external_map.hpp.
typedef value::value_traits<entry_type> aitools::bighashmap::core::external_map< T >::entry_traits [private] |
Definition at line 55 of file external_map.hpp.
typedef value::pair<checksum_type, value_type> aitools::bighashmap::core::external_map< T >::entry_type [private] |
Definition at line 54 of file external_map.hpp.
typedef base_type::key_type aitools::bighashmap::core::external_map< T >::key_type |
Reimplemented from aitools::bighashmap::core::cmph_map< T >.
Definition at line 48 of file external_map.hpp.
typedef base_type::value_type aitools::bighashmap::core::external_map< T >::value_type |
Reimplemented from aitools::bighashmap::core::cmph_map< T >.
Definition at line 49 of file external_map.hpp.
aitools::bighashmap::core::external_map< T >::external_map | ( | ) | [inline, private] |
Definition at line 59 of file external_map.hpp.
Referenced by aitools::bighashmap::core::external_map< T >::open().
aitools::bighashmap::core::external_map< T >::external_map | ( | const bfs::path & | mph_file, | |
const bfs::path & | dat_file | |||
) | [inline, private] |
Definition at line 62 of file external_map.hpp.
References aitools::bighashmap::core::external_map< T >::data_, and aitools::util::fopen().
aitools::bighashmap::core::external_map< T >::~external_map | ( | ) | [inline] |
Definition at line 70 of file external_map.hpp.
References aitools::bighashmap::core::external_map< T >::data_, and aitools::util::fclose().
bool aitools::bighashmap::core::external_map< T >::find | ( | const key_type & | key, | |
value_type & | value | |||
) | [inline, virtual] |
Implements aitools::bighashmap::core::cmph_map< T >.
Definition at line 96 of file external_map.hpp.
References aitools::bighashmap::core::external_map< T >::data_, aitools::value::pair< T1, T2 >::e1(), aitools::value::pair< T1, T2 >::e2(), aitools::util::fseek(), aitools::bighashmap::core::cmph_map< T >::hash(), aitools::util::log_debug(), aitools::util::log_error(), aitools::value::value_traits< T >::read_from(), aitools::value::value_traits< T >::size_of(), and aitools::util::throw_runtime_error().
static external_map* aitools::bighashmap::core::external_map< T >::open | ( | const bfs::path & | idx_file | ) | [inline, static] |
Definition at line 78 of file external_map.hpp.
References aitools::bighashmap::core::external_map< T >::external_map(), and aitools::util::throw_runtime_error().
FILE* aitools::bighashmap::core::external_map< T >::data_ [private] |
Definition at line 131 of file external_map.hpp.
Referenced by aitools::bighashmap::core::external_map< T >::external_map(), aitools::bighashmap::core::external_map< T >::find(), and aitools::bighashmap::core::external_map< T >::~external_map().