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

Shared data in SnapshotManagerPimpl. More...

Detailed Description

Shared data in SnapshotManagerPimpl.

Definition at line 120 of file snapshot_manager_pimpl.hpp.

#include <snapshot_manager_pimpl.hpp>

Collaboration diagram for foedus::snapshot::SnapshotManagerControlBlock:

Public Member Functions

 SnapshotManagerControlBlock ()=delete
 
 ~SnapshotManagerControlBlock ()=delete
 
void initialize ()
 
void uninitialize ()
 
Epoch get_snapshot_epoch () const
 
Epoch get_snapshot_epoch_weak () const
 
SnapshotId get_previous_snapshot_id () const
 
SnapshotId get_previous_snapshot_id_weak () const
 
Epoch get_requested_snapshot_epoch () const
 
void wakeup_snapshot_children ()
 Fires snapshot_children_wakeup_. More...
 

Public Attributes

std::atomic< Epoch::EpochIntegersnapshot_epoch_
 The most recently snapshot-ed epoch, all logs upto this epoch is safe to delete. More...
 
std::atomic< Epoch::EpochIntegerrequested_snapshot_epoch_
 When a caller wants to immediately invoke snapshot, it calls trigger_snapshot_immediate(), which sets this value and then wakes up snapshot_thread_. More...
 
std::atomic< SnapshotIdprevious_snapshot_id_
 ID of previously completed snapshot. More...
 
soc::SharedPolling snapshot_taken_
 Fired (notify_all) whenever snapshotting is completed. More...
 
soc::SharedPolling snapshot_wakeup_
 Snapshot thread sleeps on this condition variable. More...
 
soc::SharedPolling snapshot_children_wakeup_
 Child snapshot managers (the ones in SOC engines) sleep on this condition until the master snapshot manager requests them to launch mappers/reducers for snapshot. More...
 
LogGleanerControlBlock gleaner_
 Gleaner-related variables. More...
 

Constructor & Destructor Documentation

foedus::snapshot::SnapshotManagerControlBlock::SnapshotManagerControlBlock ( )
delete
foedus::snapshot::SnapshotManagerControlBlock::~SnapshotManagerControlBlock ( )
delete

Member Function Documentation

SnapshotId foedus::snapshot::SnapshotManagerControlBlock::get_previous_snapshot_id ( ) const
inline

Definition at line 140 of file snapshot_manager_pimpl.hpp.

References previous_snapshot_id_.

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

140 { return previous_snapshot_id_.load(); }
std::atomic< SnapshotId > previous_snapshot_id_
ID of previously completed snapshot.

Here is the caller graph for this function:

SnapshotId foedus::snapshot::SnapshotManagerControlBlock::get_previous_snapshot_id_weak ( ) const
inline

Definition at line 141 of file snapshot_manager_pimpl.hpp.

References previous_snapshot_id_.

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

141  {
142  return previous_snapshot_id_.load(std::memory_order_relaxed);
143  }
std::atomic< SnapshotId > previous_snapshot_id_
ID of previously completed snapshot.

Here is the caller graph for this function:

Epoch foedus::snapshot::SnapshotManagerControlBlock::get_requested_snapshot_epoch ( ) const
inline

Definition at line 144 of file snapshot_manager_pimpl.hpp.

References requested_snapshot_epoch_.

Referenced by foedus::snapshot::SnapshotManagerPimpl::handle_snapshot(), and foedus::snapshot::SnapshotManagerPimpl::handle_snapshot_triggered().

144 { return Epoch(requested_snapshot_epoch_.load()); }
std::atomic< Epoch::EpochInteger > requested_snapshot_epoch_
When a caller wants to immediately invoke snapshot, it calls trigger_snapshot_immediate(), which sets this value and then wakes up snapshot_thread_.

Here is the caller graph for this function:

Epoch foedus::snapshot::SnapshotManagerControlBlock::get_snapshot_epoch ( ) const
inline

Definition at line 136 of file snapshot_manager_pimpl.hpp.

References snapshot_epoch_.

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

136 { return Epoch(snapshot_epoch_.load()); }
std::atomic< Epoch::EpochInteger > snapshot_epoch_
The most recently snapshot-ed epoch, all logs upto this epoch is safe to delete.

Here is the caller graph for this function:

Epoch foedus::snapshot::SnapshotManagerControlBlock::get_snapshot_epoch_weak ( ) const
inline

