Class: Innodb::History

Inherits:
Object
  • Object
show all
Defined in:
lib/innodb/history.rb

Instance Method Summary collapse

Constructor Details

#initialize(innodb_system) ⇒ History

Returns a new instance of History.



6
7
8
# File 'lib/innodb/history.rb', line 6

def initialize(innodb_system)
  @innodb_system = innodb_system
end

Instance Method Details

#each_history_listObject

Iterate through all history lists (one per rollback segment, nominally there are 128 rollback segments).



22
23
24
25
26
27
28
# File 'lib/innodb/history.rb', line 22

def each_history_list
  return enum_for(:each_history_list) unless block_given?

  trx_sys.rsegs.each do |slot|
    yield history_list(slot[:space_id], slot[:page_number])
  end
end

#history_list(space_id, page_number) ⇒ Object

A helper to get to the history_list of a given space_id and page number.



16
17
18
# File 'lib/innodb/history.rb', line 16

def history_list(space_id, page_number)
  @innodb_system.space(space_id).page(page_number).history_list
end

#trx_sysObject

A helper to get to the trx_sys page in the Innodb::System.



11
12
13
# File 'lib/innodb/history.rb', line 11

def trx_sys
  @innodb_system.system_space.trx_sys
end