1/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
3#ident "$Id$"
4/*======
5This file is part of PerconaFT.
6
7
8Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
9
10 PerconaFT is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License, version 2,
12 as published by the Free Software Foundation.
13
14 PerconaFT is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
21
22----------------------------------------
23
24 PerconaFT is free software: you can redistribute it and/or modify
25 it under the terms of the GNU Affero General Public License, version 3,
26 as published by the Free Software Foundation.
27
28 PerconaFT is distributed in the hope that it will be useful,
29 but WITHOUT ANY WARRANTY; without even the implied warranty of
30 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 GNU Affero General Public License for more details.
32
33 You should have received a copy of the GNU Affero General Public License
34 along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
35======= */
36
37#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
38
39/* Purpose of this file is to provide the world with everything necessary
40 * to use the nested transaction logic and nothing else. No internal
41 * requirements of the nested transaction logic belongs here.
42 */
43
44#pragma once
45
46#include "leafentry.h"
47#include "txn/txn_manager.h"
48#include <util/mempool.h>
49
50// opaque handles used by outside world (i.e. indexer)
51typedef struct ule *ULEHANDLE;
52typedef struct uxr *UXRHANDLE;
53
54// create a ULE by copying the contents of the given leafentry
55ULEHANDLE toku_ule_create(LEAFENTRY le);
56
57void toku_ule_free(ULEHANDLE ule_p);
58
59uint64_t ule_num_uxrs(ULEHANDLE ule);
60uint32_t ule_get_num_committed(ULEHANDLE ule);
61uint32_t ule_get_num_provisional(ULEHANDLE ule);
62UXRHANDLE ule_get_uxr(ULEHANDLE ule, uint64_t ith);
63int ule_is_committed(ULEHANDLE ule, uint64_t ith);
64int ule_is_provisional(ULEHANDLE ule, uint64_t ith);
65
66bool uxr_is_insert(UXRHANDLE uxr);
67bool uxr_is_delete(UXRHANDLE uxr);
68bool uxr_is_placeholder(UXRHANDLE uxr);
69void *uxr_get_val(UXRHANDLE uxr);
70uint32_t uxr_get_vallen(UXRHANDLE uxr);
71TXNID uxr_get_txnid(UXRHANDLE uxr);
72
73//1 does much slower debugging
74#define GARBAGE_COLLECTION_DEBUG 0
75