LSM Tree implementation. More...
#include <lsm.hpp>
Public Member Functions | |
| LSMTree () | |
| Constructs an LSMTree instance and initializes background worker threads. | |
| ~LSMTree () | |
| Destructor that gracefully shuts down the LSMTree, ensuring all background tasks complete. | |
| void | put (const std::string &key, const std::string &value) |
| Inserts a key-value pair into the LSM Tree. | |
| std::pair< bool, std::string > | get (const std::string &key) |
| Retrieves the value associated with a given key. | |
| void | remove (const std::string &key) |
| Marks a key as deleted by inserting a tombstone value. | |
LSM Tree implementation.
This class implements a Log-Structured Merge Tree (LSM Tree) for efficient key-value storage.
The LSM Tree uses a combination of in-memory and on-disk data structures to provide fast
read and write operations. The in-memory structure is a MemTable, which is periodically flushed
to disk as an SSTable. The on-disk structure is a collection of SSTables, which are compacted
periodically to reduce the number of files and improve read performance.
|
inline |
Retrieves the value associated with a given key.
| key | The key to search for. |
|
inline |
Inserts a key-value pair into the LSM Tree.
| key | The key to insert. |
| value | The associated value. |
|
inline |
Marks a key as deleted by inserting a tombstone value.
| key | The key to remove. |