In-memory table of the records that have been modified most recently.
More...
#include <stdint.h>
#include <stdlib.h>
Go to the source code of this file.
|
|
#define | MEMTABLE_SIZE 1024 |
| | Max number of MemTableRecords in a MemTable.
|
| |
In-memory table of the records that have been modified most recently.
- Author
- Adam Comer adamb.nosp@m.come.nosp@m.r@gma.nosp@m.il.c.nosp@m.om
- Date
- May 15, 2020
- Copyright
- Apache-2.0 License
◆ MemTable_delete()
| void MemTable_delete |
( |
struct MemTable * | memtable, |
|
|
const char * | key, |
|
|
size_t | key_len ) |
Deletes a record from a MemTable.
This function uses binary search for a runtime of O(log(n)).
Note: This function will set a tombstone to propagate the delete into the SSTables.
- Parameters
-
| memtable | The MemTable to delete a record from. |
| key | The key to delete. |
| key_len | The length of the key. |
◆ MemTable_free()
| void MemTable_free |
( |
struct MemTable * | memtable | ) |
|
Frees a MemTable and its records.
Note: This function will free all the MemTableRecords plus their keys in this MemTable.
- Parameters
-
◆ MemTable_get()
Gets a MemTableRecord from a MemTable by key.
This function will return NULL if none of the records in the MemTable.
This function uses binary search for a runtime of O(log(n)).
- Parameters
-
| memtable | The MemTable to search. |
| key | The key to search the MemTable with. |
| key_len | The length of the key. |
- Returns
- A MemTableRecord if the record exists or NULL if it doesn't not exist.
◆ MemTable_new()
◆ MemTable_set()
| void MemTable_set |
( |
struct MemTable * | memtable, |
|
|
const char * | key, |
|
|
size_t | key_len, |
|
|
int64_t | value_loc ) |
Sets a key-value pair in a MemTable.
This function uses binary search for a runtime of O(log(n)).
- Parameters
-
| memtable | The MemTable to set a value to. |
| key | The key to set this value for. |
| key_len | The length of the key. |
| value_loc | The seek location to the value in the ValueLog. |