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

Shared data for LogGleaner. More...

Detailed Description

Shared data for LogGleaner.

Definition at line 45 of file snapshot_manager_pimpl.hpp.

#include <snapshot_manager_pimpl.hpp>

Collaboration diagram for foedus::snapshot::LogGleanerControlBlock:

Public Member Functions

 LogGleanerControlBlock ()=delete
 
 ~LogGleanerControlBlock ()=delete
 
void initialize ()
 
void uninitialize ()
 
void clear_counts ()
 
bool is_error () const
 If this returns true, all mappers and reducers should exit as soon as possible. More...
 

Public Attributes

std::atomic< bool > gleaning_
 Whether the log gleaner is now running. More...
 
std::atomic< bool > cancelled_
 Whether the log gleaner has been cancalled. More...
 
std::atomic< bool > terminating_
 Whether the engine is being terminated. More...
 
Snapshot cur_snapshot_
 The snapshot we are now taking. More...
 
std::atomic< uint16_t > completed_count_
 count of mappers/reducers that have completed processing the current epoch. More...
 
std::atomic< uint16_t > completed_mapper_count_
 We also have a separate count for mappers only to know if all mappers are done. More...
 
std::atomic< uint16_t > error_count_
 count of mappers/reducers that have exitted with some error. More...
 
std::atomic< uint16_t > exit_count_
 count of mappers/reducers that have exitted. More...
 
uint16_t mappers_count_
 Total number of mappers. More...
 
uint16_t reducers_count_
 Total number of mappers. More...
 
uint16_t all_count_
 mappers_count_ + reducers_count_. More...
 

Constructor & Destructor Documentation

foedus::snapshot::LogGleanerControlBlock::LogGleanerControlBlock ( )
delete
foedus::snapshot::LogGleanerControlBlock::~LogGleanerControlBlock ( )
delete

Member Function Documentation

void foedus::snapshot::LogGleanerControlBlock::clear_counts ( )
inline

Definition at line 59 of file snapshot_manager_pimpl.hpp.

References cancelled_, foedus::snapshot::Snapshot::clear(), completed_count_, completed_mapper_count_, cur_snapshot_, error_count_, exit_count_, and gleaning_.

Referenced by initialize().

59  {
61  completed_count_ = 0;
63  error_count_ = 0;
64  exit_count_ = 0;
65  gleaning_ = false;
66  cancelled_ = false;
67  }
std::atomic< bool > gleaning_
Whether the log gleaner is now running.
std::atomic< uint16_t > exit_count_
count of mappers/reducers that have exitted.
std::atomic< uint16_t > error_count_
count of mappers/reducers that have exitted with some error.
Snapshot cur_snapshot_
The snapshot we are now taking.
std::atomic< uint16_t > completed_count_
count of mappers/reducers that have completed processing the current epoch.
std::atomic< bool > cancelled_
Whether the log gleaner has been cancalled.
std::atomic< uint16_t > completed_mapper_count_
We also have a separate count for mappers only to know if all mappers are done.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 50 of file snapshot_manager_pimpl.hpp.

References all_count_, clear_counts(), mappers_count_, reducers_count_, and terminating_.

Referenced by foedus::snapshot::SnapshotManagerControlBlock::initialize().

50  {
51  clear_counts();
52  mappers_count_ = 0;
53  reducers_count_ = 0;
54  all_count_ = 0;
55  terminating_ = false;
56  }
uint16_t reducers_count_
Total number of mappers.
uint16_t mappers_count_
Total number of mappers.
uint16_t all_count_
mappers_count_ + reducers_count_.
std::atomic< bool > terminating_
Whether the engine is being terminated.

Here is the call graph for this function:

Here is the caller graph for this function:

bool foedus::snapshot::LogGleanerControlBlock::is_error ( ) const
inline

If this returns true, all mappers and reducers should exit as soon as possible.

Gleaner 'does its best' to wait for the exit of them, and then exit asap, too.

Definition at line 73 of file snapshot_manager_pimpl.hpp.

References cancelled_, error_count_, and terminating_.

