87WAL_append(
struct WAL* wal,
const char* key,
size_t key_len, int64_t value_loc);
In-memory table of the records that have been modified most recently.
MemTable of the Database.
Definition memtable.h:55
Write-Ahead Log(WAL) of the Database.
Definition wal.h:41
char * path
The path of the WAL file.
Definition wal.h:43
FILE * file
The file that the WAL writes the keys to.
Definition wal.h:42
struct WAL * WAL_new(char *path)
Creates a new emtpy WAL.
Definition wal.c:26
int WAL_sync(const struct WAL *wal)
Syncs the WAl to the disk.
Definition wal.c:114
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.
Definition wal.c:89
void WAL_free(struct WAL *wal)
Frees the WAL.
Definition wal.c:131
int WAL_load_memtable(struct WAL *wal, struct MemTable *memtable)
Replays the WAL from the start and recreates the MemTable.
Definition wal.c:42