API Reference#

Typedefs

using transaction_t = data_accessor_t#
namespace ucsb#

Typedefs

using transaction_t = data_accessor_t#
class db_t : public data_accessor_t#
#include <db.hpp>

A base class for benchmarking key-value stores. This doesn’t apply to transactional benchmarks.

General usage procedure is the following:

  1. Configure .set_config and a custom file,

  2. Recover the state from disk via .open,

  3. Perform all the needed benchmarks,

  4. Flush the state via .close,

  5. Remove all the data, if needed, via .destroy.

Public Functions

inline virtual ~db_t()#
virtual bool open(std::string &error) = 0#
virtual void close() = 0#
virtual std::string info() = 0#

Returns high level description about the DB.

virtual void set_config(fs::path const &config_path, fs::path const &main_dir_path, std::vector<fs::path> const &storage_dir_paths, db_hints_t const &hints) = 0#

Initializes the DB before usage.

This function can’t be used more than once. Every DB has it’s own format for configuration files. LMDB and LevelDB use .json, RocksDB uses .ini. The internal contents and available settings also differ.

Parameters:
  • config_path – The path of configuration files.

  • main_dir_path – The target directory, where DB should store metadata.

  • storage_dir_paths – The target directories, where DB should store data.

  • hints – hints for the DB to prepare to work better.

virtual void flush() = 0#
virtual size_t size_on_disk() const = 0#

Accumulates the size (in bytes) of all the files the engine persisted on disk.

virtual std::unique_ptr<transaction_t> create_transaction() = 0#

Typedefs

using key_t = size_t#
using keys_t = std::vector<key_t>#
using keys_span_t = std::span<key_t>#
using keys_spanc_t = std::span<key_t const>#
using value_length_t = uint32_t#
using value_t = std::vector<std::byte>#
using values_t = std::vector<value_t>#
using value_span_t = std::span<std::byte>#
using value_spanc_t = std::span<std::byte const>#
using values_buffer_t = aligned_buffer_t#
using values_span_t = std::span<std::byte>#
using values_spanc_t = std::span<std::byte const>#
using value_lengths_t = std::vector<value_length_t>#
using value_lengths_span_t = std::span<value_length_t>#
using value_lengths_spanc_t = std::span<value_length_t const>#
namespace ucsb

Typedefs

using key_t = size_t#
using keys_t = std::vector<key_t>#
using keys_span_t = std::span<key_t>#
using keys_spanc_t = std::span<key_t const>#
using value_length_t = uint32_t#
using value_t = std::vector<std::byte>#
using values_t = std::vector<value_t>#
using value_span_t = std::span<std::byte>#
using value_spanc_t = std::span<std::byte const>#
using values_buffer_t = aligned_buffer_t#
using values_span_t = std::span<std::byte>#
using values_spanc_t = std::span<std::byte const>#
using value_lengths_t = std::vector<value_length_t>#
using value_lengths_span_t = std::span<value_length_t>#
using value_lengths_spanc_t = std::span<value_length_t const>#