libfoedus-core
FOEDUS Core Library
log_gleaner_resource.cpp
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  */
19 
20 namespace foedus {
21 namespace snapshot {
22 
23 void LogGleanerResource::allocate(uint16_t node_count) {
24  // Combining the root page info doesn't require much memory, so this size should be enough.
26 
27  // As construct_root() just writes out root pages, it won't require large buffer.
28  // Especially, no buffer for intermediate pages required.
32 
33  for (uint16_t i = 0; i < node_count; ++i) {
34  per_node_resources_.emplace_back(i);
35  }
36 }
37 
43  per_node_resources_.clear();
44 }
45 
47  : numa_node_(numa_node) {
50  1U << 21,
51  numa_node);
54  1U << 21,
55  numa_node);
58  1U << 21,
59  numa_node);
60 }
61 
62 } // namespace snapshot
63 } // namespace foedus
memory::AlignedMemory work_memory_
Working memory to be used in gleaner's construct_root().
numa_alloc_onnode() and numa_free().
void release_block()
Releases the memory block.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
memory::AlignedMemory write_buffer_
used for writing out pages that have no children
std::vector< PerNodeResource > per_node_resources_
memory::AlignedMemory read_buffer_
used for reading intermediate results frome each reducer.
void alloc(uint64_t size, uint64_t alignment, AllocType alloc_type, int numa_node) noexcept
Allocate a memory, releasing the current memory if exists.
memory::AlignedMemory write_intermediate_buffer_
used for writing out pages that have children
void alloc_onnode(uint64_t size, uint64_t alignment, int numa_node) noexcept
Short for alloc(kNumaAllocOnnode)