18 #ifndef FOEDUS_SAVEPOINT_SAVEPOINT_HPP_
19 #define FOEDUS_SAVEPOINT_SAVEPOINT_HPP_
123 return (current_epoch_ >= durable_epoch_
124 && current_epoch_ >= earliest_epoch_
125 && durable_epoch_ >= earliest_epoch_
126 && meta_log_oldest_offset_ <= meta_log_durable_offset_
127 && oldest_log_files_.size() == logger_count
128 && oldest_log_files_offset_begin_.size() == logger_count
129 && current_log_files_.size() == logger_count
130 && current_log_files_offset_durable_.size() == logger_count);
196 return static_cast<uint32_t
>(
node_count_) * loggers_per_node_count_;
200 void update(uint16_t node_count, uint16_t loggers_per_node_count,
const Savepoint& src);
205 #endif // FOEDUS_SAVEPOINT_SAVEPOINT_HPP_
std::vector< uint64_t > oldest_log_files_offset_begin_
Indicates the inclusive beginning of active region in the oldest log file.
Epoch::EpochInteger current_epoch_
Represents an object that can be written to and read from files/bytes in XML format.
Typedefs of ID types used in snapshot package.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Epoch get_earliest_epoch() const
std::vector< uint64_t > current_log_files_offset_durable_
Indicates the exclusive end of durable region in the current log file.
snapshot::SnapshotId latest_snapshot_id_
uint64_t meta_log_durable_offset_
uint32_t EpochInteger
Unsigned integer representation of epoch.
Savepoint()
Constructs an empty savepoint.
#define EXTERNALIZABLE(clazz)
Macro to declare/define essential methods for an externalizable class.
log::LogFileOrdinal oldest_log_file_
Ordinal of the oldest active log file in each logger.
Epoch::EpochInteger current_epoch_
Current epoch of the entire engine.
The information we maintain in savepoint manager and externalize to a file.
uint64_t meta_log_oldest_offset_
Offset from which metadata log entries are not gleaned yet.
Typedefs of ID types used in log package.
uint64_t meta_log_durable_offset_
Offset upto which metadata log entries are fsynced.
uint64_t oldest_log_file_offset_begin_
Indicates the inclusive beginning of active region in the oldest log file.
uint64_t current_log_file_offset_durable_
Indicates the exclusive end of durable region in the current log file.
Epoch::EpochInteger latest_snapshot_epoch_
uint64_t meta_log_oldest_offset_
uint32_t LogFileOrdinal
Ordinal of log files (eg "log.0", "log.1").
Epoch::EpochInteger latest_snapshot_epoch_
The most recently snapshot-ed epoch, all logs upto this epoch is safe to delete.
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
log::LogFileOrdinal current_log_file_
Indicates the log file each logger is currently appending to.
Epoch::EpochInteger durable_epoch_
Epoch get_current_epoch() const
uint16_t SnapshotId
Unique ID of Snapshot.
void populate_empty(log::LoggerId logger_count)
Populate variables as an initial state.
Savepoint that can be stored in shared memory.
#define CXX11_FUNC_DELETE
Used in public headers in place of " = delete" of C++11.
Epoch::EpochInteger earliest_epoch_
The earliest epoch that can exist in this system.
uint16_t loggers_per_node_count_
Number of loggers per node.
std::vector< log::LogFileOrdinal > oldest_log_files_
Ordinal of the oldest active log file in each logger.
void assert_epoch_values() const
Check invariants on current_epoch_/durable_epoch_.
LoggerSavepointInfo logger_info_[1U<< 16]
Stores all loggers' information.
Epoch::EpochInteger earliest_epoch_
Epoch get_durable_epoch() const
uint32_t get_total_logger_count() const
bool consistent(log::LoggerId logger_count) const
Tells if the variables are consistent.
Information in savepoint for one logger.
snapshot::SnapshotId latest_snapshot_id_
The most recent complete snapshot.
Epoch::EpochInteger durable_epoch_
Latest epoch whose logs were all flushed to disk.
uint16_t LoggerId
Typedef for an ID of Logger.
std::vector< log::LogFileOrdinal > current_log_files_
Indicates the log file each logger is currently appending to.
uint16_t node_count_
Number of NUMA nodes.
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.