|
WiscKey Database
Embedded LSM-Tree Key-Value Database
|
Write-Ahead Log for the keys and the value positions. More...
Go to the source code of this file.
Data Structures | |
| struct | WAL |
| Write-Ahead Log(WAL) of the Database. More... | |
Functions | |
| struct WAL * | WAL_new (char *path) |
| Creates a new emtpy WAL. | |
| int | WAL_load_memtable (struct WAL *wal, struct MemTable *memtable) |
| Replays the WAL from the start and recreates the MemTable. | |
| int | WAL_append (struct WAL *wal, const char *key, size_t key_len, int64_t value_loc) |
| Appends a new MemTable operation to the WAL. | |
| int | WAL_sync (const struct WAL *wal) |
| Syncs the WAl to the disk. | |
| void | WAL_free (struct WAL *wal) |
| Frees the WAL. | |
Write-Ahead Log for the keys and the value positions.
| int WAL_append | ( | struct WAL * | wal, |
| const char * | key, | ||
| size_t | key_len, | ||
| int64_t | value_loc ) |
Appends a new MemTable operation to the WAL.
For sets, the value_loc should be the position in the ValueLog that the value entry was written to. For deletes, value_loc should be -1 to indicate a tombstone.
| wal | The WAL to append a MemTable operation to. |
| key | The key to apply an operation to. |
| key_len | The length of the key. |
| value_loc | The location in the ValueLog of the value or -1 if it is being deleted. |
| void WAL_free | ( | struct WAL * | wal | ) |
| struct WAL * WAL_new | ( | char * | path | ) |
| int WAL_sync | ( | const struct WAL * | wal | ) |
Syncs the WAl to the disk.
This function forcefully flushes the changes to the WAL to disk. Use this function sparingly as is will heavily reduce the write throughput of the WAL.
| wal | The WAL to flush to disk. |