edits
[c11concurrency-benchmarks.git] / silo / masstree / checkpoint.cc
1 /* Masstree
2  * Eddie Kohler, Yandong Mao, Robert Morris
3  * Copyright (c) 2012-2013 President and Fellows of Harvard College
4  * Copyright (c) 2012-2013 Massachusetts Institute of Technology
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, subject to the conditions
9  * listed in the Masstree LICENSE file. These conditions include: you must
10  * preserve this copyright notice, and you cannot mention the copyright
11  * holders in advertising related to the Software without their permission.
12  * The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This
13  * notice is a summary of the Masstree LICENSE file; the license in that file
14  * is legally binding.
15  */
16 #include "checkpoint.hh"
17
18 // add one key/value to a checkpoint.
19 // called by checkpoint_tree() for each node.
20 bool ckstate::visit_value(Str key, const row_type* value, threadinfo&) {
21     if (endkey && key >= endkey)
22         return false;
23     if (!row_is_marker(value)) {
24         msgpack::unparser<kvout> up(*vals);
25         up.write(key).write_wide(value->timestamp());
26         value->checkpoint_write(up);
27         ++count;
28     }
29     return true;
30 }