Loading README.md +3 −0 Original line number Original line Diff line number Diff line Loading @@ -187,6 +187,9 @@ environment variable. GKFS_RPC_PROTOCOL defaults to ofi+sockets, and can be used for other RPC protocols GKFS_RPC_PROTOCOL defaults to ofi+sockets, and can be used for other RPC protocols GKFS_THROTTLE_BW_HAVE bytes of available bandwidth GKFS_THROTTLE_BW_SHOULD bytes to throttle available bandwidth to ### Acknowledgment ### Acknowledgment This software was partially supported by the EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). This software was partially supported by the EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). Loading include/daemon/backend/data/chunk_storage.hpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -49,6 +49,9 @@ private: std::string root_path_; std::string root_path_; size_t chunksize_; size_t chunksize_; bool throttle_enabled_ = false; uint64_t throttle_bw_have_; // in bytes uint64_t throttle_bw_should_; // in bytes inline std::string absolute(const std::string& internal_path) const; inline std::string absolute(const std::string& internal_path) const; Loading include/daemon/env.hpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,8 @@ namespace gkfs { namespace env { namespace env { static constexpr auto HOSTS_FILE = ADD_PREFIX("HOSTS_FILE"); static constexpr auto HOSTS_FILE = ADD_PREFIX("HOSTS_FILE"); static constexpr auto THROTTLE_BW_HAVE = ADD_PREFIX("THROTTLE_BW_HAVE"); static constexpr auto THROTTLE_BW_SHOULD = ADD_PREFIX("THROTTLE_BW_SHOULD"); } // namespace env } // namespace env } // namespace gkfs } // namespace gkfs Loading src/daemon/backend/data/chunk_storage.cpp +15 −1 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <boost/filesystem.hpp> #include <boost/filesystem.hpp> #include <spdlog/spdlog.h> #include <spdlog/spdlog.h> #include <config.hpp> #include <config.hpp> #include <global/env_util.hpp> #include <daemon/env.hpp> extern "C" { extern "C" { #include <sys/statfs.h> #include <sys/statfs.h> Loading Loading @@ -85,7 +87,19 @@ ChunkStorage::ChunkStorage(string& path, const size_t chunksize) : auto test_file_path = "/.__chunk_dir_test"s; auto test_file_path = "/.__chunk_dir_test"s; init_chunk_space(test_file_path); init_chunk_space(test_file_path); destroy_chunk_space(test_file_path); destroy_chunk_space(test_file_path); log_->debug("{}() Chunk storage initialized with path: '{}'", __func__, root_path_); // set throttle auto throttle_have_str = gkfs::env::get_var(gkfs::env::THROTTLE_BW_HAVE, "0"); throttle_bw_have_ = std::strtoul(throttle_have_str.c_str(), nullptr, 10); auto throttle_should_str = gkfs::env::get_var(gkfs::env::THROTTLE_BW_SHOULD, "0"); throttle_bw_should_ = std::strtoul(throttle_should_str.c_str(), nullptr, 10); if (throttle_bw_have_ != 0 && throttle_bw_should_ != 0) { throttle_enabled_ = true; log_->info("{}() Throttle enabled: have '{}' should '{}' in bytes", __func__, throttle_bw_have_, throttle_bw_should_); } log_->info("{}() Chunk storage initialized with path: '{}'", __func__, root_path_); } } /** /** Loading Loading
README.md +3 −0 Original line number Original line Diff line number Diff line Loading @@ -187,6 +187,9 @@ environment variable. GKFS_RPC_PROTOCOL defaults to ofi+sockets, and can be used for other RPC protocols GKFS_RPC_PROTOCOL defaults to ofi+sockets, and can be used for other RPC protocols GKFS_THROTTLE_BW_HAVE bytes of available bandwidth GKFS_THROTTLE_BW_SHOULD bytes to throttle available bandwidth to ### Acknowledgment ### Acknowledgment This software was partially supported by the EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). This software was partially supported by the EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). Loading
include/daemon/backend/data/chunk_storage.hpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -49,6 +49,9 @@ private: std::string root_path_; std::string root_path_; size_t chunksize_; size_t chunksize_; bool throttle_enabled_ = false; uint64_t throttle_bw_have_; // in bytes uint64_t throttle_bw_should_; // in bytes inline std::string absolute(const std::string& internal_path) const; inline std::string absolute(const std::string& internal_path) const; Loading
include/daemon/env.hpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,8 @@ namespace gkfs { namespace env { namespace env { static constexpr auto HOSTS_FILE = ADD_PREFIX("HOSTS_FILE"); static constexpr auto HOSTS_FILE = ADD_PREFIX("HOSTS_FILE"); static constexpr auto THROTTLE_BW_HAVE = ADD_PREFIX("THROTTLE_BW_HAVE"); static constexpr auto THROTTLE_BW_SHOULD = ADD_PREFIX("THROTTLE_BW_SHOULD"); } // namespace env } // namespace env } // namespace gkfs } // namespace gkfs Loading
src/daemon/backend/data/chunk_storage.cpp +15 −1 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <boost/filesystem.hpp> #include <boost/filesystem.hpp> #include <spdlog/spdlog.h> #include <spdlog/spdlog.h> #include <config.hpp> #include <config.hpp> #include <global/env_util.hpp> #include <daemon/env.hpp> extern "C" { extern "C" { #include <sys/statfs.h> #include <sys/statfs.h> Loading Loading @@ -85,7 +87,19 @@ ChunkStorage::ChunkStorage(string& path, const size_t chunksize) : auto test_file_path = "/.__chunk_dir_test"s; auto test_file_path = "/.__chunk_dir_test"s; init_chunk_space(test_file_path); init_chunk_space(test_file_path); destroy_chunk_space(test_file_path); destroy_chunk_space(test_file_path); log_->debug("{}() Chunk storage initialized with path: '{}'", __func__, root_path_); // set throttle auto throttle_have_str = gkfs::env::get_var(gkfs::env::THROTTLE_BW_HAVE, "0"); throttle_bw_have_ = std::strtoul(throttle_have_str.c_str(), nullptr, 10); auto throttle_should_str = gkfs::env::get_var(gkfs::env::THROTTLE_BW_SHOULD, "0"); throttle_bw_should_ = std::strtoul(throttle_should_str.c_str(), nullptr, 10); if (throttle_bw_have_ != 0 && throttle_bw_should_ != 0) { throttle_enabled_ = true; log_->info("{}() Throttle enabled: have '{}' should '{}' in bytes", __func__, throttle_bw_have_, throttle_bw_should_); } log_->info("{}() Chunk storage initialized with path: '{}'", __func__, root_path_); } } /** /** Loading