DataFile
Multiple SSTable are stored in a large file, the DataFile.
DataFile only allocates or reclaims space by a fixed size: its allocation unit. There is one DataFile for each allocation unit.
Assuming in openkv the allocation unit are 4MB and 16MB,
then there are two DataFiles: df-4mb and df-16mb.
Each DataFile has a corresponding bitmap for tracking allocated unit.
The bitmap is part of the manifest
Commit a SSTable
-
Find the first
0in df-bitmap. This bitmap has to be indexed to speed up searching for the first0. -
Flush and fsync SSTable data to DataFile.
-
Flush and fsync bitmap in manifest.