73 { return error_count_ > 0 || cancelled_ || terminating_; }
std::atomic< uint16_t > error_count_
count of mappers/reducers that have exitted with some error.
std::atomic< bool > terminating_
Whether the engine is being terminated.
std::atomic< bool > cancelled_
Whether the log gleaner has been cancalled.
void foedus::snapshot::LogGleanerControlBlock::uninitialize ( )
inline

Definition at line 57 of file snapshot_manager_pimpl.hpp.

Referenced by foedus::snapshot::SnapshotManagerControlBlock::uninitialize().

57  {
58  }

Here is the caller graph for this function:

Member Data Documentation

uint16_t foedus::snapshot::LogGleanerControlBlock::all_count_

mappers_count_ + reducers_count_.

Not a mutable information, just for convenience.

Definition at line 116 of file snapshot_manager_pimpl.hpp.

Referenced by initialize(), and foedus::snapshot::SnapshotManagerPimpl::initialize_once().

std::atomic<bool> foedus::snapshot::LogGleanerControlBlock::cancelled_

Whether the log gleaner has been cancalled.

Definition at line 78 of file snapshot_manager_pimpl.hpp.

Referenced by clear_counts(), is_error(), and foedus::snapshot::SnapshotManagerPimpl::stop_snapshot_thread().

std::atomic<uint16_t> foedus::snapshot::LogGleanerControlBlock::completed_count_

count of mappers/reducers that have completed processing the current epoch.

the gleaner thread is woken up when this becomes mappers_.size() + reducers_.size(). the gleaner thread sets this to zero and starts next epoch.

Definition at line 90 of file snapshot_manager_pimpl.hpp.

Referenced by clear_counts(), and foedus::snapshot::operator<<().

std::atomic<uint16_t> foedus::snapshot::LogGleanerControlBlock::completed_mapper_count_

We also have a separate count for mappers only to know if all mappers are done.

Reducers can go into sleep only after all mappers went into sleep (otherwise reducers might receive more logs!), so they have to also check this.

Definition at line 97 of file snapshot_manager_pimpl.hpp.

Referenced by clear_counts(), and foedus::snapshot::operator<<().

Snapshot foedus::snapshot::LogGleanerControlBlock::cur_snapshot_
std::atomic<uint16_t> foedus::snapshot::LogGleanerControlBlock::error_count_

count of mappers/reducers that have exitted with some error.

if there happens any error, gleaner cancels all mappers/reducers.

Definition at line 103 of file snapshot_manager_pimpl.hpp.

Referenced by clear_counts(), is_error(), and foedus::snapshot::operator<<().

std::atomic<uint16_t> foedus::snapshot::LogGleanerControlBlock::exit_count_

count of mappers/reducers that have exitted.

for sanity check only.

Definition at line 109 of file snapshot_manager_pimpl.hpp.

Referenced by clear_counts(), and foedus::snapshot::operator<<().

std::atomic<bool> foedus::snapshot::LogGleanerControlBlock::gleaning_

Whether the log gleaner is now running.

Definition at line 76 of file snapshot_manager_pimpl.hpp.

Referenced by clear_counts(), and foedus::snapshot::SnapshotManagerPimpl::is_gleaning().

uint16_t foedus::snapshot::LogGleanerControlBlock::mappers_count_

Total number of mappers.

Not a mutable information, just for convenience.

Definition at line 112 of file snapshot_manager_pimpl.hpp.

Referenced by initialize(), and foedus::snapshot::SnapshotManagerPimpl::initialize_once().

uint16_t foedus::snapshot::LogGleanerControlBlock::reducers_count_

Total number of mappers.

Not a mutable information, just for convenience.

Definition at line 114 of file snapshot_manager_pimpl.hpp.

Referenced by initialize(), and foedus::snapshot::SnapshotManagerPimpl::initialize_once().

std::atomic<bool> foedus::snapshot::LogGleanerControlBlock::terminating_

Whether the engine is being terminated.

Definition at line 80 of file snapshot_manager_pimpl.hpp.

Referenced by initialize(), is_error(), and foedus::snapshot::SnapshotManagerPimpl::stop_snapshot_thread().


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