Definition at line 137 of file snapshot_manager_pimpl.hpp.

References snapshot_epoch_.

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

137  {
138  return Epoch(snapshot_epoch_.load(std::memory_order_relaxed));
139  }
std::atomic< Epoch::EpochInteger > snapshot_epoch_
The most recently snapshot-ed epoch, all logs upto this epoch is safe to delete.

Here is the caller graph for this function:

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

Definition at line 125 of file snapshot_manager_pimpl.hpp.

References gleaner_, foedus::snapshot::LogGleanerControlBlock::initialize(), foedus::soc::SharedPolling::initialize(), foedus::Epoch::kEpochInvalid, requested_snapshot_epoch_, snapshot_children_wakeup_, snapshot_taken_, and snapshot_wakeup_.

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

125  {
131  }
Zero is always reserved for invalid epoch.
Definition: epoch.hpp:68
LogGleanerControlBlock gleaner_
Gleaner-related variables.
soc::SharedPolling snapshot_wakeup_
Snapshot thread sleeps on this condition variable.
std::atomic< Epoch::EpochInteger > requested_snapshot_epoch_
When a caller wants to immediately invoke snapshot, it calls trigger_snapshot_immediate(), which sets this value and then wakes up snapshot_thread_.
soc::SharedPolling snapshot_taken_
Fired (notify_all) whenever snapshotting is completed.
soc::SharedPolling snapshot_children_wakeup_
Child snapshot managers (the ones in SOC engines) sleep on this condition until the master snapshot m...

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 132 of file snapshot_manager_pimpl.hpp.

References gleaner_, and foedus::snapshot::LogGleanerControlBlock::uninitialize().

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

132  {
134  }
LogGleanerControlBlock gleaner_
Gleaner-related variables.

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::snapshot::SnapshotManagerControlBlock::wakeup_snapshot_children ( )
inline

Fires snapshot_children_wakeup_.

This is n-to-n condition variable, so expect spurrious wakeups.

Definition at line 150 of file snapshot_manager_pimpl.hpp.

References foedus::assorted::memory_fence_release(), foedus::soc::SharedPolling::signal(), and snapshot_children_wakeup_.

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

150  {
153  }
soc::SharedPolling snapshot_children_wakeup_
Child snapshot managers (the ones in SOC engines) sleep on this condition until the master snapshot m...
void memory_fence_release()
Equivalent to std::atomic_thread_fence(std::memory_order_release).
void signal()
Signal it to let waiters exit.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::atomic<SnapshotId> foedus::snapshot::SnapshotManagerControlBlock::previous_snapshot_id_
std::atomic< Epoch::EpochInteger > foedus::snapshot::SnapshotManagerControlBlock::requested_snapshot_epoch_

When a caller wants to immediately invoke snapshot, it calls trigger_snapshot_immediate(), which sets this value and then wakes up snapshot_thread_.

snapshot_thread_ sees this value then immediately starts snapshotting if the value is larger than the current snapshot_epoch_.

Definition at line 168 of file snapshot_manager_pimpl.hpp.

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

soc::SharedPolling foedus::snapshot::SnapshotManagerControlBlock::snapshot_children_wakeup_

Child snapshot managers (the ones in SOC engines) sleep on this condition until the master snapshot manager requests them to launch mappers/reducers for snapshot.

The real condition is the various status flag in gleaner_.

Definition at line 191 of file snapshot_manager_pimpl.hpp.

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

std::atomic< Epoch::EpochInteger > foedus::snapshot::SnapshotManagerControlBlock::snapshot_epoch_

The most recently snapshot-ed epoch, all logs upto this epoch is safe to delete.

If not snapshot has been taken, invalid epoch. This is equivalent to snapshots_.back().valid_entil_epoch_ with empty check.

Definition at line 160 of file snapshot_manager_pimpl.hpp.

Referenced by get_snapshot_epoch(), get_snapshot_epoch_weak(), foedus::snapshot::SnapshotManagerPimpl::handle_snapshot_triggered(), and foedus::snapshot::SnapshotManagerPimpl::initialize_once().

soc::SharedPolling foedus::snapshot::SnapshotManagerControlBlock::snapshot_taken_
soc::SharedPolling foedus::snapshot::SnapshotManagerControlBlock::snapshot_wakeup_

Snapshot thread sleeps on this condition variable.

The real variable is requested_snapshot_epoch_.

Definition at line 184 of file snapshot_manager_pimpl.hpp.

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


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