Enum lsmlite_rs::LsmMode
source · #[repr(C)]pub enum LsmMode {
LsmNoBackgroundThreads = 0,
LsmBackgroundMerger = 1,
LsmBackgroundCheckpointer = 2,
}
Expand description
These are the different kinds of execution modes that the engine can
work on. The default mode is LsmNoBackgroundThreads
- in which no
background thread is scheduled to perform any task. All file operations
are performed by the thread that is currently writing by the database.
The other available modes are LsmBackgroundMerger
in which a background
thread is scheduled to merge database segments towards producing larger
segments. This background thread is also in charge of checkpointing the
database file - thus making data truly persistent on stable storage - and
flushing in-memory data into the database file.
In mode LsmBackgroundMerger
, the additional background thread only
checkpoints the database file. In this mode, merge operations are performed
by the thread that also writes data to the database.
In any case, file operations (like merging and checkpointing) cannot be scheduled, these operations are triggered depending on the current state of the database.
Variants§
LsmNoBackgroundThreads = 0
Default mode. No additional background thread is scheduled.
LsmBackgroundMerger = 1
An additional background thread is scheduled to merge segments and to checkpoint the database file (update file headers and sync the contents of the database file to disk). This thread is also in charge of flushing in-memory data to the database file.
LsmBackgroundCheckpointer = 2
An additional background thread is scheduled to checkpoint the database file. Merge operations are not performed by this thread, but by the thread that also writes data to the database.