![]() |
NVMLib
very early alpha
A library to optimally use a Hybrid RAM setup.
|


Go to the source code of this file.
Data Structures | |
| struct | hashmap_args |
| struct | entry |
| struct | buckets |
| struct | hashmap_tx |
Macros | |
| #define | HASHMAP_TX_TYPE_OFFSET 1004 |
Typedefs | |
| typedef struct entry | entry |
| typedef struct buckets | buckets |
| typedef struct hashmap_tx | hashmap_tx |
Enumerations | |
| enum | hashmap_cmd { HASHMAP_CMD_REBUILD, HASHMAP_CMD_DEBUG } |
Functions | |
| POBJ_LAYOUT_BEGIN (types_tab) | |
| POBJ_LAYOUT_ROOT (types_tab, struct hashmap_tx) | |
| POBJ_LAYOUT_TOID (types_tab, struct buckets) | |
| POBJ_LAYOUT_TOID (types_tab, struct entry) | |
| POBJ_LAYOUT_END (types_tab) | |
| int | hm_tx_check (PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap) |
Checks if specified persistent object is an instance of hashmap. More... | |
| int | hm_tx_create (PMEMobjpool *pop, TOID(struct hashmap_tx) *map, void *arg) |
Allocates a new hashmap. More... | |
| int | hm_tx_init (PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap) |
Recovers hashmap state. More... | |
| int | hm_tx_insert (PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, uint64_t key, MEMoid value) |
Inserts the specified value into the hashmap. More... | |
| MEMoid | hm_tx_remove (PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, uint64_t key) |
Removes specified value from the hashmap. More... | |
| MEMoid | hm_tx_get (PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, uint64_t key) |
Checks whether specified key is in the hashmap and retries the value associated with it. More... | |
| int | hm_tx_lookup (PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, uint64_t key) |
Checks whether specified key exists in the hashmap. More... | |
| int | hm_tx_foreach (PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, int(*cb)(uint64_t key, MEMoid value, void *arg), void *arg) |
Calls a given callback for every element in the hashmap. More... | |
| size_t | hm_tx_count (PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap) |
Returns number of elements in the hashmap. More... | |
| int | hm_tx_cmd (PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, unsigned cmd, uint64_t arg) |
Executes a command for hashmap. More... | |
| void | hm_tx_debug (PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, FILE *out) |
| Prints complete hashmap state. More... | |
| #define HASHMAP_TX_TYPE_OFFSET 1004 |
Definition at line 20 of file hashmap_tx.h.
| typedef struct hashmap_tx hashmap_tx |
| enum hashmap_cmd |
| Enumerator | |
|---|---|
| HASHMAP_CMD_REBUILD | |
| HASHMAP_CMD_DEBUG | |
Definition at line 13 of file hashmap_tx.h.
| int hm_tx_check | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) | hashmap | ||
| ) |
Checks if specified persistent object is an instance of hashmap.
| PMEMobjpool | the pool where the hashmap is stored. |
| hashmap | the typed hashmap which needs to be initialised. |
hashmap Definition at line 463 of file hashmap_tx.c.
| int hm_tx_cmd | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) | hashmap, | ||
| unsigned | cmd, | ||
| uint64_t | arg | ||
| ) |
Executes a command for hashmap.
Available commands are: HASHMAP_CMD_REBUILD and HASHMAP_CMD_DEBUG
| PMEMobjpool | the pool where the hashmap is stored. |
| hashmap | the typed hashmap which needs to be initialised. |
| cmd | the command to be executed. |
| arg | the arguments for the command. |
EINVAL: otherwise Definition at line 480 of file hashmap_tx.c.

