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

All log blocks in mapper/reducers start with this header. More...

Detailed Description

All log blocks in mapper/reducers start with this header.

This base object MUST be within 8 bytes so that FillerBlockHeader is within 8 bytes. As logs are multiply of 8 bytes, 8-byte filler header can fill any gap.

Definition at line 93 of file log_reducer_impl.hpp.

#include <log_reducer_impl.hpp>

Inheritance diagram for foedus::snapshot::BlockHeaderBase:

Public Types

enum  Constants { kFullBlockHeaderMagicWord = 0xDEADBEEF, kFillerBlockHeaderMagicWord = 0x8BADF00D }
 

Public Member Functions

bool is_full_block () const
 
bool is_filler () const
 

Public Attributes

uint32_t magic_word_
 This is used to identify the storage block is a dummy (filler) one or a full one. More...
 
BufferPosition block_length_
 Length (in 8-bytes) of this block including the header. More...
 

Friends

std::ostream & operator<< (std::ostream &o, const BlockHeaderBase &v)
 

Member Enumeration Documentation

Member Function Documentation

bool foedus::snapshot::BlockHeaderBase::is_filler ( ) const
inline

Definition at line 105 of file log_reducer_impl.hpp.

References ASSERT_ND, kFillerBlockHeaderMagicWord, kFullBlockHeaderMagicWord, and magic_word_.

105  {
109  }
uint32_t magic_word_
This is used to identify the storage block is a dummy (filler) one or a full one. ...
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72
bool foedus::snapshot::BlockHeaderBase::is_full_block ( ) const
inline

Definition at line 100 of file log_reducer_impl.hpp.

References ASSERT_ND, kFillerBlockHeaderMagicWord, kFullBlockHeaderMagicWord, and magic_word_.

100  {
104  }
uint32_t magic_word_
This is used to identify the storage block is a dummy (filler) one or a full one. ...
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const BlockHeaderBase v 
)
friend

Definition at line 925 of file log_reducer_impl.cpp.

925  {
926  o << "<BlockHeader>"
927  << "<magic_word_>" << assorted::Hex(v.magic_word_) << "</magic_word_>"
928  << "<block_length_>" << v.block_length_ << "</block_length_>"
929  << "</BlockHeader>";
930  return o;
931 }

Member Data Documentation

BufferPosition foedus::snapshot::BlockHeaderBase::block_length_

Length (in 8-bytes) of this block including the header.

Definition at line 119 of file log_reducer_impl.hpp.

Referenced by foedus::snapshot::LogReducerRef::append_log_chunk(), and foedus::snapshot::operator<<().

uint32_t foedus::snapshot::BlockHeaderBase::magic_word_

This is used to identify the storage block is a dummy (filler) one or a full one.

This must be either kFullBlockHeaderMagicWord or kFillerBlockHeaderMagicWord.

Definition at line 117 of file log_reducer_impl.hpp.

Referenced by foedus::snapshot::LogReducerRef::append_log_chunk(), is_filler(), is_full_block(), and foedus::snapshot::operator<<().


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