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
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
16 #ifndef MASSTREE_CHECKPOINT_HH
17 #define MASSTREE_CHECKPOINT_HH
23 kvout *vals; // key, val, timestamp in msgpack
24 uint64_t count; // total nodes written
26 pthread_cond_t state_cond;
32 template <typename SS, typename K>
33 void visit_leaf(const SS&, const K&, threadinfo&) {
35 bool visit_value(Str key, const row_type* value, threadinfo& ti);
38 static void insert(T& table, msgpack::parser& par, threadinfo& ti);
42 void ckstate::insert(T& table, msgpack::parser& par, threadinfo& ti) {
46 row_type* row = row_type::checkpoint_read(par, ts, ti);
48 typename T::cursor_type lp(table, key);
49 bool found = lp.find_insert(ti);
50 masstree_invariant(!found); (void) found;
51 ti.advance_timestamp(lp.node_timestamp());