Unverified Commit b3a02dfa authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Daemon use hosts_file instead of lookup_file

parent f7c4e53d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ private:
    std::string metadir_;

    std::string bind_addr_;
    std::string lookup_file_;
    std::string hosts_file_;

    // Database
    std::shared_ptr<MetadataDB> mdb_;
@@ -114,9 +114,9 @@ public:

    void bind_addr(const std::string& addr);

    const std::string& lookup_file() const;
    const std::string& hosts_file() const;

    void lookup_file(const std::string& lookup_file);
    void hosts_file(const std::string& lookup_file);

    bool atime_state() const;

+2 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ void init_rpc_server(const std::string& protocol);

void register_server_rpcs(margo_instance_id mid);

void populate_lookup_file();
void destroy_lookup_file();
void populate_hosts_file();
void destroy_hosts_file();

#endif // GKFS_DAEMON_MAIN_HPP
+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@
// rpc timeout to try again in milliseconds
#define RPC_TIMEOUT 3000

#define DEFAULT_HOSTS_FILE "./gkfs_hosts.txt"

//size of preallocated buffer to hold directory entries in rpc call
#define RPC_DIRENTS_BUFF_SIZE (8 * 1024 * 1024) // 8 mega

+0 −1
Original line number Diff line number Diff line
@@ -125,7 +125,6 @@ MERCURY_GEN_PROC(rpc_config_out_t, ((hg_const_string_t) (mountdir))
((hg_bool_t) (blocks_state)) \
((hg_uint32_t) (uid)) \
((hg_uint32_t) (gid)) \
        ((hg_const_string_t) (lookup_file))
)


+4 −3
Original line number Diff line number Diff line
@@ -130,9 +130,10 @@ void load_hosts() {
    try {
        hosts_file = gkfs::get_env_own("HOSTS_FILE");
    } catch (const exception& e) {
        auto emsg = fmt::format("Failed to get hosts-file path"
                          " from environment: {}", e.what());
        throw runtime_error(emsg);
        CTX->log()->info("{}() Failed to get hosts file path"
                         " from environment, using default: '{}'",
                         __func__, DEFAULT_HOSTS_FILE);
        hosts_file = DEFAULT_HOSTS_FILE;
    }

    vector<pair<string, string>> hosts;
Loading