17#ifndef WISCKEY_SSTABLE_H
18#define WISCKEY_SSTABLE_H
32#define SSTABLE_MIN_SIZE \
34#define SSTABLE_KEY_NOT_FOUND (-2)
In-memory table of the records that have been modified most recently.
struct SSTable * SSTable_new_from_memtable(char *path, struct MemTable *memtable)
Creates a new SSTable from a full MemTable.
Definition sstable.c:263
int SSTable_in_key_range(struct SSTable *table, char *key, size_t key_len)
Checks if the given key could be in this SSTable.
Definition sstable.c:363
unsigned long SSTable_parse_timestamp(char *filename)
Parses the creation timestamp in microseconds from a SSTable filename.
Definition sstable.c:64
unsigned long SSTable_parse_level(char *filename)
Parses the compaction level from a SSTable filename.
Definition sstable.c:81
struct SSTable * SSTable_new(char *path)
Loads a SSTable at a path.
Definition sstable.c:127
void SSTable_free(struct SSTable *table)
Frees the SSTable.
Definition sstable.c:392
int64_t SSTable_get_value_loc(struct SSTable *table, char *key, size_t key_len)
Gets the location of a value on the ValueLog from a key.
Definition sstable.c:317
MemTable of the Database.
Definition memtable.h:55
Single Record in a SSTable.
Definition sstable.h:43
char * key
Key of the record.
Definition sstable.h:44
size_t key_len
Length of they key.
Definition sstable.h:45
int64_t value_loc
Location of the value in the ValueLog.
Definition sstable.h:46
On-disk String-Sorted Table(SSTable) of the keys.
Definition sstable.h:58
size_t high_key_len
Length of the highest key.
Definition sstable.h:73
size_t size
Size of the growable in-memory index.
Definition sstable.h:66
FILE * file
File that the keys reside on.
Definition sstable.h:62
unsigned long level
Compaction level.
Definition sstable.h:61
unsigned long timestamp
Creation timestamp in microseconds.
Definition sstable.h:60
size_t capacity
Capacity of the growable in-memory index.
Definition sstable.h:65
char * path
Path of the SSTable on-disk.
Definition sstable.h:59
size_t low_key_len
Length of the lowest key.
Definition sstable.h:70
uint64_t * records
Definition sstable.h:63
char * high_key
Definition sstable.h:71
char * low_key
Definition sstable.h:68