Commit 9a87035c authored by David Auer's avatar David Auer
Browse files

Create randomslicing configuration from hosts file

parent 7a0fc104
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -39,13 +39,24 @@ namespace gkfs::relocation {

void
calculate_random_slicing() {
    auto hosts = read_hosts_file();
    VDRIVE::DistRandSlice dist(true, true);

    VDRIVE::Disk d0(0, 1, nullptr);

    list<VDRIVE::Disk*> disks = {&d0};

    list<VDRIVE::Disk*> disks;
    uint64_t id = -1;
    for(const auto& host : hosts) {
        auto first = host.first;
        auto second = host.second;
        disks.emplace_back(new VDRIVE::Disk(++id, 1, nullptr /*host.second*/));
        cout << second << "\n";
    }
    // Add Disks
    dist.setConfiguration(&disks, 1, 1);
    for(auto disk : disks) {
        delete disk;
    }

    dist.to_file(GKFS_DATA->hosts_file() + ".rsconfig");
}

vector<pair<string, string>>