pub struct CuckooTableOptions { /* private fields */ }Expand description
Configuration of cuckoo-based storage.
Implementations§
Source§impl CuckooTableOptions
impl CuckooTableOptions
Sourcepub fn set_hash_ratio(&mut self, ratio: f64)
pub fn set_hash_ratio(&mut self, ratio: f64)
Determines the utilization of hash tables. Smaller values result in larger hash tables with fewer collisions. Default: 0.9
Sourcepub fn set_max_search_depth(&mut self, depth: u32)
pub fn set_max_search_depth(&mut self, depth: u32)
A property used by builder to determine the depth to go to to search for a path to displace elements in case of collision. See Builder.MakeSpaceForKey method. Higher values result in more efficient hash tables with fewer lookups but take more time to build. Default: 100
Sourcepub fn set_cuckoo_block_size(&mut self, size: u32)
pub fn set_cuckoo_block_size(&mut self, size: u32)
In case of collision while inserting, the builder attempts to insert in the next cuckoo_block_size locations before skipping over to the next Cuckoo hash function. This makes lookups more cache friendly in case of collisions. Default: 5
Sourcepub fn set_identity_as_first_hash(&mut self, flag: bool)
pub fn set_identity_as_first_hash(&mut self, flag: bool)
If this option is enabled, user key is treated as uint64_t and its value is used as hash value directly. This option changes builder’s behavior. Reader ignore this option and behave according to what specified in table property. Default: false
Sourcepub fn set_use_module_hash(&mut self, flag: bool)
pub fn set_use_module_hash(&mut self, flag: bool)
If this option is set to true, module is used during hash calculation. This often yields better space efficiency at the cost of performance. If this option is set to false, # of entries in table is constrained to be power of two, and bit and is used to calculate hash, which is faster in general. Default: true
Sourcepub fn get_cuckoo_block_size(&self) -> u32
pub fn get_cuckoo_block_size(&self) -> u32
In case of collision while inserting, the builder attempts to insert in the next cuckoo_block_size locations before skipping over to the next Cuckoo hash function. This makes lookups more cache friendly in case of collisions.
Sourcepub fn set_hash_table_ratio(&mut self, val: f64)
pub fn set_hash_table_ratio(&mut self, val: f64)
@hash_table_ratio: the desired utilization of the hash table used for prefix hashing. hash_table_ratio = number of prefixes / #buckets in the hash table
Sourcepub fn get_hash_table_ratio(&self) -> f64
pub fn get_hash_table_ratio(&self) -> f64
Returns the value of the hash_table_ratio option.
Sourcepub fn get_identity_as_first_hash(&self) -> bool
pub fn get_identity_as_first_hash(&self) -> bool
If this option is enabled, user key is treated as uint64_t and its value is used as hash value directly. This option changes builder’s behavior. Reader ignore this option and behave according to what specified in table property.
Sourcepub fn get_max_search_depth(&self) -> u32
pub fn get_max_search_depth(&self) -> u32
A property used by builder to determine the depth to go to to search for a path to displace elements in case of collision. See Builder.MakeSpaceForKey method. Higher values result in more efficient hash tables with fewer lookups but take more time to build.
Sourcepub fn get_use_module_hash(&self) -> bool
pub fn get_use_module_hash(&self) -> bool
If this option is set to true, module is used during hash calculation. This often yields better space efficiency at the cost of performance. If this option is set to false, # of entries in table is constrained to be power of two, and bit and is used to calculate hash, which is faster in general.