fake-kv.cpp 615 Bytes
Newer Older
1 2 3 4 5 6
#include "src/server/core/fake-kv.hpp"

bool operator<(const segment_key_t& s1, const segment_key_t& s2) {
    // sort by oid first
    if(s1.oid != s2.oid)
        return s1.oid < s2.oid;
7
    return s1.timestamp > s2.timestamp;
8 9 10 11 12 13 14 15 16 17
}

bool operator<(const omap_key_t& k1, const omap_key_t& k2) {
    if(k1.oid != k2.oid)
        return k1.oid < k2.oid;
    return k1.key < k2.key;
}

std::map<oid_t, std::string>                    oid_map;
std::map<std::string, oid_t>                    name_map;
Matthieu Dorier's avatar
Matthieu Dorier committed
18
std::map<segment_key_t, bake_region_id_t>       segment_map;
19
std::map<omap_key_t, std::vector<char>>         omap_map;