forked from fastio/1store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cache.cc
49 lines (48 loc) · 1.51 KB
/
cache.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "cache.hh"
#include <limits>
#include "column_family.hh"
namespace redis {
cache_entry::cache_entry(cache_entry&& o) noexcept
: _cache_link()
, _type(o._type)
, _key(std::move(_key))
, _key_hash(std::move(o._key_hash))
{
switch (_type) {
case data_type::numeric:
_u._float_number = std::move(o._u._float_number);
break;
case data_type::int64:
_u._integer_number = std::move(o._u._integer_number);
break;
case data_type::bytes:
case data_type::hll:
_u._bytes = std::move(o._u._bytes);
break;
case data_type::list:
_u._list = std::move(o._u._list);
break;
case data_type::dict:
case data_type::set:
_u._dict = std::move(o._u._dict);
break;
case data_type::sset:
_u._sset = std::move(o._u._sset);
break;
default:
break;
}
/*
using container_type = boost::intrusive::unordered_set<cache_entry,
boost::intrusive::member_hook<cache_entry, cache_entry::hook_type, &cache_entry::_cache_link>,
boost::intrusive::power_2_buckets<true>,
boost::intrusive::constant_time_size<true>>;
container_type::node_algorithms::replace_node(o._cache_link.this_ptr(), _cache_link.this_ptr());
container_type::node_algorithms::init(o._cache_link.this_ptr());
*/
}
future<> cache::flush_dirty_entry(store::column_family& cf)
{
return make_ready_future<>();
}
}