libfoedus-core
FOEDUS Core Library
|
A common header part for all log types. More...
A common header part for all log types.
Each log type should contain this as the first member. This is 16-byte, so compiler won't do any reorder or filling.
Definition at line 50 of file common_log_types.hpp.
#include <common_log_types.hpp>
Public Member Functions | |
LogCode | get_type () const __attribute__((always_inline)) |
Convenience method to cast into LogCode. More... | |
LogCodeKind | get_kind () const __attribute__((always_inline)) |
Convenience method to get LogCodeKind. More... | |
bool | is_valid_type () const |
Another convenience method to see if the type code is non-zero and exists. More... | |
void | set_xct_id (xct::XctId new_xct_id) |
Because of the special case of FillerLogType, we must use this method to set xct_id. More... | |
Public Attributes | |
uint16_t | log_type_code_ |
Actually of LogCode defined in the X-Macro, but we want to make sure the type size is 2 bytes. More... | |
uint16_t | log_length_ |
Byte size of this log entry including this header itself and everything. More... | |
storage::StorageId | storage_id_ |
The storage this loggable operation mainly affects. More... | |
xct::XctId | xct_id_ |
Epoch and in-epoch ordinal of this log. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const LogHeader &v) |
|
inline |
Convenience method to get LogCodeKind.
Definition at line 80 of file common_log_types.hpp.
References foedus::log::get_log_code_kind(), and get_type().
Referenced by foedus::log::MetaLogBuffer::commit(), foedus::restart::RestartManagerPimpl::redo_meta_logs(), and foedus::snapshot::LogReducerRef::verify_log_chunk().
|
inline |
Convenience method to cast into LogCode.
Definition at line 78 of file common_log_types.hpp.
References log_type_code_.
Referenced by foedus::storage::DropLogType::assert_valid(), foedus::storage::hash::HashCreateLogType::assert_valid(), foedus::storage::masstree::MasstreeCreateLogType::assert_valid(), foedus::storage::array::ArrayCreateLogType::assert_valid(), foedus::storage::sequential::SequentialCreateLogType::assert_valid(), foedus::storage::sequential::SequentialTruncateLogType::assert_valid(), foedus::storage::sequential::SequentialAppendLogType::assert_valid(), foedus::storage::array::ArrayOverwriteLogType::assert_valid(), foedus::storage::array::ArrayIncrementLogType::assert_valid(), foedus::storage::hash::HashInsertLogType::assert_valid(), foedus::storage::hash::HashDeleteLogType::assert_valid(), foedus::storage::masstree::MasstreeInsertLogType::assert_valid(), foedus::storage::hash::HashUpdateLogType::assert_valid(), foedus::storage::masstree::MasstreeDeleteLogType::assert_valid(), foedus::storage::masstree::MasstreeUpdateLogType::assert_valid(), foedus::storage::hash::HashOverwriteLogType::assert_valid(), foedus::storage::masstree::MasstreeOverwriteLogType::assert_valid(), foedus::snapshot::MergeSort::change_log_type_at(), foedus::storage::array::compact_logs(), get_kind(), foedus::log::invoke_apply_engine(), foedus::log::invoke_apply_record(), foedus::log::invoke_apply_storage(), foedus::log::invoke_assert_valid(), foedus::log::invoke_ostream(), is_valid_type(), foedus::log::operator<<(), foedus::xct::XctManagerPimpl::precommit_xct_apply(), foedus::storage::sequential::StreamStatus::read_entry(), foedus::restart::RestartManagerPimpl::redo_meta_logs(), foedus::storage::masstree::resolve_log(), set_xct_id(), and foedus::snapshot::LogReducerRef::verify_log_chunk().
|
inline |
Another convenience method to see if the type code is non-zero and exists.
Definition at line 83 of file common_log_types.hpp.
References get_type(), and foedus::log::is_valid_log_type().
|
inline |
Because of the special case of FillerLogType, we must use this method to set xct_id.
Definition at line 86 of file common_log_types.hpp.
References ASSERT_ND, get_type(), and foedus::log::kLogCodeFiller.
Referenced by foedus::xct::XctManagerPimpl::precommit_xct_apply().
|
friend |
Definition at line 31 of file common_log_types.cpp.
uint16_t foedus::log::LogHeader::log_length_ |
Byte size of this log entry including this header itself and everything.
We so far support up to 64KB per log.
Definition at line 61 of file common_log_types.hpp.
Referenced by foedus::snapshot::MergeSort::InputStatus::assert_consistent(), foedus::storage::DropLogType::assert_valid(), foedus::storage::hash::HashCreateLogType::assert_valid(), foedus::storage::masstree::MasstreeCreateLogType::assert_valid(), foedus::storage::array::ArrayCreateLogType::assert_valid(), foedus::storage::sequential::SequentialCreateLogType::assert_valid(), foedus::storage::sequential::SequentialTruncateLogType::assert_valid(), foedus::storage::sequential::SequentialAppendLogType::assert_valid(), foedus::storage::array::ArrayOverwriteLogType::assert_valid(), foedus::storage::array::ArrayIncrementLogType::assert_valid(), foedus::storage::hash::HashInsertLogType::assert_valid(), foedus::storage::hash::HashDeleteLogType::assert_valid(), foedus::storage::masstree::MasstreeInsertLogType::assert_valid(), foedus::storage::hash::HashUpdateLogType::assert_valid(), foedus::storage::masstree::MasstreeDeleteLogType::assert_valid(), foedus::storage::masstree::MasstreeUpdateLogType::assert_valid(), foedus::storage::hash::HashOverwriteLogType::assert_valid(), foedus::storage::masstree::MasstreeOverwriteLogType::assert_valid(), foedus::log::MetaLogBuffer::commit(), foedus::snapshot::MergeSort::InputStatus::is_last_chunk_in_window(), foedus::log::on_non_durable_meta_log_found(), foedus::log::operator<<(), foedus::storage::DropLogType::populate(), foedus::storage::sequential::SequentialAppendLogType::populate(), foedus::storage::array::ArrayOverwriteLogType::populate(), foedus::storage::array::ArrayIncrementLogType::populate(), foedus::log::FillerLogType::populate(), foedus::log::EpochMarkerLogType::populate(), foedus::storage::hash::HashCommonLogType::populate_base(), foedus::storage::masstree::MasstreeCommonLogType::populate_base(), foedus::storage::array::ArrayOverwriteLogType::populate_primitive(), foedus::storage::sequential::StreamStatus::read_entry(), foedus::restart::RestartManagerPimpl::redo_meta_logs(), foedus::storage::sequential::SequentialStoragePimpl::truncate(), and foedus::snapshot::LogReducerRef::verify_log_chunk().
uint16_t foedus::log::LogHeader::log_type_code_ |
Actually of LogCode defined in the X-Macro, but we want to make sure the type size is 2 bytes.
(and to avoid C++11 feature in public header).
Definition at line 55 of file common_log_types.hpp.
Referenced by foedus::storage::hash::HashCommonLogType::assert_type(), foedus::snapshot::MergeSort::change_log_type_at(), foedus::storage::array::compact_logs(), get_type(), foedus::log::on_non_durable_meta_log_found(), foedus::log::operator<<(), foedus::storage::array::ArrayPartitioner::partition_batch(), foedus::storage::DropLogType::populate(), foedus::storage::sequential::SequentialAppendLogType::populate(), foedus::storage::array::ArrayOverwriteLogType::populate(), foedus::storage::array::ArrayIncrementLogType::populate(), foedus::log::FillerLogType::populate(), foedus::log::EpochMarkerLogType::populate(), foedus::storage::hash::HashCommonLogType::populate_base(), foedus::storage::masstree::MasstreeCommonLogType::populate_base(), foedus::storage::array::ArrayOverwriteLogType::populate_primitive(), foedus::storage::array::prepare_sort_entries(), foedus::storage::masstree::prepare_sort_entries(), and foedus::storage::sequential::SequentialStoragePimpl::truncate().
storage::StorageId foedus::log::LogHeader::storage_id_ |
The storage this loggable operation mainly affects.
If this operation is agnostic to individual storages, zero.
Definition at line 66 of file common_log_types.hpp.
Referenced by foedus::storage::CreateLogType::assert_valid(), foedus::storage::array::ArrayIncrementLogType::merge(), foedus::log::on_non_durable_meta_log_found(), foedus::log::operator<<(), foedus::storage::operator<<(), foedus::storage::sequential::operator<<(), foedus::storage::hash::HashPartitioner::partition_batch(), foedus::storage::array::ArrayPartitioner::partition_batch(), foedus::storage::DropLogType::populate(), foedus::storage::sequential::SequentialAppendLogType::populate(), foedus::storage::array::ArrayOverwriteLogType::populate(), foedus::storage::array::ArrayIncrementLogType::populate(), foedus::log::FillerLogType::populate(), foedus::log::EpochMarkerLogType::populate(), foedus::storage::hash::HashCommonLogType::populate_base(), foedus::storage::masstree::MasstreeCommonLogType::populate_base(), foedus::storage::array::ArrayOverwriteLogType::populate_primitive(), foedus::restart::RestartManagerPimpl::redo_meta_logs(), foedus::storage::sequential::SequentialStoragePimpl::truncate(), and foedus::snapshot::LogReducerRef::verify_log_chunk().
xct::XctId foedus::log::LogHeader::xct_id_ |
Epoch and in-epoch ordinal of this log.
Unlike other fields, xct_id is set at commit time because we have no idea what the epoch and the in-epoch ordinal will be until that time. Basically all logs have this information, but FillerLogType does not have it so that it fits in 8 bytes.
Definition at line 75 of file common_log_types.hpp.
Referenced by foedus::storage::sequential::SequentialStorage::apply_append_record(), foedus::storage::sequential::SequentialStoragePimpl::apply_truncate(), foedus::snapshot::MergeSort::assert_sorted(), foedus::log::MetaLogBuffer::commit(), foedus::storage::sequential::SequentialComposer::compose(), foedus::log::on_non_durable_meta_log_found(), foedus::storage::array::prepare_sort_entries(), foedus::storage::hash::prepare_sort_entries(), foedus::storage::masstree::prepare_sort_entries(), foedus::storage::sequential::StreamStatus::read_entry(), foedus::restart::RestartManagerPimpl::redo_meta_logs(), and foedus::snapshot::LogReducerRef::verify_log_chunk().