Class Innodb::LogBlock
In: lib/innodb/log_block.rb
Parent: Object

An InnoDB transaction log block.

Methods

calculate_checksum   checksum   corrupt?   cursor   data   dump   header   new   trailer  

Constants

BLOCK_SIZE = 512   Log blocks are fixed-length at 512 bytes in InnoDB.
HEADER_OFFSET = 0   Offset of the header within the log block.
HEADER_SIZE = 4 + 2 + 2 + 4   The size of the block header.
TRAILER_OFFSET = BLOCK_SIZE - 4   Offset of the trailer within ths log block.
TRAILER_SIZE = 4   The size of the block trailer.
DATA_OFFSET = HEADER_SIZE   Offset of the start of data in the block.
DATA_SIZE = BLOCK_SIZE - HEADER_SIZE - TRAILER_SIZE   Size of the space available for log records.
HEADER_FLUSH_BIT_MASK = 0x80000000   Mask used to get the flush bit in the header.

Public Class methods

Initialize a log block by passing in a 512-byte buffer containing the raw log block contents.

Public Instance methods

Calculate the checksum of the block using InnoDB‘s log block checksum algorithm.

A helper function to return the checksum from the trailer, for easier access.

Is the block corrupt? Calculate the checksum of the block and compare to the stored checksum; return true or false.

Return an BufferCursor object positioned at a specific offset.

Return a slice of actual block data (that is, excluding header and trailer) starting at the given offset.

Dump the contents of a log block for debugging purposes.

Return the log block header.

Return the log block trailer.

[Validate]