Class: Innodb::Page::UndoLog
Defined Under Namespace
Classes: PageHeader, SegmentHeader
Constant Summary
collapse
- UNDO_PAGE_TYPES =
{
1 => :insert,
2 => :update,
}.freeze
- UNDO_SEGMENT_STATES =
{
1 => :active,
2 => :cached,
3 => :to_free,
4 => :to_purge,
5 => :prepared,
}.freeze
Constants inherited
from Innodb::Page
PAGE_TYPE, PAGE_TYPE_BY_VALUE, UNDEFINED_PAGE_NUMBER
Instance Attribute Summary
Attributes inherited from Innodb::Page
#space
Instance Method Summary
collapse
#checksum_crc32, #checksum_crc32?, #checksum_innodb, #checksum_innodb?, #checksum_invalid?, #checksum_type, #checksum_valid?, #corrupt?, #cursor, #default_page_size?, #each_page_body_byte_as_uint8, #each_page_header_byte_as_uint8, #each_region, #extent_descriptor?, #fil_header, #fil_trailer, handle, #in_doublewrite_buffer?, #initialize, #inspect, #inspect_header_fields, maybe_undefined, #misplaced?, #misplaced_offset?, #misplaced_space?, #name, page_type_by_value, parse, #pos_fil_header, #pos_fil_trailer, #pos_page_body, #pos_partial_page_header, register_specialization, #size, #size_fil_header, #size_fil_trailer, #size_page_body, #size_partial_page_header, specialization_for, specialization_for?, #torn?, undefined?
Constructor Details
This class inherits a constructor from Innodb::Page
Instance Method Details
#dump ⇒ Object
Dump the contents of a page for debugging purposes.
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/innodb/page/undo_log.rb', line 92
def dump
super
puts "undo page header:"
pp
puts
puts "undo segment header:"
pp
puts
puts "last undo log:"
undo_log([:last_log_offset]).dump unless [:last_log_offset].zero?
puts
end
|
#next_address ⇒ Object
72
73
74
|
# File 'lib/innodb/page/undo_log.rb', line 72
def next_address
[:page_list_node][:next]
end
|
#pos_undo_logs ⇒ Object
40
41
42
|
# File 'lib/innodb/page/undo_log.rb', line 40
def pos_undo_logs
+
end
|
24
25
26
|
# File 'lib/innodb/page/undo_log.rb', line 24
def
pos_page_body
end
|
32
33
34
|
# File 'lib/innodb/page/undo_log.rb', line 32
def
+
end
|
#prev_address ⇒ Object
68
69
70
|
# File 'lib/innodb/page/undo_log.rb', line 68
def prev_address
[:page_list_node][:prev]
end
|
28
29
30
|
# File 'lib/innodb/page/undo_log.rb', line 28
def
2 + 2 + 2 + Innodb::List::NODE_SIZE
end
|
#undo_log(pos) ⇒ Object
87
88
89
|
# File 'lib/innodb/page/undo_log.rb', line 87
def undo_log(pos)
Innodb::UndoLog.new(self, pos)
end
|
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/innodb/page/undo_log.rb', line 57
def
@undo_page_header ||= cursor().name("undo_page_header") do |c|
PageHeader.new(
type: c.name("type") { UNDO_PAGE_TYPES[c.read_uint16] },
latest_log_record_offset: c.name("latest_log_record_offset") { c.read_uint16 },
free_offset: c.name("free_offset") { c.read_uint16 },
page_list_node: c.name("page_list") { Innodb::List.get_node(c) }
)
end
end
|