libfoedus-core
FOEDUS Core Library
foedus::log::FillerLogType Struct Reference

A dummy log type to fill up a sector in log files. More...

Detailed Description

A dummy log type to fill up a sector in log files.

As we do direct I/O, we must do file I/O in multiply of 4kb. We pad the log buffer we are about to write with this log type. Log gleaner simply skips this log. This is the only log type whose size might be smaller than sizeof(FillerLogType). This happens because the common log header is 16 bytes but we have to make this log type 8 bytes able to fill every gap. For this reason, the xct_id_ property of this log must not be used.

Definition at line 215 of file common_log_types.hpp.

#include <common_log_types.hpp>

Inheritance diagram for foedus::log::FillerLogType:
Collaboration diagram for foedus::log::FillerLogType:

Public Types

enum  Constants { kLogWriteUnitSize = 1 << 12 }
 Constant values. More...
 

Public Member Functions

 FillerLogType ()=delete
 
 FillerLogType (const FillerLogType &other)=delete
 
 ~FillerLogType ()=delete
 
bool is_engine_log () const
 
bool is_storage_log () const
 
bool is_record_log () const
 
void apply_engine (thread::Thread *)
 
void apply_storage (Engine *, storage::StorageId)
 
void apply_record (thread::Thread *, storage::StorageId, xct::RwLockableXctId *, char *)
 
void populate (uint64_t size)
 Populate this log to fill up the specified byte size. More...
 
void assert_valid () const __attribute__((always_inline))
 

Friends

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

Additional Inherited Members

- Public Attributes inherited from foedus::log::BaseLogType
LogHeader header_
 

Member Enumeration Documentation

Constant values.

Enumerator
kLogWriteUnitSize 

We always write to file in a multiply of this value, filling up the rest if needed.

4kb Disk Sector (512b earlier, but nowadays 4kb especially on SSD).

Definition at line 217 of file common_log_types.hpp.

217  {
222  kLogWriteUnitSize = 1 << 12,
223  };
We always write to file in a multiply of this value, filling up the rest if needed.

Constructor & Destructor Documentation

foedus::log::FillerLogType::FillerLogType ( )
delete
foedus::log::FillerLogType::FillerLogType ( const FillerLogType other)
delete
foedus::log::FillerLogType::~FillerLogType ( )
delete

Member Function Documentation

void foedus::log::FillerLogType::apply_engine ( thread::Thread )
inline

Definition at line 231 of file common_log_types.hpp.

231 {}
void foedus::log::FillerLogType::apply_record ( thread::Thread ,
storage::StorageId  ,
xct::RwLockableXctId ,
char *   
)
inline

Definition at line 233 of file common_log_types.hpp.

237  {}
void foedus::log::FillerLogType::apply_storage ( Engine ,
storage::StorageId   
)
inline

Definition at line 232 of file common_log_types.hpp.

232 {}
void foedus::log::FillerLogType::assert_valid ( ) const
inline

Definition at line 242 of file common_log_types.hpp.

References ASSERT_ND, and foedus::log::kLogCodeFiller.

242  {
244  ASSERT_ND(header_.log_length_ >= 8); // note: it CAN be only 8, not 16 (sizeof FillerLogType)
245  ASSERT_ND(header_.log_length_ % 8 == 0);
247  }
uint16_t log_length_
Byte size of this log entry including this header itself and everything.
storage::StorageId storage_id_
The storage this loggable operation mainly affects.
0x3001 : foedus::log::FillerLogType .
Definition: log_type.hpp:111
LogCode get_type() const __attribute__((always_inline))
Convenience method to cast into LogCode.
#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::log::FillerLogType::is_engine_log ( ) const
inline

Definition at line 228 of file common_log_types.hpp.

228 { return true; }
bool foedus::log::FillerLogType::is_record_log ( ) const
inline

Definition at line 230 of file common_log_types.hpp.

230 { return true; }
bool foedus::log::FillerLogType::is_storage_log ( ) const
inline

Definition at line 229 of file common_log_types.hpp.

229 { return true; }
void foedus::log::FillerLogType::populate ( uint64_t  size)

Populate this log to fill up the specified byte size.

Definition at line 77 of file common_log_types.cpp.

References ASSERT_ND, foedus::log::BaseLogType::header_, foedus::log::LogHeader::log_length_, foedus::log::LogHeader::log_type_code_, and foedus::log::LogHeader::storage_id_.

77  {
78  ASSERT_ND(size < (1 << 16));
79  header_.storage_id_ = 0;
80  header_.log_length_ = size;
81  header_.log_type_code_ = get_log_code<FillerLogType>();
82 }
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...
uint16_t log_length_
Byte size of this log entry including this header itself and everything.
storage::StorageId storage_id_
The storage this loggable operation mainly affects.
#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 FillerLogType v 
)
friend

Definition at line 37 of file common_log_types.cpp.

37  {
38  o << "<FillerLog>" << v.header_ << "</FillerLog>";
39  return o;
40 }

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