class Innodb::FsegEntry

Constants

SIZE

The size (in bytes) of an FSEG entry, which contains a two 32-bit integers and a 16-bit integer.

Public Class Methods

get_entry_address(cursor) click to toggle source

Return the FSEG entry address, which points to an entry on an INODE page.

# File lib/innodb/fseg_entry.rb, line 13
def self.get_entry_address(cursor)
  {
    space_id: cursor.name("space_id") { cursor.read_uint32 },
    page_number: cursor.name("page_number") { Innodb::Page.maybe_undefined(cursor.read_uint32) },
    offset: cursor.name("offset") { cursor.read_uint16 },
  }
end
get_inode(space, cursor) click to toggle source

Return an INODE entry which represents this file segment.

# File lib/innodb/fseg_entry.rb, line 22
def self.get_inode(space, cursor)
  address = cursor.name("address") { get_entry_address(cursor) }
  return nil if address[:offset].zero?

  page = space.page(address[:page_number])
  return nil unless page.type == :INODE

  page.inode_at(page.cursor(address[:offset]))
end