26 #ifndef OPIC_HASH_HASH_TABLE_H 27 #define OPIC_HASH_HASH_TABLE_H 1 30 #include "opic/common/op_macros.h" 82 double load,
size_t keysize,
size_t valsize);
150 void* key,
void** val_ref,
bool* is_duplicate);
348 uint32_t HTProbeStat(
OPHashTable* table, uint32_t idx);
362 size_t partition_size);
368 size_t partition_size)
371 slotsize, partition_size);
374 void HTFunnelDestroy(
HTFunnel* funnel);
376 void HTFunnelPreHashInsert(
HTFunnel* funnel,
378 void* key,
void* value);
380 void HTFunnelInsert(
HTFunnel* funnel,
void* key,
void* value);
382 void HTFunnelInsertFlush(
HTFunnel* funnel);
384 void HTFunnelPreHashUpsert(
HTFunnel* funnel,
386 void* key,
void* value,
387 void* context,
size_t ctxsize);
389 void HTFunnelUpsert(
HTFunnel* funnel,
390 void* key,
void* value,
391 void* context,
size_t ctxsize);
393 void HTFunnelUpsertFlush(
HTFunnel* funnel);
395 void HTFunnelPreHashGet(
HTFunnel* funnel, uint64_t hashed_key,
396 void* key,
void* context,
size_t ctxsize);
398 void HTFunnelGet(
HTFunnel* funnel,
void* key,
void* context,
size_t ctxsize);
400 void HTFunnelGetFlush(
HTFunnel* funnel);
402 void HTFunnelPreHashDelete(
HTFunnel* funnel, uint64_t hashed_key,
403 void* key,
void* context,
size_t ctxsize);
405 void HTFunnelDelete(
HTFunnel* funnel,
void* key,
406 void* context,
size_t ctxsize);
408 void HTFunnelDeleteFlush(
HTFunnel* funnel);
An opaque object for doing massive update or quries on OPHashTable.
Memory allocator object with persistent storage on disk.
An opaque object that manage associations of fixed length key-value pairs.
bool HTUpsertCustom(OPHashTable *table, OPHash hasher, void *key, void **val_ref, bool *is_duplicate)
Update or insert depends on whether the key already exists in the hash table using custom hash functi...
static bool HTInsert(OPHashTable *table, void *key, void *val)
Associates the specified key with the specified value in OPHashTable using the default hash function...
void HTPrintStat(OPHashTable *table)
Prints the accumulated count for each probing number.
static void * HTDelete(OPHashTable *table, void *key)
Deletes the key-value entry in hash table using the default hash function.
void * HTGetCustom(OPHashTable *table, OPHash hasher, void *key)
Obtain the value associated with the specified key and hash function. Returns NULL if the key was not...
void HTIterate(OPHashTable *table, OPHashIterator iterator, void *context)
Iterates over all key-value pairs in this hash table with user specified context. ...
size_t HTValSize(OPHashTable *table)
Obtain the size of the value configured for this hash table.
void * HTDeleteCustom(OPHashTable *table, OPHash hasher, void *key)
Deletes the key-value entry in hash table with specified hasher.
static void * HTGet(OPHashTable *table, void *key)
Obtain the value associated with the specified key using the default hash function. Returns NULL if the key was not found.
static uint64_t OPDefaultHash(void *key, size_t size)
Default hash function.
bool HTInsertCustom(OPHashTable *table, OPHash hasher, void *key, void *val)
Associates the specified key with the specified value in OPHashTable with specified hash function...
void HTDestroy(OPHashTable *table)
Destructor for OPHashTable.
uint64_t HTCapacity(OPHashTable *table)
Obtain the number of objects can be stored in this hash table.
uint64_t HTObjcnt(OPHashTable *table)
Obtain the number of objects stored in this hash table.
OPHashTable * HTNew(OPHeap *heap, uint64_t num_objects, double load, size_t keysize, size_t valsize)
Constructor for OPHashTable.
size_t HTKeySize(OPHashTable *table)
Obtain the size of the key configured for this hash table.
void(* OPHashIterator)(void *key, void *value, size_t keysize, size_t valsize, void *context)
HashTable iterator interface.
static bool HTUpsert(OPHashTable *table, void *key, void **val_ref, bool *is_duplicate)
Update or insert depends on whether the key already exists in the hash table.
uint64_t(* OPHash)(void *key, size_t size)
Hash function interface.