Class PreloadContext
Defined in File preload_context.hpp
Class Documentation
-
class PreloadContext
Singleton class of the client context with all relevant global data
Public Functions
-
PreloadContext(PreloadContext const&) = delete
-
void operator=(PreloadContext const&) = delete
-
~PreloadContext()
-
void init_logging()
-
bool init_metrics()
-
void destroy_metrics()
-
void mountdir(const std::string &path)
-
const std::string &mountdir() const
-
const std::vector<std::string> &mountdir_components() const
-
void cwd(const std::string &path)
-
const std::string &cwd() const
-
const std::vector<hermes::endpoint> &hosts() const
-
void hosts(const std::vector<hermes::endpoint> &addrs)
-
void clear_hosts()
-
uint64_t local_host_id() const
-
void local_host_id(uint64_t id)
-
uint64_t fwd_host_id() const
-
void fwd_host_id(uint64_t id)
-
const std::string &rpc_protocol() const
-
void rpc_protocol(const std::string &rpc_protocol)
-
bool auto_sm() const
-
void auto_sm(bool auto_sm)
-
RelativizeStatus relativize_fd_path(int dirfd, const char *raw_path, std::string &relative_path, int flags = 0, bool resolve_last_link = true) const
-
bool relativize_path(const char *raw_path, std::string &relative_path, bool resolve_last_link = true) const
-
bool use_proxy() const
-
void use_proxy(bool use_proxy)
-
const std::string &proxy_address_str() const
-
void proxy_address_str(const std::string &proxy_address_str)
-
const hermes::endpoint &proxy_host() const
-
void proxy_host(const hermes::endpoint &proxy_host)
-
void clear_proxy_host()
-
const std::shared_ptr<gkfs::filemap::OpenFileMap> &file_map() const
-
std::shared_ptr<gkfs::rpc::Distributor> distributor() const
-
std::shared_ptr<gkfs::cache::dir::DentryCache> dentry_cache() const
-
bool use_dentry_cache() const
-
void use_dentry_cache(bool use_dentry_cache)
-
std::shared_ptr<gkfs::cache::file::WriteSizeCache> write_size_cache() const
-
bool use_write_size_cache() const
-
void use_write_size_cache(bool use_dentry_cache)
-
void enable_interception()
-
void disable_interception()
-
bool interception_enabled() const
-
int register_internal_fd(int fd)
-
void unregister_internal_fd(int fd)
-
bool is_internal_fd(int fd) const
-
void protect_user_fds()
-
void unprotect_user_fds()
-
std::string get_hostname()
-
void set_replicas(const int repl)
-
int get_replicas()
-
const std::shared_ptr<gkfs::messagepack::ClientMetrics> write_metrics()
-
const std::shared_ptr<gkfs::messagepack::ClientMetrics> read_metrics()
Public Static Functions
-
static inline PreloadContext *getInstance()
Private Functions
-
PreloadContext()
Private Members
-
std::shared_ptr<gkfs::filemap::OpenFileMap> ofm_
-
std::shared_ptr<gkfs::rpc::Distributor> distributor_
-
std::shared_ptr<gkfs::cache::dir::DentryCache> dentry_cache_
-
bool use_dentry_cache_ = {false}
-
std::shared_ptr<gkfs::cache::file::WriteSizeCache> write_size_cache_
-
bool use_write_size_cache_ = {false}
-
std::string cwd_
-
std::vector<std::string> mountdir_components_
-
std::string mountdir_
-
std::vector<hermes::endpoint> hosts_
-
uint64_t local_host_id_
-
uint64_t fwd_host_id_
-
std::string rpc_protocol_
-
bool auto_sm_ = {false}
-
bool use_proxy_ = {false}
-
std::string proxy_address_str_
-
hermes::endpoint proxy_host_
-
bool interception_enabled_
-
std::bitset<GKFS_MAX_INTERNAL_FDS> internal_fds_
-
mutable std::mutex internal_fds_mutex_
-
bool internal_fds_must_relocate_
-
std::bitset<MAX_USER_FDS> protected_fds_
-
std::string hostname
-
int replicas_
-
std::shared_ptr<gkfs::messagepack::ClientMetrics> write_metrics_
-
std::shared_ptr<gkfs::messagepack::ClientMetrics> read_metrics_
Private Static Attributes
-
static constexpr auto MIN_INTERNAL_FD = GKFS_MAX_OPEN_FDS - GKFS_MAX_INTERNAL_FDS
-
static constexpr auto MAX_USER_FDS = MIN_INTERNAL_FD
-
PreloadContext(PreloadContext const&) = delete