RocksDB¶
Namespace: dftracer::utils::rocksdb
For usage guide and examples, see RocksDB.
-
class KeyBuilder¶
Public Functions
-
KeyBuilder &append_tag(std::string_view tag)¶
-
KeyBuilder &append_separator()¶
-
KeyBuilder &append_string(std::string_view value)¶
-
KeyBuilder &append_be32(std::uint32_t value)¶
-
KeyBuilder &append_be64(std::uint64_t value)¶
-
std::string build() const¶
-
void clear()¶
-
KeyBuilder &append_tag(std::string_view tag)¶
-
class KeyCodec¶
Public Static Functions
-
static std::string encode_be32(std::uint32_t value)¶
-
static std::string encode_be64(std::uint64_t value)¶
-
static std::uint32_t decode_be32(std::string_view bytes)¶
-
static std::uint64_t decode_be64(std::string_view bytes)¶
-
static void append_be32(std::string &out, std::uint32_t value)¶
-
static void append_be64(std::string &out, std::uint64_t value)¶
-
static std::string encode_be32(std::uint32_t value)¶
-
class RocksDBManager¶
Public Functions
-
std::shared_ptr<RocksDatabase> get_or_open(const std::string &db_path, RocksDatabase::OpenMode open_mode = RocksDatabase::OpenMode::ReadWrite, RocksDatabase::CfOptionsOverride cf_override = nullptr)¶
-
void reset(const std::string &db_path)¶
-
void shutdown()¶
Public Static Functions
-
static RocksDBManager &instance()¶
-
std::shared_ptr<RocksDatabase> get_or_open(const std::string &db_path, RocksDatabase::OpenMode open_mode = RocksDatabase::OpenMode::ReadWrite, RocksDatabase::CfOptionsOverride cf_override = nullptr)¶
-
class RocksDatabase¶
Public Types
-
using Batch = ::rocksdb::WriteBatch¶
-
using CfOptionsOverride = std::function<void(const std::string&, ::rocksdb::ColumnFamilyOptions&)>¶
Public Functions
-
RocksDatabase()¶
-
~RocksDatabase()¶
-
RocksDatabase(const RocksDatabase&) = delete¶
-
RocksDatabase &operator=(const RocksDatabase&) = delete¶
-
RocksDatabase(RocksDatabase &&other) noexcept¶
-
RocksDatabase &operator=(RocksDatabase &&other) noexcept¶
-
void close()¶
-
bool is_open() const noexcept¶
-
bool is_read_only() const noexcept¶
-
const std::string &path() const noexcept¶
-
::rocksdb::DB *get() const noexcept¶
-
::rocksdb::Status put(std::string_view key, std::string_view value, std::string_view column_family = cf::DEFAULT)¶
-
::rocksdb::Status get(std::string_view key, std::string *value, std::string_view column_family = cf::DEFAULT) const¶
-
::rocksdb::Status del(std::string_view key, std::string_view column_family = cf::DEFAULT)¶
-
::rocksdb::Status delete_range(std::string_view begin_key, std::string_view end_key, std::string_view column_family = cf::DEFAULT)¶
-
::rocksdb::Status put(Batch &batch, std::string_view column_family, std::string_view key, std::string_view value)¶
-
::rocksdb::Status merge(std::string_view key, std::string_view value, std::string_view column_family = cf::DEFAULT)¶
-
::rocksdb::Status merge(Batch &batch, std::string_view column_family, std::string_view key, std::string_view value)¶
-
std::unique_ptr<::rocksdb::Iterator> new_iterator(std::string_view column_family = cf::DEFAULT) const¶
-
::rocksdb::Status compact(std::string_view column_family = cf::DEFAULT)¶
-
::rocksdb::Status ingest_external_files(std::string_view column_family, const std::vector<std::string> &external_files, bool ingest_behind = false)¶
Bulk-ingest externally built SST files into the named column family. Keys across the SSTs must be sorted and non-overlapping unless the caller requests
ingest_behind, which pushes entries to the bottom level and silently drops duplicate keys (for content-addressed CFs).
-
void set_cf_options_override(CfOptionsOverride override)¶
-
using Batch = ::rocksdb::WriteBatch¶