Blink DB Documentation v1.0.0
Blink DB Documentation
Loading...
Searching...
No Matches
LSMTree Class Reference

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.

Detailed Description

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.

Member Function Documentation

◆ get()

std::pair< bool, std::string > LSMTree::get ( const std::string & key)
inline

Retrieves the value associated with a given key.

Parameters
keyThe key to search for.
Returns
A pair containing a boolean indicating success and the associated value.

◆ put()

void LSMTree::put ( const std::string & key,
const std::string & value )
inline

Inserts a key-value pair into the LSM Tree.

Parameters
keyThe key to insert.
valueThe associated value.

◆ remove()

void LSMTree::remove ( const std::string & key)
inline

Marks a key as deleted by inserting a tombstone value.

Parameters
keyThe key to remove.

The documentation for this class was generated from the following file: