Skip to main content

CuckooTableOptions

Struct CuckooTableOptions 

Source
pub struct CuckooTableOptions { /* private fields */ }
Expand description

Configuration of cuckoo-based storage.

Implementations§

Source§

impl CuckooTableOptions

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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.

Source

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

Source

pub fn get_hash_table_ratio(&self) -> f64

Returns the value of the hash_table_ratio option.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Default for CuckooTableOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for CuckooTableOptions

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for CuckooTableOptions

Source§

impl Sync for CuckooTableOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.