Commit 8a096be4 authored by David Auer's avatar David Auer
Browse files

Refactor config_manager and srv_management

parent c4c77d26
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -14,8 +14,15 @@
#ifndef GEKKOFS_CONFIG_MANAGER_HPP
#define GEKKOFS_CONFIG_MANAGER_HPP

#include <string>
#include <utility>
#include <vector>

namespace gkfs::relocation {

std::vector<std::pair<std::string, std::string>>
read_hosts_file();

void
test_d2d_rpc();

+26 −0
Original line number Diff line number Diff line
/*
  Copyright 2018-2020, Barcelona Supercomputing Center (BSC), Spain
  Copyright 2015-2020, Johannes Gutenberg Universitaet Mainz, Germany

  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
  ADA-FS project under the SPPEXA project funded by the DFG.

  SPDX-License-Identifier: MIT
*/

#ifndef GEKKOFS_RELOCATION_TRANSMITTER_HPP
#define GEKKOFS_RELOCATION_TRANSMITTER_HPP

#include <global/rpc/distributor.hpp>

namespace gkfs::relocation {

void
transmit_metadata(gkfs::rpc::host_t localhost);

} // namespace gkfs::relocation

#endif // GEKKOFS_RELOCATION_TRANSMITTER_HPP
 No newline at end of file
+1 −2
Original line number Diff line number Diff line
@@ -97,8 +97,7 @@ MERCURY_GEN_PROC(rpc_config_out_t,
                         (hg_uint32_t)(gid)))


MERCURY_GEN_PROC(rpc_relocation_start_in_t,
                 ((hg_uint64_t)(host_id))((hg_uint64_t)(host_size)))
MERCURY_GEN_PROC(rpc_relocation_start_in_t, ((hg_uint64_t)(host_id)))


MERCURY_GEN_PROC(rpc_chunk_stat_in_t, ((hg_int32_t)(dummy)))
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ set(DAEMON_SRC
    handler/srv_metadata.cpp
    handler/srv_management.cpp
    relocation/config_manager.cpp
    relocation/transmitter.cpp
    )
set(DAEMON_HEADERS
    ../../include/config.hpp
@@ -32,6 +33,7 @@ set(DAEMON_HEADERS
    ../../include/daemon/handler/rpc_defs.hpp
    ../../include/daemon/handler/rpc_util.hpp
    ../../include/daemon/relocation/config_manager.hpp
    ../../include/daemon/relocation/transmitter.hpp
    )
set(DAEMON_LINK_LIBRARIES
    # internal libs
+3 −17
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#include <daemon/daemon.hpp>
#include <daemon/handler/rpc_defs.hpp>
#include <daemon/handler/rpc_util.hpp>
#include <daemon/backend/metadata/db.hpp>
#include <daemon/relocation/transmitter.hpp>

#include <global/rpc/distributor.hpp>
#include <global/rpc/rpc_types.hpp>
@@ -76,22 +76,8 @@ rpc_srv_relocation_start(hg_handle_t handle) {


    auto const host_id = in.host_id;
    auto const host_size = in.host_size;
    gkfs::rpc::SimpleHashDistributor distributor(host_id, host_size);
    cout << fmt::format("Got host_id = {} and host_size = {}\n", host_id,
                        host_size);

    auto metadata_dump = GKFS_DATA->mdb()->get_all();

    for(auto metadatum : metadata_dump) {
        if(metadatum.first == "/") {
            continue;
        }
        bool move =
                distributor.locate_file_metadata(metadatum.first) != host_id;
        cout << "Checking " << metadatum.first << " Val: " << metadatum.second
             << " Move: " << move << "\n";
    }
    gkfs::relocation::transmit_metadata(host_id);

    out.err = 0; // TODO
    return gkfs::rpc::cleanup_respond(&handle, &in, &out);
Loading