libfoedus-core
FOEDUS Core Library
masstree_record_location.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2015, Hewlett-Packard Development Company, LP.
3  * This program is free software; you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by the Free
5  * Software Foundation; either version 2 of the License, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11  * more details. You should have received a copy of the GNU General Public
12  * License along with this program; if not, write to the Free Software
13  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14  *
15  * HP designates this particular file as subject to the "Classpath" exception
16  * as provided by HP in the LICENSE.txt file that accompanied this code.
17  */
18 #ifndef FOEDUS_STORAGE_MASSTREE_RECORD_LOCATION_HPP_
19 #define FOEDUS_STORAGE_MASSTREE_RECORD_LOCATION_HPP_
20 
21 #include "foedus/cxx11.hpp"
22 #include "foedus/error_code.hpp"
25 #include "foedus/xct/fwd.hpp"
26 #include "foedus/xct/xct_id.hpp"
27 
28 namespace foedus {
29 namespace storage {
30 namespace masstree {
31 
49 
55 
56  bool is_found() const { return index_ != kBorderPageMaxSlots; }
57  void clear() {
58  page_ = CXX11_NULLPTR;
59  index_ = kBorderPageMaxSlots;
60  observed_.data_ = 0;
61  readset_ = CXX11_NULLPTR;
62  }
63 
69  xct::Xct* cur_xct,
70  MasstreeBorderPage* page,
71  SlotIndex index,
72  bool intended_for_write);
73 };
74 
75 } // namespace masstree
76 } // namespace storage
77 } // namespace foedus
78 #endif // FOEDUS_STORAGE_MASSTREE_RECORD_LOCATION_HPP_
uint16_t SlotIndex
Index of a record in a (border) page.
#define CXX11_NULLPTR
Used in public headers in place of "nullptr" of C++11.
Definition: cxx11.hpp:132
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
Forward declarations of classes in transaction package.
Represents a user transaction.
Definition: xct.hpp:58
Persistent status part of Transaction ID.
Definition: xct_id.hpp:955
Represents one border page in Masstree Storage.
Represents a record of read-access during a transaction.
Definition: xct_access.hpp:139
Definitions of IDs in this package and a few related constant values.
xct::ReadXctAccess * readset_
If this method took a read-set on the returned record, points to the corresponding read-set...
Definitions of IDs in this package and a few related constant values.
const SlotIndex kBorderPageMaxSlots
Maximum number of slots in one MasstreeBorderPage.
SlotIndex index_
Index of the record in the page.
Forward declarations of classes in masstree storage package.
MasstreeBorderPage * page_
The border page containing the record.
xct::XctId observed_
TID as of locate_record() identifying the record.
return value of MasstreeStoragePimpl::locate_record()/reserve_record().
ErrorCode
Enum of error codes defined in error_code.xmacro.
Definition: error_code.hpp:85
ErrorCode populate_logical(xct::Xct *cur_xct, MasstreeBorderPage *page, SlotIndex index, bool intended_for_write)
Populates the result with XID and possibly readset.