class Innodb::Page::Blob

Public Instance Methods

blob_data() click to toggle source
# File lib/innodb/page/blob.rb, line 29
def blob_data
  cursor(pos_blob_data).name("blob_data") do |c|
    c.read_bytes(blob_header[:length])
  end
end
blob_header() click to toggle source
# File lib/innodb/page/blob.rb, line 20
def blob_header
  cursor(pos_blob_header).name("blob_header") do |c|
    {
      length: c.name("length") { c.read_uint32 },
      next: c.name("next") { Innodb::Page.maybe_undefined(c.read_uint32) },
    }
  end
end
dump() click to toggle source

Dump the contents of a page for debugging purposes.

Calls superclass method Innodb::Page#dump
# File lib/innodb/page/blob.rb, line 64
def dump
  super

  puts "blob header:"
  pp blob_header
  puts

  puts "blob data:"
  HexFormat.puts(blob_data)
  puts

  puts
end
each_region() { |region( offset: pos_blob_header, length: size_blob_header, name: :blob_header, info: "Blob Header"| ... } click to toggle source
Calls superclass method Innodb::Page#each_region
# File lib/innodb/page/blob.rb, line 41
def each_region(&block)
  return enum_for(:each_region) unless block_given?

  super

  yield Region.new(
    offset: pos_blob_header,
    length: size_blob_header,
    name: :blob_header,
    info: "Blob Header"
  )

  yield Region.new(
    offset: pos_blob_data,
    length: blob_header[:length],
    name: :blob_data,
    info: "Blob Data"
  )

  nil
end
next_blob_page() click to toggle source
# File lib/innodb/page/blob.rb, line 35
def next_blob_page
  return unless blob_header[:next]

  space.page(blob_header[:next])
end
pos_blob_data() click to toggle source
# File lib/innodb/page/blob.rb, line 16
def pos_blob_data
  pos_blob_header + size_blob_header
end
pos_blob_header() click to toggle source
# File lib/innodb/page/blob.rb, line 8
def pos_blob_header
  pos_page_body
end
size_blob_header() click to toggle source
# File lib/innodb/page/blob.rb, line 12
def size_blob_header
  4 + 4
end