| size_t hm_tx_count | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) | hashmap | ||
| ) |
Returns number of elements in the hashmap.
| PMEMobjpool | the pool where the hashmap is stored. |
| hashmap | the typed hashmap which needs to be initialised. |
hashmap. Definition at line 401 of file hashmap_tx.c.
| int hm_tx_create | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) * | map, | ||
| void * | arg | ||
| ) |
Allocates a new hashmap.
| PMEMobjpool | the pool where the hashmap would be stored. |
| hashmap | the typed hashmap which needs to be initialised. |
| arg | additional arguments if necessary |
Definition at line 433 of file hashmap_tx.c.

| void hm_tx_debug | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) | hashmap, | ||
| FILE * | out | ||
| ) |
Prints complete hashmap state.
This function is used for debugging purposes.
| PMEMobjpool | the pool where the hashmap would be stored. |
| hashmap | the typed hashmap which needs to be initialised. |
| out | the file desciptor for where the output needs to be recorded. |
out paramater can be stdout and stderr too. Definition at line 314 of file hashmap_tx.c.

| int hm_tx_foreach | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) | hashmap, | ||
| int(*)(uint64_t key, MEMoid value, void *arg) | cb, | ||
| void * | arg | ||
| ) |
Calls a given callback for every element in the hashmap.
| PMEMobjpool | the pool where the hashmap is stored. |
| hashmap | the typed hashmap which needs to be initialised. |
| cb | the calback function. |
| arg | additional arguments for the callback function |
callback function. Definition at line 281 of file hashmap_tx.c.

| MEMoid hm_tx_get | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) | hashmap, | ||
| uint64_t | key | ||
| ) |
Checks whether specified key is in the hashmap and retries the value associated with it.
| PMEMobjpool | the pool where the hashmap is stored. |
| hashmap | the typed hashmap which needs to be initialised. |
| key | the key for the value being inserted. It will be used to calculate the hash. |
value associated with the key. key existed Definition at line 349 of file hashmap_tx.c.

| int hm_tx_init | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) | hashmap | ||
| ) |
Recovers hashmap state.
Called after pmemobj_open().
| PMEMobjpool | the pool where the hashmap is stored. |
| hashmap | the typed hashmap which needs to be initialised. |
Definition at line 415 of file hashmap_tx.c.
| int hm_tx_insert | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) | hashmap, | ||
| uint64_t | key, | ||
| MEMoid | value | ||
| ) |
Inserts the specified value into the hashmap.
| PMEMobjpool | the pool where the hashmap is stored. |
| hashmap | the typed hashmap which needs to be initialised. |
| key | the key for the value being inserted. It will be used to calculate the hash. |
| value | the value that is supposed to be inserted. |
value already existed key already exists in the hashmap, then the value provided is not inserted. Definition at line 164 of file hashmap_tx.c.

| int hm_tx_lookup | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) | hashmap, | ||
| uint64_t | key | ||
| ) |
Checks whether specified key exists in the hashmap.
| PMEMobjpool | the pool where the hashmap is stored. |
| hashmap | the typed hashmap which needs to be initialised. |
| key | the key for the value being inserted. It will be used to calculate the hash. |
key exists Definition at line 377 of file hashmap_tx.c.

| MEMoid hm_tx_remove | ( | PMEMobjpool * | pop, |
| TOID(struct hashmap_tx) | hashmap, | ||
| uint64_t | key | ||
| ) |
Removes specified value from the hashmap.
| PMEMobjpool | the pool where the hashmap is stored. |
| hashmap | the typed hashmap which needs to be initialised. |
| key | the key for the value being inserted. It will be used to calculate the hash. |
value associated with the key deleted upon success key existedhashmap are less that number of buckets. Definition at line 224 of file hashmap_tx.c.

| POBJ_LAYOUT_BEGIN | ( | types_tab | ) |
| POBJ_LAYOUT_END | ( | types_tab | ) |
| POBJ_LAYOUT_ROOT | ( | types_tab | , |
| struct hashmap_tx | |||
| ) |
| POBJ_LAYOUT_TOID | ( | types_tab | , |
| struct buckets | |||
| ) |
| POBJ_LAYOUT_TOID | ( | types_tab | , |
| struct entry | |||
| ) |