libfoedus-core
FOEDUS Core Library
foedus::snapshot::LogGleanerResource Struct Reference

Local resource for the log gleaner, which runs only in the master node. More...

Detailed Description

Local resource for the log gleaner, which runs only in the master node.

Empty in child nodes.

Definition at line 34 of file log_gleaner_resource.hpp.

#include <log_gleaner_resource.hpp>

Collaboration diagram for foedus::snapshot::LogGleanerResource:

Classes

struct  PerNodeResource
 These buffers are used to read intermediate results from each reducer to compose the root page or other kinds of pages that weren't composed in each reducer (eg. More...
 

Public Types

enum  Constants { kReadBufferInitialSize = 1 << 21, kWriteBufferInitialSize = 1 << 21, kWriteBufferIntermediateInitialSize = 1 << 21 }
 

Public Member Functions

void allocate (uint16_t node_count)
 
void deallocate ()
 

Public Attributes

memory::AlignedMemory work_memory_
 Working memory to be used in gleaner's construct_root(). More...
 
memory::AlignedMemory writer_pool_memory_
 
memory::AlignedMemory writer_intermediate_memory_
 
memory::AlignedMemory tmp_root_page_memory_
 
std::vector< PerNodeResourceper_node_resources_
 

Member Enumeration Documentation

Member Function Documentation

void foedus::snapshot::LogGleanerResource::allocate ( uint16_t  node_count)

Definition at line 23 of file log_gleaner_resource.cpp.

References foedus::memory::AlignedMemory::alloc(), foedus::memory::AlignedMemory::kNumaAllocOnnode, per_node_resources_, tmp_root_page_memory_, work_memory_, writer_intermediate_memory_, and writer_pool_memory_.

Referenced by foedus::snapshot::SnapshotManagerPimpl::initialize_once().

23  {
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 }
memory::AlignedMemory work_memory_
Working memory to be used in gleaner's construct_root().
numa_alloc_onnode() and numa_free().
std::vector< PerNodeResource > per_node_resources_
void alloc(uint64_t size, uint64_t alignment, AllocType alloc_type, int numa_node) noexcept
Allocate a memory, releasing the current memory if exists.

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::snapshot::LogGleanerResource::deallocate ( )

Definition at line 38 of file log_gleaner_resource.cpp.

References per_node_resources_, foedus::memory::AlignedMemory::release_block(), tmp_root_page_memory_, work_memory_, writer_intermediate_memory_, and writer_pool_memory_.

Referenced by foedus::snapshot::SnapshotManagerPimpl::uninitialize_once().

38  {
43  per_node_resources_.clear();
44 }
memory::AlignedMemory work_memory_
Working memory to be used in gleaner's construct_root().
void release_block()
Releases the memory block.
std::vector< PerNodeResource > per_node_resources_

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::vector< PerNodeResource > foedus::snapshot::LogGleanerResource::per_node_resources_
memory::AlignedMemory foedus::snapshot::LogGleanerResource::tmp_root_page_memory_
memory::AlignedMemory foedus::snapshot::LogGleanerResource::work_memory_

Working memory to be used in gleaner's construct_root().

Automatically expand if needed.

Definition at line 65 of file log_gleaner_resource.hpp.

Referenced by allocate(), foedus::storage::sequential::SequentialComposer::construct_root(), and deallocate().

memory::AlignedMemory foedus::snapshot::LogGleanerResource::writer_intermediate_memory_

Definition at line 67 of file log_gleaner_resource.hpp.

Referenced by allocate(), and deallocate().

memory::AlignedMemory foedus::snapshot::LogGleanerResource::writer_pool_memory_

Definition at line 66 of file log_gleaner_resource.hpp.

Referenced by allocate(), and deallocate().


The documentation for this struct was generated from the following files: