Class: Innodb::History

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

Overview

The global history of record versions implemented through undo logs.

Instance Method Summary collapse

Constructor Details

#initialize(innodb_system) ⇒ History

Returns a new instance of History.



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

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).



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

def each_history_list
  unless block_given?
    return enum_for(:each_history_list)
  end

  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.



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

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.



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

def trx_sys
  @innodb_system.system_space.trx_sys
end