Loading include/daemon/backend/metadata/db.hpp +1 −4 Original line number Diff line number Diff line Loading @@ -45,14 +45,12 @@ namespace gkfs::metadata { class MetadataDB { private: std::string path; std::shared_ptr<spdlog::logger> log_; std::unique_ptr<AbstractMetadataBackend> db; public: explicit MetadataDB(const std::string& path); std::string Loading Loading @@ -88,7 +86,6 @@ public: void iterate_all(); }; } // namespace gkfs::metadata Loading include/daemon/backend/metadata/kreon_backend.hpp +5 −7 Original line number Diff line number Diff line Loading @@ -43,16 +43,15 @@ namespace gkfs::metadata { class KreonBackend : public MetadataBackend<KreonBackend> { private: klc_handle klc_db; klc_db_options klc_options; std::string klc_path; inline void str2klc(const std::string& value, struct klc_value & V) const; inline void str2klc(const std::string& value, struct klc_value& V) const; inline void str2klc(const std::string& key, struct klc_key &K) const; inline void str2klc(const std::string& key, struct klc_key& K) const; public: explicit KreonBackend(const std::string& path); Loading Loading @@ -94,7 +93,6 @@ public: void iterate_all() override; }; } // namespace gkfs::metadata Loading include/daemon/backend/metadata/metadata_backend.hpp +14 −18 Original line number Diff line number Diff line Loading @@ -72,19 +72,16 @@ class AbstractMetadataBackend { virtual void iterate_all() = 0; }; template <typename T> class MetadataBackend : public AbstractMetadataBackend { private: std::string path; std::shared_ptr<spdlog::logger> log_; std::unique_ptr<T> db; public: // explicit MetadataDB(const std::string& path); std::string Loading Loading @@ -142,7 +139,6 @@ public: iterate_all() { static_cast<T&>(*this).iterate_all(); } }; } // namespace gkfs::metadata Loading include/daemon/backend/metadata/rocksdb_backend.hpp +4 −6 Original line number Diff line number Diff line Loading @@ -41,7 +41,6 @@ namespace gkfs::metadata { class RocksDBBackend : public MetadataBackend<RocksDBBackend> { private: std::unique_ptr<rdb::DB> db; rdb::Options options; rdb::WriteOptions write_opts; Loading Loading @@ -88,7 +87,6 @@ public: void iterate_all() override; }; } // namespace gkfs::metadata Loading src/daemon/backend/metadata/db.cpp +12 −15 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ extern "C" { } namespace gkfs::metadata { /** Loading @@ -48,13 +47,13 @@ namespace gkfs::metadata { * @param path where KV store data is stored */ MetadataDB::MetadataDB(const std::string& path) : path(path) { #ifdef KREON db.reset(new KreonBackend(path)); #endif #ifdef ROCKSDB if(true) db.reset(new KreonBackend(path)); else db.reset(new RocksDBBackend(path)); #endif /* Get logger instance and set it for data module and chunk storage */ GKFS_METADATA_MOD->log(spdlog::get(GKFS_METADATA_MOD->LOGGER_NAME)); assert(GKFS_METADATA_MOD->log()); Loading Loading @@ -114,7 +113,6 @@ void MetadataDB::remove(const std::string& key) { db->remove(key); } /** Loading Loading @@ -155,7 +153,6 @@ void MetadataDB::increase_size(const std::string& key, size_t size, bool append) { db->increase_size(key, size, append); } /** Loading @@ -168,7 +165,7 @@ MetadataDB::increase_size(const std::string& key, size_t size, bool append) { void MetadataDB::decrease_size(const std::string& key, size_t size) { db->decrease_size(key, size); db.get()->decrease_size(key, size); } /** Loading Loading
include/daemon/backend/metadata/db.hpp +1 −4 Original line number Diff line number Diff line Loading @@ -45,14 +45,12 @@ namespace gkfs::metadata { class MetadataDB { private: std::string path; std::shared_ptr<spdlog::logger> log_; std::unique_ptr<AbstractMetadataBackend> db; public: explicit MetadataDB(const std::string& path); std::string Loading Loading @@ -88,7 +86,6 @@ public: void iterate_all(); }; } // namespace gkfs::metadata Loading
include/daemon/backend/metadata/kreon_backend.hpp +5 −7 Original line number Diff line number Diff line Loading @@ -43,16 +43,15 @@ namespace gkfs::metadata { class KreonBackend : public MetadataBackend<KreonBackend> { private: klc_handle klc_db; klc_db_options klc_options; std::string klc_path; inline void str2klc(const std::string& value, struct klc_value & V) const; inline void str2klc(const std::string& value, struct klc_value& V) const; inline void str2klc(const std::string& key, struct klc_key &K) const; inline void str2klc(const std::string& key, struct klc_key& K) const; public: explicit KreonBackend(const std::string& path); Loading Loading @@ -94,7 +93,6 @@ public: void iterate_all() override; }; } // namespace gkfs::metadata Loading
include/daemon/backend/metadata/metadata_backend.hpp +14 −18 Original line number Diff line number Diff line Loading @@ -72,19 +72,16 @@ class AbstractMetadataBackend { virtual void iterate_all() = 0; }; template <typename T> class MetadataBackend : public AbstractMetadataBackend { private: std::string path; std::shared_ptr<spdlog::logger> log_; std::unique_ptr<T> db; public: // explicit MetadataDB(const std::string& path); std::string Loading Loading @@ -142,7 +139,6 @@ public: iterate_all() { static_cast<T&>(*this).iterate_all(); } }; } // namespace gkfs::metadata Loading
include/daemon/backend/metadata/rocksdb_backend.hpp +4 −6 Original line number Diff line number Diff line Loading @@ -41,7 +41,6 @@ namespace gkfs::metadata { class RocksDBBackend : public MetadataBackend<RocksDBBackend> { private: std::unique_ptr<rdb::DB> db; rdb::Options options; rdb::WriteOptions write_opts; Loading Loading @@ -88,7 +87,6 @@ public: void iterate_all() override; }; } // namespace gkfs::metadata Loading
src/daemon/backend/metadata/db.cpp +12 −15 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ extern "C" { } namespace gkfs::metadata { /** Loading @@ -48,13 +47,13 @@ namespace gkfs::metadata { * @param path where KV store data is stored */ MetadataDB::MetadataDB(const std::string& path) : path(path) { #ifdef KREON db.reset(new KreonBackend(path)); #endif #ifdef ROCKSDB if(true) db.reset(new KreonBackend(path)); else db.reset(new RocksDBBackend(path)); #endif /* Get logger instance and set it for data module and chunk storage */ GKFS_METADATA_MOD->log(spdlog::get(GKFS_METADATA_MOD->LOGGER_NAME)); assert(GKFS_METADATA_MOD->log()); Loading Loading @@ -114,7 +113,6 @@ void MetadataDB::remove(const std::string& key) { db->remove(key); } /** Loading Loading @@ -155,7 +153,6 @@ void MetadataDB::increase_size(const std::string& key, size_t size, bool append) { db->increase_size(key, size, append); } /** Loading @@ -168,7 +165,7 @@ MetadataDB::increase_size(const std::string& key, size_t size, bool append) { void MetadataDB::decrease_size(const std::string& key, size_t size) { db->decrease_size(key, size); db.get()->decrease_size(key, size); } /** Loading