libfoedus-core
FOEDUS Core Library
foedus::savepoint::FixedSavepoint Struct Referencefinal

Savepoint that can be stored in shared memory. More...

Detailed Description

Savepoint that can be stored in shared memory.

Definition at line 169 of file savepoint.hpp.

#include <savepoint.hpp>

Collaboration diagram for foedus::savepoint::FixedSavepoint:

Public Member Functions

 FixedSavepoint ()=delete
 
 ~FixedSavepoint ()=delete
 
uint32_t get_total_logger_count () const
 
void update (uint16_t node_count, uint16_t loggers_per_node_count, const Savepoint &src)
 Write out the content of the given Savepoint to this object. More...
 

Public Attributes

Epoch::EpochInteger current_epoch_
 
Epoch::EpochInteger durable_epoch_
 
Epoch::EpochInteger earliest_epoch_
 
snapshot::SnapshotId latest_snapshot_id_
 
Epoch::EpochInteger latest_snapshot_epoch_
 
uint16_t node_count_
 Number of NUMA nodes. More...
 
uint16_t loggers_per_node_count_
 Number of loggers per node. More...
 
uint64_t meta_log_oldest_offset_
 
uint64_t meta_log_durable_offset_
 
LoggerSavepointInfo logger_info_ [1U<< 16]
 Stores all loggers' information. More...
 

Constructor & Destructor Documentation

foedus::savepoint::FixedSavepoint::FixedSavepoint ( )
delete
foedus::savepoint::FixedSavepoint::~FixedSavepoint ( )
delete

Member Function Documentation

uint32_t foedus::savepoint::FixedSavepoint::get_total_logger_count ( ) const
inline

Definition at line 195 of file savepoint.hpp.

References node_count_.

Referenced by update().

195  {
196  return static_cast<uint32_t>(node_count_) * loggers_per_node_count_;
197  }
uint16_t loggers_per_node_count_
Number of loggers per node.
Definition: savepoint.hpp:183
uint16_t node_count_
Number of NUMA nodes.
Definition: savepoint.hpp:181

Here is the caller graph for this function:

void foedus::savepoint::FixedSavepoint::update ( uint16_t  node_count,
uint16_t  loggers_per_node_count,
const Savepoint src 
)

Write out the content of the given Savepoint to this object.

Definition at line 94 of file savepoint.cpp.

References foedus::savepoint::Savepoint::current_epoch_, current_epoch_, foedus::savepoint::LoggerSavepointInfo::current_log_file_, foedus::savepoint::LoggerSavepointInfo::current_log_file_offset_durable_, foedus::savepoint::Savepoint::current_log_files_, foedus::savepoint::Savepoint::current_log_files_offset_durable_, foedus::savepoint::Savepoint::durable_epoch_, durable_epoch_, foedus::savepoint::Savepoint::earliest_epoch_, earliest_epoch_, get_total_logger_count(), foedus::savepoint::Savepoint::latest_snapshot_epoch_, latest_snapshot_epoch_, foedus::savepoint::Savepoint::latest_snapshot_id_, latest_snapshot_id_, logger_info_, loggers_per_node_count_, foedus::savepoint::Savepoint::meta_log_durable_offset_, meta_log_durable_offset_, foedus::savepoint::Savepoint::meta_log_oldest_offset_, meta_log_oldest_offset_, node_count_, foedus::savepoint::LoggerSavepointInfo::oldest_log_file_, foedus::savepoint::LoggerSavepointInfo::oldest_log_file_offset_begin_, foedus::savepoint::Savepoint::oldest_log_files_, and foedus::savepoint::Savepoint::oldest_log_files_offset_begin_.

Referenced by foedus::savepoint::SavepointManagerPimpl::update_shared_savepoint().

