Class: Innodb::History
- Inherits:
-
Object
- Object
- Innodb::History
- Defined in:
- lib/innodb/history.rb
Overview
The global history of record versions implemented through undo logs.
Instance Method Summary collapse
-
#each_history_list ⇒ Object
Iterate through all history lists (one per rollback segment, nominally there are 128 rollback segments).
-
#history_list(space_id, page_number) ⇒ Object
A helper to get to the history_list of a given space_id and page number.
-
#initialize(innodb_system) ⇒ History
constructor
A new instance of History.
-
#trx_sys ⇒ Object
A helper to get to the trx_sys page in the Innodb::System.
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_list ⇒ Object
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_sys ⇒ Object
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 |