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

MemTable Class. More...

#include <memtable.hpp>

Public Types

using Iterator = SkipList::Iterator

Public Member Functions

void put (const std::string &key, const std::string &value)
 Put a key-value pair into the MemTable.
std::pair< bool, std::string > get (const std::string &key)
 Get the value associated with a key.
void remove (const std::string &key)
 Remove a key from the MemTable.
size_t getSize ()
 Get the size of the MemTable.
Iterator begin ()
Iterator end ()
Iterator find (const std::string &key)

Detailed Description

MemTable Class.

This class implements a MemTable using a skip list as In-Memory storage for LSM-Tree.

Member Function Documentation

◆ get()

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

Get the value associated with a key.

Parameters
key
Returns
std::pair<bool, std::string> A pair where the first element indicates if the key was found, and the second element is the value associated with the key. If the key was not found, the first element will be false and the second element will be an empty string. If the key was found but marked as TOMBSTONE, the first element will be false and the second element will be TOMBSTONE.

◆ getSize()

size_t MemTable::getSize ( )
inline

Get the size of the MemTable.

Returns
size_t The size of the MemTable in bytes.

◆ put()

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

Put a key-value pair into the MemTable.

Parameters
keyThe key to be inserted.
valueThe value associated with the key.

◆ remove()

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

Remove a key from the MemTable.

Parameters
keyThe key to be removed.

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