meta db unit tests and fixes
This commit is contained in:
@ -29,6 +29,8 @@ class i_meta_db {
|
||||
INTERFACE_SETUP(i_meta_db);
|
||||
|
||||
public:
|
||||
virtual void clear() = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error = 0;
|
||||
|
@ -39,6 +39,7 @@ public:
|
||||
auto operator=(rdb_meta_db &&) -> rdb_meta_db & = delete;
|
||||
|
||||
private:
|
||||
const app_config &cfg_;
|
||||
std::unique_ptr<rocksdb::DB> db_{nullptr};
|
||||
rocksdb::ColumnFamilyHandle *default_family_{};
|
||||
rocksdb::ColumnFamilyHandle *pinned_family_{};
|
||||
@ -49,6 +50,8 @@ private:
|
||||
[[nodiscard]] auto create_iterator(rocksdb::ColumnFamilyHandle *family) const
|
||||
-> std::shared_ptr<rocksdb::Iterator>;
|
||||
|
||||
void create_or_open(bool clear);
|
||||
|
||||
[[nodiscard]] auto get_item_meta_json(const std::string &api_path,
|
||||
json &json_data) const -> api_error;
|
||||
|
||||
@ -60,6 +63,8 @@ private:
|
||||
json json_data) -> api_error;
|
||||
|
||||
public:
|
||||
void clear() override;
|
||||
|
||||
[[nodiscard]] auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
@ -48,6 +48,8 @@ private:
|
||||
api_meta_map meta) -> api_error;
|
||||
|
||||
public:
|
||||
void clear() override;
|
||||
|
||||
[[nodiscard]] auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
Reference in New Issue
Block a user