Commit 2dea5a90 authored by David Auer's avatar David Auer
Browse files

WIP: Integrate random slicing in GekkoFS

parent 4d605876
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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_;
@@ -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();
+8 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <iostream>
#include <map>
#include <type_traits>
#include <unordered_map>

namespace gkfs::metadata {

@@ -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

+19 −0
Original line number Diff line number Diff line
@@ -31,6 +31,10 @@ namespace data {
class ChunkStorage;
}

namespace rpc {
class Distributor;
}

namespace daemon {

class FsData {
@@ -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_;
@@ -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;

+2 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#define GEKKOFS_CONFIG_MANAGER_HPP

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

@@ -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
+2 −1
Original line number Diff line number Diff line
@@ -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