13#include "common/lang/string.h"
14#include "common/lang/string_view.h"
15#include "common/sys/rc.h"
16#include "common/lang/utility.h"
17#include "oblsm/include/ob_lsm_options.h"
18#include "oblsm/include/ob_lsm_iterator.h"
22class ObLsmTransaction;
53 virtual ~ObLsm() =
default;
64 virtual RC
put(
const string_view &key,
const string_view &value) = 0;
76 virtual RC
get(
const string_view &key,
string *value) = 0;
86 virtual RC
remove(
const string_view &key) = 0;
111 virtual RC
batch_put(
const vector<pair<string, string>> &kvs) = 0;
Abstract class for iterating over key-value pairs in an LSM-Tree.
Definition: ob_lsm_iterator.h:41
A class representing a transaction in oblsm.
Definition: ob_lsm_transaction.h:36
ObLsm is a key-value storage engine for educational purpose. ObLsm learned a lot about design from le...
Definition: ob_lsm.h:29
virtual RC get(const string_view &key, string *value)=0
Retrieves the value associated with a specified key.
virtual void dump_sstables()=0
Dumps all SSTables for debugging purposes.
static RC open(const ObLsmOptions &options, const string &path, ObLsm **dbptr)
Opens an LSM-Tree database at the specified path.
Definition: ob_lsm_impl.cpp:94
virtual ObLsmIterator * new_iterator(ObLsmReadOptions options)=0
Creates a new iterator for traversing the LSM-Tree database.
virtual RC put(const string_view &key, const string_view &value)=0
Inserts or updates a key-value entry in the LSM-Tree.
virtual RC remove(const string_view &key)=0
Delete a key-value entry in the LSM-Tree.
virtual RC batch_put(const vector< pair< string, string > > &kvs)=0
Inserts a batch of key-value entries into the LSM-Tree.
Configuration options for the LSM-Tree implementation.
Definition: ob_lsm_options.h:22
Definition: ob_lsm_options.h:48