CernVM-FS
2.12.0
|
#include <smallhash.h>
Public Member Functions | |
MultiHash () | |
void | Init (const uint8_t num_hashmaps, const Key &empty_key, uint32_t(*hasher)(const Key &key)) |
~MultiHash () | |
bool | Lookup (const Key &key, Value *value) |
void | Insert (const Key &key, const Value &value) |
void | Erase (const Key &key) |
void | Clear () |
uint8_t | num_hashmaps () const |
void | GetSizes (uint32_t *sizes) |
void | GetCollisionStats (uint64_t *num_collisions, uint32_t *max_collisions) |
Private Member Functions | |
uint8_t | SelectHashmap (const Key &key) |
void | Lock (const uint8_t target) |
void | Unlock (const uint8_t target) |
Private Attributes | |
uint8_t | num_hashmaps_ |
SmallHashDynamic< Key, Value > * | hashmaps_ |
pthread_mutex_t * | locks_ |
Distributes the key-value pairs over $n$ dynamic hash maps with individual mutexes. Hence low mutex contention, and benefits from multiple processors.
Definition at line 406 of file smallhash.h.
Definition at line 408 of file smallhash.h.
Definition at line 430 of file smallhash.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
Definition at line 496 of file smallhash.h.
Referenced by MultiHash< Key, Value >::Clear(), MultiHash< Key, Value >::Erase(), MultiHash< Key, Value >::GetCollisionStats(), MultiHash< Key, Value >::GetSizes(), MultiHash< Key, Value >::Insert(), and MultiHash< Key, Value >::Lookup().
|
inline |
|
inline |
Definition at line 469 of file smallhash.h.
Referenced by MultiHash< Key, Value >::Init().
|
inlineprivate |
Definition at line 488 of file smallhash.h.
Referenced by MultiHash< Key, Value >::Erase(), MultiHash< Key, Value >::Insert(), and MultiHash< Key, Value >::Lookup().
|
inlineprivate |
Definition at line 501 of file smallhash.h.
Referenced by MultiHash< Key, Value >::Clear(), MultiHash< Key, Value >::Erase(), MultiHash< Key, Value >::GetCollisionStats(), MultiHash< Key, Value >::GetSizes(), MultiHash< Key, Value >::Insert(), and MultiHash< Key, Value >::Lookup().
|
private |
Definition at line 507 of file smallhash.h.
Referenced by MultiHash< Key, Value >::Clear(), MultiHash< Key, Value >::Erase(), MultiHash< Key, Value >::GetCollisionStats(), MultiHash< Key, Value >::GetSizes(), MultiHash< Key, Value >::Init(), MultiHash< Key, Value >::Insert(), MultiHash< Key, Value >::Lookup(), MultiHash< Key, Value >::MultiHash(), and MultiHash< Key, Value >::~MultiHash().
|
private |
Definition at line 508 of file smallhash.h.
Referenced by MultiHash< Key, Value >::Init(), MultiHash< Key, Value >::Lock(), MultiHash< Key, Value >::MultiHash(), MultiHash< Key, Value >::Unlock(), and MultiHash< Key, Value >::~MultiHash().
|
private |
Definition at line 506 of file smallhash.h.
Referenced by MultiHash< Key, Value >::Clear(), MultiHash< Key, Value >::GetCollisionStats(), MultiHash< Key, Value >::GetSizes(), MultiHash< Key, Value >::Init(), MultiHash< Key, Value >::MultiHash(), MultiHash< Key, Value >::num_hashmaps(), MultiHash< Key, Value >::SelectHashmap(), and MultiHash< Key, Value >::~MultiHash().