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

Shared data for LogReducer. More...

Detailed Description

Shared data for LogReducer.

One instance in each node memory. The actual reducer buffers are allocated separately because they are much bigger.

Definition at line 159 of file log_reducer_impl.hpp.

#include <log_reducer_impl.hpp>

Public Member Functions

 LogReducerControlBlock ()=delete
 
 ~LogReducerControlBlock ()=delete
 
void initialize ()
 
void clear ()
 
void uninitialize ()
 
ReducerBufferStatus get_buffer_status_atomic (uint32_t index) const
 
std::atomic< uint64_t > * get_buffer_status_address (uint32_t index)
 
ReducerBufferStatus get_current_buffer_status () const
 
ReducerBufferStatus get_non_current_buffer_status () const
 

Public Attributes

std::atomic< uint64_t > buffer_status_ [2]
 Status of the two reducer buffers. More...
 
std::atomic< uint32_t > current_buffer_
 buffers_[current_buffer_ % 2] is the buffer mappers should append to. More...
 
std::atomic< uint32_t > total_storage_count_
 Set at the end of merge_sort(). More...
 
uint16_t id_
 ID of this reducer (or numa node ID). More...
 

Constructor & Destructor Documentation

foedus::snapshot::LogReducerControlBlock::LogReducerControlBlock ( )
delete
foedus::snapshot::LogReducerControlBlock::~LogReducerControlBlock ( )
delete

Member Function Documentation

void foedus::snapshot::LogReducerControlBlock::clear ( )
inline

Definition at line 167 of file log_reducer_impl.hpp.

References buffer_status_, current_buffer_, and total_storage_count_.

Referenced by foedus::snapshot::LogReducerRef::clear(), and initialize().

167  {
168  current_buffer_ = 0;
169  buffer_status_[0].store(0U);
170  buffer_status_[1].store(0U);
172  }
std::atomic< uint32_t > current_buffer_
buffers_[current_buffer_ % 2] is the buffer mappers should append to.
std::atomic< uint64_t > buffer_status_[2]
Status of the two reducer buffers.
std::atomic< uint32_t > total_storage_count_
Set at the end of merge_sort().

Here is the caller graph for this function:

std::atomic<uint64_t>* foedus::snapshot::LogReducerControlBlock::get_buffer_status_address ( uint32_t  index)
inline

Definition at line 181 of file log_reducer_impl.hpp.

References buffer_status_.

Referenced by foedus::snapshot::LogReducerRef::append_log_chunk().

181  {
182  return &buffer_status_[index % 2];
183  }
std::atomic< uint64_t > buffer_status_[2]
Status of the two reducer buffers.

Here is the caller graph for this function:

ReducerBufferStatus foedus::snapshot::LogReducerControlBlock::get_buffer_status_atomic ( uint32_t  index) const
inline

Definition at line 176 of file log_reducer_impl.hpp.

References buffer_status_, and foedus::snapshot::ReducerBufferStatus::word.

Referenced by foedus::snapshot::LogReducerRef::append_log_chunk(), get_current_buffer_status(), and get_non_current_buffer_status().

176  {
177  ReducerBufferStatus ret;
178  ret.word = buffer_status_[index % 2].load();
179  return ret;
180  }
std::atomic< uint64_t > buffer_status_[2]
Status of the two reducer buffers.

Here is the caller graph for this function:

ReducerBufferStatus foedus::snapshot::LogReducerControlBlock::get_current_buffer_status ( ) const
inline

Definition at line 185 of file log_reducer_impl.hpp.

References current_buffer_, and get_buffer_status_atomic().

Referenced by foedus::snapshot::LogReducer::handle_process().

185  {
187  }
std::atomic< uint32_t > current_buffer_
buffers_[current_buffer_ % 2] is the buffer mappers should append to.
ReducerBufferStatus get_buffer_status_atomic(uint32_t index) const

Here is the call graph for this function:

Here is the caller graph for this function:

ReducerBufferStatus foedus::snapshot::LogReducerControlBlock::get_non_current_buffer_status ( ) const
inline

Definition at line 188 of file log_reducer_impl.hpp.

References current_buffer_, and get_buffer_status_atomic().

Referenced by foedus::snapshot::LogReducer::handle_process().

188  {
190  }
std::atomic< uint32_t > current_buffer_
buffers_[current_buffer_ % 2] is the buffer mappers should append to.
ReducerBufferStatus get_buffer_status_atomic(uint32_t index) const

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::snapshot::LogReducerControlBlock::initialize ( )
inline

Definition at line 164 of file log_reducer_impl.hpp.

References clear().

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

164  {
165  clear();
166  }

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::snapshot::LogReducerControlBlock::uninitialize ( )
inline

Definition at line 173 of file log_reducer_impl.hpp.

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

173  {
174  }

Here is the caller graph for this function:

Member Data Documentation

std::atomic<uint64_t> foedus::snapshot::LogReducerControlBlock::buffer_status_[2]

Status of the two reducer buffers.

actually of type ReducerBufferStatus.

Definition at line 196 of file log_reducer_impl.hpp.

Referenced by clear(), get_buffer_status_address(), and get_buffer_status_atomic().

std::atomic<uint32_t> foedus::snapshot::LogReducerControlBlock::current_buffer_

buffers_[current_buffer_ % 2] is the buffer mappers should append to.

This value increases for every buffer switch.

Definition at line 202 of file log_reducer_impl.hpp.

Referenced by clear(), foedus::snapshot::LogReducerRef::get_current_buffer_index_atomic(), get_current_buffer_status(), get_non_current_buffer_status(), foedus::snapshot::LogReducer::handle_process(), and foedus::snapshot::operator<<().

uint16_t foedus::snapshot::LogReducerControlBlock::id_

ID of this reducer (or numa node ID).

not mutable, just for convenience.

Definition at line 212 of file log_reducer_impl.hpp.

Referenced by foedus::snapshot::LogReducerRef::get_id(), and foedus::snapshot::LogReducer::initialize_once().

std::atomic<uint32_t> foedus::snapshot::LogReducerControlBlock::total_storage_count_

Set at the end of merge_sort().

Total number of storages this reducer has merged and composed. This is also the number of root-info pages this reducer has produced.

Definition at line 209 of file log_reducer_impl.hpp.

Referenced by clear(), foedus::snapshot::LogReducerRef::get_total_storage_count(), and foedus::snapshot::operator<<().


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