libfoedus-core
FOEDUS Core Library
|
A view of Logger object for other SOCs and master engine. More...
A view of Logger object for other SOCs and master engine.
Definition at line 35 of file logger_ref.hpp.
#include <logger_ref.hpp>
Public Member Functions | |
LoggerRef () | |
LoggerRef (Engine *engine, LoggerControlBlock *block, LoggerId id, uint16_t numa_node, uint16_t in_node_ordinal) | |
Epoch | get_durable_epoch () const |
Returns this logger's durable epoch. More... | |
void | wakeup () |
Wakes up this logger if it is sleeping. More... | |
void | wakeup_for_durable_epoch (Epoch desired_durable_epoch) |
Wakes up this logger if its durable_epoch has not reached the given epoch yet. More... | |
void | copy_logger_state (savepoint::Savepoint *new_savepoint) const |
Called from log manager's copy_logger_states. More... | |
void | add_epoch_history (const EpochMarkerLogType &epoch_marker) |
Append a new epoch history. More... | |
LogRange | get_log_range (Epoch prev_epoch, Epoch until_epoch) |
Constructs the range of log entries that represent the given epoch ranges. More... | |
![]() | |
Attachable () | |
Attachable (Engine *engine) | |
Attachable (Engine *engine, LoggerControlBlock *control_block) | |
Attachable (LoggerControlBlock *control_block) | |
Attachable (const Attachable &other) | |
virtual | ~Attachable () |
Attachable & | operator= (const Attachable &other) |
virtual void | attach (LoggerControlBlock *control_block) |
Attaches to the given shared memory. More... | |
bool | is_attached () const |
Returns whether the object has been already attached to some shared memory. More... | |
LoggerControlBlock * | get_control_block () const |
Engine * | get_engine () const |
void | set_engine (Engine *engine) |
Protected Attributes | |
LoggerId | id_ |
uint16_t | numa_node_ |
uint16_t | in_node_ordinal_ |
![]() | |
Engine * | engine_ |
Most attachable object stores an engine pointer (local engine), so we define it here. More... | |
LoggerControlBlock * | control_block_ |
The shared data on shared memory that has been initialized in some SOC or master engine. More... | |
foedus::log::LoggerRef::LoggerRef | ( | ) |
Definition at line 28 of file logger_ref.cpp.
foedus::log::LoggerRef::LoggerRef | ( | Engine * | engine, |
LoggerControlBlock * | block, | ||
LoggerId | id, | ||
uint16_t | numa_node, | ||
uint16_t | in_node_ordinal | ||
) |
void foedus::log::LoggerRef::add_epoch_history | ( | const EpochMarkerLogType & | epoch_marker | ) |
Append a new epoch history.
Definition at line 65 of file logger_ref.cpp.
References ASSERT_ND, foedus::Attachable< LoggerControlBlock >::control_block_, id_, foedus::log::LoggerControlBlock::kMaxEpochHistory, foedus::log::EpochMarkerLogType::new_epoch_, and foedus::log::EpochMarkerLogType::old_epoch_.
Referenced by foedus::log::EpochMarkerLogType::apply_engine().
void foedus::log::LoggerRef::copy_logger_state | ( | savepoint::Savepoint * | new_savepoint | ) | const |
Called from log manager's copy_logger_states.
Definition at line 56 of file logger_ref.cpp.
References foedus::Attachable< LoggerControlBlock >::control_block_, foedus::savepoint::Savepoint::current_log_files_, foedus::savepoint::Savepoint::current_log_files_offset_durable_, foedus::savepoint::Savepoint::oldest_log_files_, and foedus::savepoint::Savepoint::oldest_log_files_offset_begin_.
Epoch foedus::log::LoggerRef::get_durable_epoch | ( | ) | const |
Returns this logger's durable epoch.
Definition at line 41 of file logger_ref.cpp.
References foedus::Attachable< LoggerControlBlock >::control_block_.
Referenced by get_log_range(), foedus::log::operator<<(), and wakeup_for_durable_epoch().
Constructs the range of log entries that represent the given epoch ranges.
[in] | prev_epoch | Log entries until this epoch are skipped. An invalid epoch means from the beginning. |
[in] | until_epoch | Log entries until this epoch are contained. Must be valid. |
In case there is no ending epoch marker (only when marked_epoch_ < durable_epoch_.one_more()) this method writes out a new epoch marker. This method is called only for each snapshotting, so it shouldn't be too big a waste.
Definition at line 91 of file logger_ref.cpp.
References ASSERT_ND, foedus::log::LogRange::begin_file_ordinal, foedus::log::LogRange::begin_offset, foedus::Attachable< LoggerControlBlock >::control_block_, foedus::log::LogRange::end_file_ordinal, foedus::log::LogRange::end_offset, get_durable_epoch(), id_, foedus::Epoch::is_valid(), foedus::log::EpochHistory::log_file_offset_, foedus::log::EpochHistory::log_file_ordinal_, and foedus::log::EpochHistory::new_epoch_.
Referenced by foedus::snapshot::LogMapper::handle_process().
void foedus::log::LoggerRef::wakeup | ( | ) |
Wakes up this logger if it is sleeping.
Definition at line 52 of file logger_ref.cpp.
References foedus::Attachable< LoggerControlBlock >::control_block_.
Referenced by wakeup_for_durable_epoch().
void foedus::log::LoggerRef::wakeup_for_durable_epoch | ( | Epoch | desired_durable_epoch | ) |
Wakes up this logger if its durable_epoch has not reached the given epoch yet.
If this logger's durable_epoch is already same or larger than the epoch, does nothing. This method just wakes up the logger and immediately returns.
Definition at line 45 of file logger_ref.cpp.
References get_durable_epoch(), foedus::assorted::memory_fence_acquire(), and wakeup().
|
protected |
Definition at line 83 of file logger_ref.hpp.
Referenced by add_epoch_history(), get_log_range(), foedus::log::Logger::initialize_once(), LoggerRef(), foedus::log::operator<<(), and foedus::log::Logger::uninitialize_once().
|
protected |
Definition at line 85 of file logger_ref.hpp.
Referenced by LoggerRef(), and foedus::log::operator<<().
|
protected |
Definition at line 84 of file logger_ref.hpp.
Referenced by foedus::log::Logger::initialize_once(), LoggerRef(), and foedus::log::operator<<().