Class: Innodb::Page::Sys

Inherits:
Innodb::Page show all
Defined in:
lib/innodb/page/sys.rb

Overview

Another layer of indirection for pages of type SYS, as they have multiple uses within InnoDB. We’ll override the self.handle method and check the page offset to decide which type of SYS page this is.

Constant Summary

Constants inherited from Innodb::Page

PAGE_TYPE, PAGE_TYPE_BY_VALUE, SPECIALIZED_CLASSES

Instance Attribute Summary

Attributes inherited from Innodb::Page

#space

Class Method Summary collapse

Methods inherited from Innodb::Page

#checksum, #checksum_crc32, #checksum_crc32?, #checksum_innodb, #checksum_innodb?, #checksum_invalid?, #checksum_trailer, #checksum_type, #checksum_valid?, #corrupt?, #cursor, #dump, #each_page_body_byte_as_uint8, #each_page_header_byte_as_uint8, #each_region, #fil_header, #fil_trailer, #in_doublewrite_buffer?, #initialize, #inspect, #lsn, #lsn_low32_header, #lsn_low32_trailer, maybe_undefined, #misplaced?, #misplaced_offset?, #misplaced_space?, #name, #next, #offset, parse, #pos_fil_header, #pos_fil_trailer, #pos_page_body, #pos_partial_page_header, #prev, #size, #size_fil_header, #size_fil_trailer, #size_page_body, #size_partial_page_header, #space_id, #torn?, #type

Constructor Details

This class inherits a constructor from Innodb::Page

Class Method Details

.handle(page, space, buffer, page_number = nil) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/innodb/page/sys.rb', line 11

def self.handle(page, space, buffer, page_number=nil)
  case
  when page.offset == 3
    Innodb::Page::SysIbufHeader.new(space, buffer, page_number)
  when page.offset == 7
    Innodb::Page::SysDataDictionaryHeader.new(space, buffer, page_number)
  when space.rseg_page?(page.offset)
    Innodb::Page::SysRsegHeader.new(space, buffer, page_number)
  else
    # We can't do anything better, so pass on the generic InnoDB::Page.
    page
  end
end