Loading ifs/include/daemon/backend/data/chunk_storage.hpp +5 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ #define IFS_CHUNK_STORAGE_HPP #include <abt.h> #include <limits.h> #include <string> #include <memory> Loading Loading @@ -32,6 +33,10 @@ class ChunkStorage { void read_chunk(const std::string& file_path, unsigned int chunk_id, char * buff, size_t size, off64_t offset, ABT_eventual& eventual) const; void trim_chunk_space(const std::string& file_path, unsigned int chunk_start, unsigned int chunk_end = UINT_MAX); void delete_chunk(const std::string& file_path, unsigned int chunk_id); void truncate_chunk(const std::string& file_path, unsigned int chunk_id, off_t length); void destroy_chunk_space(const std::string& file_path) const; }; Loading ifs/include/daemon/backend/metadata/db.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,8 @@ class MetadataDB { void remove(const std::string& key); bool exists(const std::string& key); void update(const std::string& old_key, const std::string& new_key, const std::string& val); void update_size(const std::string& key, size_t size, bool append); void increase_size(const std::string& key, size_t size, bool append); void decrease_size(const std::string& key, size_t size); std::vector<std::pair<std::string, bool>> get_dirents(const std::string& dir) const; void iterate_all(); }; Loading ifs/include/daemon/backend/metadata/merge.hpp +13 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,8 @@ namespace rdb = rocksdb; enum class OperandID: char { increase_size = 's', increase_size = 'i', decrease_size = 'd', create = 'c' }; Loading Loading @@ -41,6 +42,17 @@ class IncreaseSizeOperand: public MergeOperand { std::string serialize_params() const override; }; class DecreaseSizeOperand: public MergeOperand { public: size_t size; DecreaseSizeOperand(const size_t size); DecreaseSizeOperand(const rdb::Slice& serialized_op); const OperandID id() const override; std::string serialize_params() const override; }; class CreateOperand: public MergeOperand { public: std::string metadata; Loading ifs/include/daemon/handler/rpc_defs.hpp +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ DECLARE_MARGO_RPC_HANDLER(rpc_srv_access) DECLARE_MARGO_RPC_HANDLER(rpc_srv_stat) DECLARE_MARGO_RPC_HANDLER(rpc_srv_decr_size) DECLARE_MARGO_RPC_HANDLER(rpc_srv_rm_node) DECLARE_MARGO_RPC_HANDLER(rpc_srv_update_metadentry) Loading @@ -34,4 +36,6 @@ DECLARE_MARGO_RPC_HANDLER(rpc_srv_read_data) DECLARE_MARGO_RPC_HANDLER(rpc_srv_write_data) DECLARE_MARGO_RPC_HANDLER(rpc_srv_trunc_data) #endif //LFS_RPC_DEFS_HPP ifs/include/global/global_defs.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -11,12 +11,14 @@ namespace hg_tag { constexpr auto access = "rpc_srv_access"; constexpr auto stat = "rpc_srv_stat"; constexpr auto remove = "rpc_srv_rm_node"; constexpr auto decr_size = "rpc_srv_decr_size"; constexpr auto update_metadentry = "rpc_srv_update_metadentry"; constexpr auto get_metadentry_size = "rpc_srv_get_metadentry_size"; constexpr auto update_metadentry_size = "rpc_srv_update_metadentry_size"; constexpr auto get_dirents = "rpc_srv_get_dirents"; constexpr auto write_data = "rpc_srv_write_data"; constexpr auto read_data = "rpc_srv_read_data"; constexpr auto trunc_data = "rpc_srv_trunc_data"; } // typedefs Loading Loading
ifs/include/daemon/backend/data/chunk_storage.hpp +5 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ #define IFS_CHUNK_STORAGE_HPP #include <abt.h> #include <limits.h> #include <string> #include <memory> Loading Loading @@ -32,6 +33,10 @@ class ChunkStorage { void read_chunk(const std::string& file_path, unsigned int chunk_id, char * buff, size_t size, off64_t offset, ABT_eventual& eventual) const; void trim_chunk_space(const std::string& file_path, unsigned int chunk_start, unsigned int chunk_end = UINT_MAX); void delete_chunk(const std::string& file_path, unsigned int chunk_id); void truncate_chunk(const std::string& file_path, unsigned int chunk_id, off_t length); void destroy_chunk_space(const std::string& file_path) const; }; Loading
ifs/include/daemon/backend/metadata/db.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,8 @@ class MetadataDB { void remove(const std::string& key); bool exists(const std::string& key); void update(const std::string& old_key, const std::string& new_key, const std::string& val); void update_size(const std::string& key, size_t size, bool append); void increase_size(const std::string& key, size_t size, bool append); void decrease_size(const std::string& key, size_t size); std::vector<std::pair<std::string, bool>> get_dirents(const std::string& dir) const; void iterate_all(); }; Loading
ifs/include/daemon/backend/metadata/merge.hpp +13 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,8 @@ namespace rdb = rocksdb; enum class OperandID: char { increase_size = 's', increase_size = 'i', decrease_size = 'd', create = 'c' }; Loading Loading @@ -41,6 +42,17 @@ class IncreaseSizeOperand: public MergeOperand { std::string serialize_params() const override; }; class DecreaseSizeOperand: public MergeOperand { public: size_t size; DecreaseSizeOperand(const size_t size); DecreaseSizeOperand(const rdb::Slice& serialized_op); const OperandID id() const override; std::string serialize_params() const override; }; class CreateOperand: public MergeOperand { public: std::string metadata; Loading
ifs/include/daemon/handler/rpc_defs.hpp +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ DECLARE_MARGO_RPC_HANDLER(rpc_srv_access) DECLARE_MARGO_RPC_HANDLER(rpc_srv_stat) DECLARE_MARGO_RPC_HANDLER(rpc_srv_decr_size) DECLARE_MARGO_RPC_HANDLER(rpc_srv_rm_node) DECLARE_MARGO_RPC_HANDLER(rpc_srv_update_metadentry) Loading @@ -34,4 +36,6 @@ DECLARE_MARGO_RPC_HANDLER(rpc_srv_read_data) DECLARE_MARGO_RPC_HANDLER(rpc_srv_write_data) DECLARE_MARGO_RPC_HANDLER(rpc_srv_trunc_data) #endif //LFS_RPC_DEFS_HPP
ifs/include/global/global_defs.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -11,12 +11,14 @@ namespace hg_tag { constexpr auto access = "rpc_srv_access"; constexpr auto stat = "rpc_srv_stat"; constexpr auto remove = "rpc_srv_rm_node"; constexpr auto decr_size = "rpc_srv_decr_size"; constexpr auto update_metadentry = "rpc_srv_update_metadentry"; constexpr auto get_metadentry_size = "rpc_srv_get_metadentry_size"; constexpr auto update_metadentry_size = "rpc_srv_update_metadentry_size"; constexpr auto get_dirents = "rpc_srv_get_dirents"; constexpr auto write_data = "rpc_srv_write_data"; constexpr auto read_data = "rpc_srv_read_data"; constexpr auto trunc_data = "rpc_srv_trunc_data"; } // typedefs Loading