libfoedus-core
FOEDUS Core Library
masstree_adopt_impl.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_MASSTREE_ADOPT_IMPL_HPP_
19 #define FOEDUS_STORAGE_MASSTREE_MASSTREE_ADOPT_IMPL_HPP_
20 
21 #include "foedus/error_code.hpp"
24 #include "foedus/thread/fwd.hpp"
26 
27 namespace foedus {
28 namespace storage {
29 namespace masstree {
30 
67 struct Adopt final : public xct::SysxctFunctor {
77 
79  thread::Thread* context,
81  MasstreePage* old)
82  : xct::SysxctFunctor(),
83  context_(context),
84  parent_(parent),
85  old_(old) {
86  }
87  virtual ErrorCode run(xct::SysxctWorkspace* sysxct_workspace) override;
88 
90  uint16_t minipage_index,
91  uint16_t pointer_index);
92 
94  uint16_t minipage_index,
95  uint16_t pointer_index);
96 };
97 
98 } // namespace masstree
99 } // namespace storage
100 } // namespace foedus
101 #endif // FOEDUS_STORAGE_MASSTREE_MASSTREE_ADOPT_IMPL_HPP_
ErrorCode adopt_case_b(uint16_t minipage_index, uint16_t pointer_index)
Adopt(thread::Thread *context, MasstreeIntermediatePage *parent, MasstreePage *old)
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
Represents one thread running on one NUMA core.
Definition: thread.hpp:48
MasstreePage *const old_
The old page that was split, whose foster-twins are being adopted.
Definitions of IDs in this package and a few related constant values.
Common base of MasstreeIntermediatePage and MasstreeBorderPage.
MasstreeIntermediatePage *const parent_
The parent page that currently points to the old page.
A functor representing the logic in a system transaction via virtual-function.
ErrorCode adopt_case_a(uint16_t minipage_index, uint16_t pointer_index)
thread::Thread *const context_
Thread context.
Represents one intermediate page in Masstree Storage.
Forward declarations of classes in masstree storage package.
Forward declarations of classes in thread package.
A system transaction to adopt foster twins into an intermediate page.
ErrorCode
Enum of error codes defined in error_code.xmacro.
Definition: error_code.hpp:85
Per-thread reused work memory for system transactions.
virtual ErrorCode run(xct::SysxctWorkspace *sysxct_workspace) override
Execute the system transaction.