97  {
98  node_count_ = node_count;
99  loggers_per_node_count_ = loggers_per_node_count;
100  current_epoch_ = src.current_epoch_;
101  durable_epoch_ = src.durable_epoch_;
102  earliest_epoch_ = src.earliest_epoch_;
103  latest_snapshot_id_ = src.latest_snapshot_id_;
104  latest_snapshot_epoch_ = src.latest_snapshot_epoch_;
105  meta_log_oldest_offset_ = src.meta_log_oldest_offset_;
106  meta_log_durable_offset_ = src.meta_log_durable_offset_;
107  uint32_t count = get_total_logger_count();
108  for (uint32_t i = 0; i < count; ++i) {
109  logger_info_[i].oldest_log_file_ = src.oldest_log_files_[i];
110  logger_info_[i].oldest_log_file_offset_begin_ = src.oldest_log_files_offset_begin_[i];
111  logger_info_[i].current_log_file_ = src.current_log_files_[i];
112  logger_info_[i].current_log_file_offset_durable_ = src.current_log_files_offset_durable_[i];
113  }
114 }
Epoch::EpochInteger current_epoch_
Definition: savepoint.hpp:174
snapshot::SnapshotId latest_snapshot_id_
Definition: savepoint.hpp:177
log::LogFileOrdinal oldest_log_file_
Ordinal of the oldest active log file in each logger.
Definition: savepoint.hpp:149
uint64_t oldest_log_file_offset_begin_
Indicates the inclusive beginning of active region in the oldest log file.
Definition: savepoint.hpp:155
uint64_t current_log_file_offset_durable_
Indicates the exclusive end of durable region in the current log file.
Definition: savepoint.hpp:162
Epoch::EpochInteger latest_snapshot_epoch_
Definition: savepoint.hpp:178
log::LogFileOrdinal current_log_file_
Indicates the log file each logger is currently appending to.
Definition: savepoint.hpp:152
Epoch::EpochInteger durable_epoch_
Definition: savepoint.hpp:175
uint16_t loggers_per_node_count_
Number of loggers per node.
Definition: savepoint.hpp:183
LoggerSavepointInfo logger_info_[1U<< 16]
Stores all loggers' information.
Definition: savepoint.hpp:193
Epoch::EpochInteger earliest_epoch_
Definition: savepoint.hpp:176
uint32_t get_total_logger_count() const
Definition: savepoint.hpp:195
uint16_t node_count_
Number of NUMA nodes.
Definition: savepoint.hpp:181

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Epoch::EpochInteger foedus::savepoint::FixedSavepoint::current_epoch_

Definition at line 174 of file savepoint.hpp.

Referenced by update().

Epoch::EpochInteger foedus::savepoint::FixedSavepoint::durable_epoch_

Definition at line 175 of file savepoint.hpp.

Referenced by update().

Epoch::EpochInteger foedus::savepoint::FixedSavepoint::earliest_epoch_

Definition at line 176 of file savepoint.hpp.

Referenced by update().

Epoch::EpochInteger foedus::savepoint::FixedSavepoint::latest_snapshot_epoch_
LoggerSavepointInfo foedus::savepoint::FixedSavepoint::logger_info_[1U<< 16]

Stores all loggers' information.

We allocate memory enough for the largest number of loggers. In reality, we are just reading/writing a small piece of it. 24b * 64k = 1.5MB.

Definition at line 193 of file savepoint.hpp.

Referenced by foedus::savepoint::SavepointManagerPimpl::get_logger_savepoint(), and update().

uint16_t foedus::savepoint::FixedSavepoint::loggers_per_node_count_

Number of loggers per node.

same above.

Definition at line 183 of file savepoint.hpp.

Referenced by update().

uint64_t foedus::savepoint::FixedSavepoint::meta_log_durable_offset_
uint64_t foedus::savepoint::FixedSavepoint::meta_log_oldest_offset_
uint16_t foedus::savepoint::FixedSavepoint::node_count_

Number of NUMA nodes.

the information is availble elsewhere, but easier to duplicate here.

Definition at line 181 of file savepoint.hpp.

Referenced by get_total_logger_count(), and update().


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