Class: Innodb::Page::Index::Compressed
- Inherits:
-
Innodb::Page::Index
- Object
- Innodb::Page
- Innodb::Page::Index
- Innodb::Page::Index::Compressed
- Defined in:
- lib/innodb/page/index_compressed.rb
Overview
This is horribly incomplete and broken. InnoDB compression does not currently work in innodb_ruby. Patches are welcome! (Hint hint, nudge nudge, Facebook developers!)
Constant Summary
Constants inherited from Innodb::Page::Index
PAGE_DIRECTION, PAGE_DIR_SLOT_MAX_N_OWNED, PAGE_DIR_SLOT_MIN_N_OWNED, PAGE_DIR_SLOT_SIZE, RECORD_COMPACT_BITS_SIZE, RECORD_INFO_DELETED_FLAG, RECORD_INFO_MIN_REC_FLAG, RECORD_MAX_N_FIELDS, RECORD_MAX_N_SYSTEM_FIELDS, RECORD_MAX_N_USER_FIELDS, RECORD_NEXT_SIZE, RECORD_REDUNDANT_BITS_SIZE, RECORD_REDUNDANT_OFF1_NULL_MASK, RECORD_REDUNDANT_OFF1_OFFSET_MASK, RECORD_REDUNDANT_OFF2_EXTERN_MASK, RECORD_REDUNDANT_OFF2_NULL_MASK, RECORD_REDUNDANT_OFF2_OFFSET_MASK, RECORD_TYPES
Constants inherited from Innodb::Page
PAGE_TYPE, PAGE_TYPE_BY_VALUE, SPECIALIZED_CLASSES
Instance Attribute Summary
Attributes inherited from Innodb::Page
Instance Method Summary collapse
- #directory ⇒ Object
-
#directory_slots ⇒ Object
The number of directory slots in use.
-
#free_space ⇒ Object
Return the amount of free space in the page.
- #uncompressed_columns_size ⇒ Object
Methods inherited from Innodb::Page::Index
#binary_search_by_directory, #directory_slot_for_record, #directory_space, #dump, #each_child_page, #each_garbage_record, #each_record, #each_region, #fseg_header, #garbage_offset, #header_space, #index_id, #infimum, #level, #linear_search_from_cursor, #make_record_description, #max_record, #min_record, #offset_is_directory_slot?, #page_header, #pos_directory, #pos_fseg_header, #pos_index_header, #pos_infimum, #pos_records, #pos_supremum, #pos_user_records, #record, #record_bytes, #record_cursor, #record_describer, #record_describer=, #record_fields, #record_format, #record_header, #record_header_compact_additional, #record_header_compact_null_bitmap, #record_header_compact_variable_lengths_and_externs, #record_header_redundant_additional, #record_header_redundant_field_end_offsets, #record_is_directory_slot?, #record_space, #records, #root?, #size_fseg_header, #size_index_header, #size_mum_record, #size_mum_record_header_additional, #size_record_header, #supremum, #system_record, #trailer_space, #used_space
Methods inherited from Innodb::Page
#calculate_checksum, #checksum, #corrupt?, #cursor, #dump, #each_region, #fil_header, handle, #initialize, #inspect, #lsn, maybe_undefined, #name, #next, #offset, parse, #pos_fil_header, #pos_fil_trailer, #pos_page_body, #prev, #size, #size_fil_header, #size_fil_trailer, #type
Constructor Details
This class inherits a constructor from Innodb::Page
Instance Method Details
#directory ⇒ Object
13 14 15 |
# File 'lib/innodb/page/index_compressed.rb', line 13 def directory super.map { |n| n & 0x3fff } end |
#directory_slots ⇒ Object
The number of directory slots in use.
9 10 11 |
# File 'lib/innodb/page/index_compressed.rb', line 9 def directory_slots page_header[:n_heap] - 2 end |
#free_space ⇒ Object
Return the amount of free space in the page.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/innodb/page/index_compressed.rb', line 30 def free_space free_space_start = size - size_fil_trailer - directory_space - (uncompressed_columns_size * (page_header[:n_heap] - 2)) puts "Free space start == %04x" % [offset * size + free_space_start] c = cursor(free_space_start).backward zero_bytes = 0 while (b = c.get_uint8) == 0 zero_bytes += 1 end zero_bytes #page_header[:garbage] + # (size - size_fil_trailer - directory_space - page_header[:heap_top]) end |
#uncompressed_columns_size ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/innodb/page/index_compressed.rb', line 17 def uncompressed_columns_size if level == 0 if record_format && record_format[:type] == :clustered 6 + 7 # Transaction ID + Roll Pointer else 0 end else 4 # Node pointer for non-leaf pages end end |