libfoedus-core
FOEDUS Core Library
masstree_grow_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_GROW_IMPL_HPP_
19 #define FOEDUS_STORAGE_MASSTREE_MASSTREE_GROW_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 
49 struct GrowFirstLayerRoot final : public xct::SysxctFunctor {
54 
56  : xct::SysxctFunctor(),
57  context_(context),
58  storage_id_(storage_id) {
59  }
60  virtual ErrorCode run(xct::SysxctWorkspace* sysxct_workspace) override;
61 };
62 
63 
89  const uint16_t pointer_index_;
90 
92  thread::Thread* context,
93  MasstreeBorderPage* parent,
94  uint16_t pointer_index)
95  : xct::SysxctFunctor(),
96  context_(context),
97  parent_(parent),
98  pointer_index_(pointer_index) {
99  }
100  virtual ErrorCode run(xct::SysxctWorkspace* sysxct_workspace) override;
101 };
102 
103 
104 } // namespace masstree
105 } // namespace storage
106 } // namespace foedus
107 #endif // FOEDUS_STORAGE_MASSTREE_MASSTREE_GROW_IMPL_HPP_
virtual ErrorCode run(xct::SysxctWorkspace *sysxct_workspace) override
Execute the system transaction.
thread::Thread *const context_
Thread context.
uint32_t StorageId
Unique ID for storage.
Definition: storage_id.hpp:55
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
Represents one border page in Masstree Storage.
Definitions of IDs in this package and a few related constant values.
A functor representing the logic in a system transaction via virtual-function.
MasstreeBorderPage *const parent_
The border page of the parent layer.
GrowFirstLayerRoot(thread::Thread *context, StorageId storage_id)
const uint16_t pointer_index_
Index of the pointer in parent.
GrowNonFirstLayerRoot(thread::Thread *context, MasstreeBorderPage *parent, uint16_t pointer_index)
A system transaction to grow a first-layer root.
A system transaction to grow a second- or depper-layer root.
virtual ErrorCode run(xct::SysxctWorkspace *sysxct_workspace) override
Execute the system transaction.
Forward declarations of classes in masstree storage package.
Forward declarations of classes in thread package.
thread::Thread *const context_
Thread context.
StorageId storage_id_
ID of the masstree storage to grow.
ErrorCode
Enum of error codes defined in error_code.xmacro.
Definition: error_code.hpp:85
Per-thread reused work memory for system transactions.