class Innodb::IbufBitmap
Constants
- BITMAP_BV_ALL
- BITMAP_BV_BUFFERED
- BITMAP_BV_FREE
- BITMAP_BV_IBUF
- BITS_PER_PAGE
- PageStatus
Public Class Methods
new(page, cursor)
click to toggle source
# File lib/innodb/ibuf_bitmap.rb, line 18 def initialize(page, cursor) @page = page @bitmap = read_bitmap(cursor) end
Public Instance Methods
each_page_status() { |page_number, page_status| ... }
click to toggle source
# File lib/innodb/ibuf_bitmap.rb, line 31 def each_page_status return enum_for(:each_page_status) unless block_given? bitmap = @bitmap.enum_for(:each_byte) bitmap.each_with_index do |byte, byte_index| (0..1).each do |page_offset| page_number = (byte_index * 2) + page_offset page_bits = ((byte >> (page_offset * BITS_PER_PAGE)) & BITMAP_BV_ALL) page_status = PageStatus.new( free: (page_bits & BITMAP_BV_FREE), buffered: (page_bits & BITMAP_BV_BUFFERED != 0), ibuf: (page_bits & BITMAP_BV_IBUF != 0) ) yield page_number, page_status end end end
read_bitmap(cursor)
click to toggle source
# File lib/innodb/ibuf_bitmap.rb, line 27 def read_bitmap(cursor) cursor.name("ibuf_bitmap") { |c| c.read_bytes(size_bitmap) } end
size_bitmap()
click to toggle source
# File lib/innodb/ibuf_bitmap.rb, line 23 def size_bitmap (@page.space.pages_per_bookkeeping_page * BITS_PER_PAGE) / 8 end