27 #ifndef OPIC_HASH_PASCAL_ROBIN_HOOD_HASH 28 #define OPIC_HASH_PASCAL_ROBIN_HOOD_HASH 1 31 #include "opic/common/op_macros.h" 62 size_t key_inline_size,
size_t valsize);
96 void* key,
size_t keysize,
void* val);
119 void* key,
size_t keysize,
void** val_ref,
138 void* key,
size_t keysize);
154 void* key,
size_t keysize);
203 void** val_ref,
bool* is_duplicate)
206 val_ref, is_duplicate);
Memory allocator object with persistent storage on disk.
void PHPrintStat(PascalHashTable *rhh)
Prints the accumulated count for each probing number.
static void * PHDelete(PascalHashTable *rhh, void *key, size_t keysize)
Deletes the key-value entry using default hash function.
void * PHGetCustom(PascalHashTable *rhh, OPHash hasher, void *key, size_t keysize)
Obtain the value associated with the key and hash function. Returns NULL if the key was not found...
uint64_t PHCapacity(PascalHashTable *rhh)
Obtain the number of objects can be stored in this hash table.
PascalHashTable * PHNew(OPHeap *heap, uint64_t num_objects, double load, size_t key_inline_size, size_t valsize)
Constructor for PascalHashTable.
void PHDestroy(PascalHashTable *rhh)
Destructor for PascalHashTable.
size_t PHValSize(PascalHashTable *rhh)
Obtain the size of the value configured for this hash table.
An opaque object that manages associations of key-value pairs.
void * PHDeleteCustom(PascalHashTable *rhh, OPHash hasher, void *key, size_t keysize)
Deletes the key-value entry with specified hash function.
uint64_t PHObjcnt(PascalHashTable *rhh)
Obtain the number of objects stored in this hash table.
bool PHInsertCustom(PascalHashTable *rhh, OPHash hasher, void *key, size_t keysize, void *val)
Associates the specified key and value with custom hash function.
static uint64_t OPDefaultHash(void *key, size_t size)
Default hash function.
bool PHUpsertCustom(PascalHashTable *rhh, OPHash hasher, void *key, size_t keysize, void **val_ref, bool *is_duplicate)
Update or insert depends on whether the key already exists in the hash table using custom hash functi...
void PHIterate(PascalHashTable *rhh, OPHashIterator iterator, void *context)
Iterates over all key-value pairs in this hash table with user specified context. ...
static bool PHInsert(PascalHashTable *rhh, void *key, size_t keysize, void *val)
Associates the specified key and value using default hash function.
size_t PHKeyInlineSize(PascalHashTable *rhh)
Obtain the size of the key that can be stored inline in the hash table. If the size of the key is lar...
static bool PHUpsert(PascalHashTable *rhh, void *key, size_t keysize, void **val_ref, bool *is_duplicate)
Update or insert depends on whether the key already exists in the hash table.
void(* OPHashIterator)(void *key, void *value, size_t keysize, size_t valsize, void *context)
HashTable iterator interface.
static void * PHGet(PascalHashTable *rhh, void *key, size_t keysize)
Obtain the value associated with the key using default hash function. Returns NULL if the key was not...
uint64_t(* OPHash)(void *key, size_t size)
Hash function interface.