Loading include/client/preload_context.hpp +3 −3 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ private: std::vector<std::string> mountdir_components_; std::string mountdir_; std::vector<hermes::endpoint> hosts_; std::unordered_map<uint64_t, hermes::endpoint> hosts_; uint64_t local_host_id_; uint64_t fwd_host_id_; std::string rpc_protocol_; Loading Loading @@ -117,11 +117,11 @@ public: const std::string& cwd() const; const std::vector<hermes::endpoint>& const std::unordered_map<uint64_t, hermes::endpoint>& hosts() const; void hosts(const std::vector<hermes::endpoint>& addrs); hosts(const std::unordered_map<uint64_t, hermes::endpoint>& addrs); void clear_hosts(); Loading include/client/preload_util.hpp +8 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <iostream> #include <map> #include <type_traits> #include <unordered_map> namespace gkfs::metadata { Loading Loading @@ -65,11 +66,16 @@ metadata_to_stat(const std::string& path, const gkfs::metadata::Metadata& md, void load_forwarding_map(); std::vector<std::pair<std::string, std::string>> std::unordered_map<uint64_t, std::pair<std::string, std::string>> read_hosts_file(); std::unordered_map<uint64_t, std::pair<std::string, std::string>> read_random_slicing_get_hosts(); void connect_to_hosts(const std::vector<std::pair<std::string, std::string>>& hosts); connect_to_hosts( const std::unordered_map<uint64_t, std::pair<std::string, std::string>>& hosts); } // namespace gkfs::utils Loading include/daemon/classes/fs_data.hpp +19 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,10 @@ namespace data { class ChunkStorage; } namespace rpc { class Distributor; } namespace daemon { class FsData { Loading @@ -56,6 +60,8 @@ private: std::shared_ptr<gkfs::metadata::MetadataDB> mdb_; // Storage backend std::shared_ptr<gkfs::data::ChunkStorage> storage_; // Distributor (needed for dynamic placement) std::shared_ptr<gkfs::rpc::Distributor> distributor_; // configurable metadata bool atime_state_; Loading Loading @@ -117,6 +123,19 @@ public: void storage(const std::shared_ptr<gkfs::data::ChunkStorage>& storage); const std::shared_ptr<gkfs::rpc::Distributor>& distributor() const; void distributor(const std::shared_ptr<gkfs::rpc::Distributor>& distributor); /** * Convenience function for simple backwards compatibility in case of * static placement. */ const std::shared_ptr<gkfs::rpc::Distributor>& distributor(uint64_t localhost, uint64_t hosts_size); const std::string& rpc_protocol() const; Loading include/daemon/relocation/config_manager.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #define GEKKOFS_CONFIG_MANAGER_HPP #include <string> #include <unordered_map> #include <utility> #include <vector> Loading @@ -23,7 +24,7 @@ namespace gkfs::relocation { void calculate_random_slicing(); std::vector<std::pair<std::string, std::string>> std::unordered_map<uint64_t, std::pair<std::string, std::string>> read_hosts_file(); void Loading include/global/hostsfile_util.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -16,10 +16,11 @@ #include <vector> #include <string> #include <unordered_map> namespace gkfs::utils { std::vector<std::pair<std::string, std::string>> std::unordered_map<uint64_t, std::pair<std::string, std::string>> load_hostfile(const std::string& path); } // namespace gkfs::utils Loading Loading
include/client/preload_context.hpp +3 −3 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ private: std::vector<std::string> mountdir_components_; std::string mountdir_; std::vector<hermes::endpoint> hosts_; std::unordered_map<uint64_t, hermes::endpoint> hosts_; uint64_t local_host_id_; uint64_t fwd_host_id_; std::string rpc_protocol_; Loading Loading @@ -117,11 +117,11 @@ public: const std::string& cwd() const; const std::vector<hermes::endpoint>& const std::unordered_map<uint64_t, hermes::endpoint>& hosts() const; void hosts(const std::vector<hermes::endpoint>& addrs); hosts(const std::unordered_map<uint64_t, hermes::endpoint>& addrs); void clear_hosts(); Loading
include/client/preload_util.hpp +8 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <iostream> #include <map> #include <type_traits> #include <unordered_map> namespace gkfs::metadata { Loading Loading @@ -65,11 +66,16 @@ metadata_to_stat(const std::string& path, const gkfs::metadata::Metadata& md, void load_forwarding_map(); std::vector<std::pair<std::string, std::string>> std::unordered_map<uint64_t, std::pair<std::string, std::string>> read_hosts_file(); std::unordered_map<uint64_t, std::pair<std::string, std::string>> read_random_slicing_get_hosts(); void connect_to_hosts(const std::vector<std::pair<std::string, std::string>>& hosts); connect_to_hosts( const std::unordered_map<uint64_t, std::pair<std::string, std::string>>& hosts); } // namespace gkfs::utils Loading
include/daemon/classes/fs_data.hpp +19 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,10 @@ namespace data { class ChunkStorage; } namespace rpc { class Distributor; } namespace daemon { class FsData { Loading @@ -56,6 +60,8 @@ private: std::shared_ptr<gkfs::metadata::MetadataDB> mdb_; // Storage backend std::shared_ptr<gkfs::data::ChunkStorage> storage_; // Distributor (needed for dynamic placement) std::shared_ptr<gkfs::rpc::Distributor> distributor_; // configurable metadata bool atime_state_; Loading Loading @@ -117,6 +123,19 @@ public: void storage(const std::shared_ptr<gkfs::data::ChunkStorage>& storage); const std::shared_ptr<gkfs::rpc::Distributor>& distributor() const; void distributor(const std::shared_ptr<gkfs::rpc::Distributor>& distributor); /** * Convenience function for simple backwards compatibility in case of * static placement. */ const std::shared_ptr<gkfs::rpc::Distributor>& distributor(uint64_t localhost, uint64_t hosts_size); const std::string& rpc_protocol() const; Loading
include/daemon/relocation/config_manager.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #define GEKKOFS_CONFIG_MANAGER_HPP #include <string> #include <unordered_map> #include <utility> #include <vector> Loading @@ -23,7 +24,7 @@ namespace gkfs::relocation { void calculate_random_slicing(); std::vector<std::pair<std::string, std::string>> std::unordered_map<uint64_t, std::pair<std::string, std::string>> read_hosts_file(); void Loading
include/global/hostsfile_util.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -16,10 +16,11 @@ #include <vector> #include <string> #include <unordered_map> namespace gkfs::utils { std::vector<std::pair<std::string, std::string>> std::unordered_map<uint64_t, std::pair<std::string, std::string>> load_hostfile(const std::string& path); } // namespace gkfs::utils Loading