libfoedus-core
FOEDUS Core Library
|
Metadata of an hash storage. More...
Metadata of an hash storage.
Definition at line 40 of file hash_metadata.hpp.
#include <hash_metadata.hpp>
Public Member Functions | |
HashMetadata () | |
HashMetadata (StorageId id, const StorageName &name, uint8_t bin_bits) | |
HashMetadata (const StorageName &name, uint8_t bin_bits=kHashMinBinBits) | |
This one is for newly creating a storage. More... | |
void | set_capacity (uint64_t expected_records, double preferred_records_per_bin=5.0) |
Use this method to set an appropriate value for bin_bits_. More... | |
uint64_t | get_bin_count () const |
Number of bins in this hash storage. More... | |
uint8_t | get_bin_shifts () const |
HashBin | extract_bin (HashValue hash) const |
std::string | describe () const |
![]() | |
Metadata () | |
Metadata (StorageId id, StorageType type, const StorageName &name) | |
Metadata (StorageId id, StorageType type, const StorageName &name, SnapshotPagePointer root_snapshot_page_id) | |
bool | keeps_all_volatile_pages () const |
Public Attributes | |
uint8_t | bin_bits_ |
Number of bins in exponent of two. More... | |
uint8_t | pad1_ |
uint16_t | pad2_ |
uint32_t | pad3_ |
![]() | |
StorageId | id_ |
the unique ID of this storage. More... | |
StorageType | type_ |
type of the storage. More... | |
StorageName | name_ |
the unique name of this storage. More... | |
SnapshotPagePointer | root_snapshot_page_id_ |
Pointer to a snapshotted page this storage is rooted at. More... | |
SnapshotThresholds | snapshot_thresholds_ |
Friends | |
std::ostream & | operator<< (std::ostream &o, const HashMetadata &v) |
Additional Inherited Members | |
![]() | |
static std::string | describe (const Metadata &metadata) |
to_string operator of all Metadata objects. More... | |
|
inline |
Definition at line 41 of file hash_metadata.hpp.
|
inline |
Definition at line 43 of file hash_metadata.hpp.
|
inline |
This one is for newly creating a storage.
Definition at line 47 of file hash_metadata.hpp.
std::string foedus::storage::hash::HashMetadata::describe | ( | ) | const |
Definition at line 29 of file hash_metadata.cpp.
Definition at line 65 of file hash_metadata.hpp.
References get_bin_shifts().
|
inline |
Number of bins in this hash storage.
Always power of two.
Definition at line 62 of file hash_metadata.hpp.
References bin_bits_.
Referenced by foedus::storage::hash::HashStoragePimpl::create(), and foedus::storage::hash::HashStoragePimpl::get_bin_count().
|
inline |
Definition at line 64 of file hash_metadata.hpp.
References bin_bits_.
Referenced by extract_bin(), foedus::storage::hash::HashStoragePimpl::get_bin_shifts(), and foedus::storage::hash::HashCombo::HashCombo().
void foedus::storage::hash::HashMetadata::set_capacity | ( | uint64_t | expected_records, |
double | preferred_records_per_bin = 5.0 |
||
) |
Use this method to set an appropriate value for bin_bits_.
[in] | expected_records | how many records do you expect to store in this storage |
[in] | preferred_records_per_bin | average records per a hash bin. 5-30 are recommended. If this number is too large, many bins have a linked-list rather than just one page. |
Definition at line 51 of file hash_metadata.cpp.
References ASSERT_ND, bin_bits_, foedus::storage::hash::kHashMaxBinBits, and foedus::storage::hash::kHashMinBinBits.
|
friend |
Definition at line 34 of file hash_metadata.cpp.
uint8_t foedus::storage::hash::HashMetadata::bin_bits_ |
Number of bins in exponent of two.
Recommended to use set_capacity() to set this value.
Definition at line 75 of file hash_metadata.hpp.
Referenced by foedus::storage::hash::HashStoragePimpl::get_bin_bits(), get_bin_count(), get_bin_shifts(), foedus::storage::hash::HashMetadataSerializer::load(), foedus::storage::hash::operator<<(), foedus::storage::hash::HashMetadataSerializer::save(), and set_capacity().
uint8_t foedus::storage::hash::HashMetadata::pad1_ |
Definition at line 78 of file hash_metadata.hpp.
uint16_t foedus::storage::hash::HashMetadata::pad2_ |
Definition at line 79 of file hash_metadata.hpp.
uint32_t foedus::storage::hash::HashMetadata::pad3_ |
Definition at line 80 of file hash_metadata.hpp.