MySQL 8.0.39
Source Code Documentation
|
The fragment page. More...
#include <lob0impl.h>
Public Member Functions | |
z_frag_page_t (buf_block_t *block, mtr_t *mtr, dict_index_t *index) | |
Constructor. More... | |
z_frag_page_t (mtr_t *mtr, dict_index_t *index) | |
Constructor. More... | |
z_frag_page_t (buf_block_t *block) | |
Constructor. More... | |
void | set_space_id_no_redo (space_id_t space_id) |
Write the space identifier to the page header, without generating redo log records. More... | |
z_frag_entry_t | get_frag_entry_x () |
z_frag_entry_t | get_frag_entry_s () |
void | update_frag_entry () |
void | set_version_0 () |
flst_node_t * | addr2ptr_x (fil_addr_t &addr) |
flst_node_t * | addr2ptr_s (fil_addr_t &addr) |
void | set_frag_entry (const fil_addr_t &addr) const |
fil_addr_t | get_frag_entry () const |
Obtain the file address of the fragment entry that denotes the current fragment page. More... | |
void | set_frag_entry_null () const |
ulint | get_n_dir_entries () const |
void | set_n_dir_entries (ulint n) const |
bool | is_border_frag (const frag_node_t &node) const |
byte * | slots_end_ptr () const |
paddr_t | frag_id_to_addr (ulint frag_id) const |
ulint | get_nth_dir_entry (ulint frag_id) |
void | set_nth_dir_entry (ulint frag_id, paddr_t val) |
ulint | init_last_dir_entry () |
void | incr_n_dir_entries () const |
void | decr_n_dir_entries () const |
ulint | get_page_size () const |
ulint | space_used_by_dir () const |
ulint | locate_free_slot () |
ulint | alloc_frag_id () |
Allocate a fragment id. More... | |
std::ostream & | print_frag_id (std::ostream &out) |
ulint | alloc_dir_entry () |
Grow the frag directory by one entry. More... | |
void | set_page_next (page_no_t page_no) |
Set the next page. More... | |
void | set_page_prev (page_no_t page_no) |
Set the prev page. More... | |
void | set_page_prev (page_no_t page_no, mtr_t *mtr) |
Set the prev page. More... | |
page_no_t | get_next_page_no () const |
Get the next page number. More... | |
page_no_t | get_prev_page_no (mtr_t *mtr) const |
Get the prev page number (FIL_PAGE_PREV). More... | |
page_no_t | get_prev_page_no () const |
Get the prev page number. More... | |
buf_block_t * | alloc (z_first_page_t &first, page_no_t hint, bool bulk) |
Allocate the fragment page. More... | |
void | dealloc_with_entry (z_first_page_t &first, mtr_t *alloc_mtr) |
Free the fragment page along with its entry. More... | |
void | dealloc () |
Free the fragment page. More... | |
buf_block_t * | load_x (page_no_t page_no) |
void | merge_free_frags () |
void | merge_free_frags (frag_node_t &frag) |
bool | validate_lists () const |
void | insert_into_free_list (frag_node_t &frag) |
void | insert_into_frag_list (frag_node_t &frag) |
Insert the given fragment node into the fragment list. More... | |
void | split_free_frag (frag_node_t &free_frag, ulint size) |
Split one free fragment into two. More... | |
frag_node_t | get_frag_node (frag_id_t id) const |
void | dealloc_fragment (ulint frag_id) |
frag_id_t | alloc_fragment (ulint size, z_frag_entry_t &entry) |
Allocate a fragment with the given payload. More... | |
plist_base_node_t | free_list () const |
plist_base_node_t | frag_list () const |
void | set_page_type () |
page_type_t | get_page_type () const |
const char * | get_page_type_str () const |
ulint | payload () |
The maximum free space available in a fragment page. More... | |
page_no_t | get_page_no () const |
Get the frag page number. More... | |
byte * | frame () const |
std::ostream & | print (std::ostream &out) const |
ulint | get_total_stored_data () const |
Get the total amount of stored data in this page. More... | |
ulint | get_total_free_len () const |
Get the total cumulative free space in this page. More... | |
ulint | get_big_free_len () const |
Get the big free space in this page. More... | |
ulint | get_n_frags () const |
Get the number of fragments in this frag page. More... | |
std::ostream & | print_frags_in_order (std::ostream &out) const |
std::ostream & | print_free_list (std::ostream &out) const |
std::ostream & | print_frag_list (std::ostream &out) const |
std::ostream & | print_page_dir (std::ostream &out) const |
void | set_mtr (mtr_t *mtr) |
void | set_index (dict_index_t *index) |
void | set_block_null () |
bool | is_last_frag (const frag_node_t &node) const |
Determine if the given fragment node is the last fragment node adjacent to the directory. More... | |
Static Public Member Functions | |
static ulint | max_payload (dict_index_t *index) |
The maximum free space available in a fragment page. More... | |
static bool | can_data_fit (dict_index_t *index, ulint data_size) |
Determine if the given length of data can fit into a fragment page. More... | |
Static Public Attributes | |
static const ulint | OFFSET_VERSION = FIL_PAGE_DATA |
Version information. More... | |
static const ulint | OFFSET_FRAG_ENTRY = OFFSET_VERSION + 1 |
The location of z_frag_entry_t for this page. More... | |
static const ulint | OFFSET_FREE_LIST = OFFSET_FRAG_ENTRY + FIL_ADDR_SIZE |
The offset within page where the free space list begins. More... | |
static const ulint | OFFSET_FRAGS_LIST |
The offset within page where the fragment list begins. More... | |
static const ulint | OFFSET_FRAGS_BEGIN |
The offset within page where the fragments can occupy . More... | |
static const ulint | OFFSET_PAGE_DIR_ENTRY_COUNT = FIL_PAGE_DATA_END + 2 |
Offset of number of page directory entries (from end) More... | |
static const ulint | OFFSET_PAGE_DIR_ENTRY_FIRST |
Offset of first page directory entry (from end) More... | |
static const ulint | SIZE_OF_PAGE_DIR_ENTRY = 2 |
Private Member Functions | |
fil_addr_t | get_frag_entry_addr () const |
void | dealloc_fragment (frag_node_t &frag) |
void | dealloc_frag_id () |
Deallocate all the free slots from the end of the page directory. More... | |
void | dealloc_frag_id (ulint frag_id) |
Deallocate the given fragment id. More... | |
Private Attributes | |
buf_block_t * | m_block |
mtr_t * | m_mtr |
dict_index_t * | m_index |
The fragment page.
This page will contain fragments from different zlib streams.
|
inline |
Constructor.
[in] | block | Buffer block containing the fragment page. |
[in] | mtr | Mini-transaction context. |
[in] | index | Clustered index to which LOB belongs. |
|
inline |
Constructor.
[in] | mtr | Mini-transaction context. |
[in] | index | Clustered index to which LOB belongs. |
|
inlineexplicit |
Constructor.
[in] | block | the buffer block containing the fragment page. |
|
inline |
|
inline |
buf_block_t * lob::z_frag_page_t::alloc | ( | z_first_page_t & | first, |
page_no_t | hint, | ||
bool | bulk | ||
) |
Allocate the fragment page.
[in] | first | first page of this LOB. |
[in] | hint | hint page number for allocation. |
[in] | bulk | true if bulk operation (OPCODE_INSERT_BULK) false otherwise. |
ulint lob::z_frag_page_t::alloc_dir_entry | ( | ) |
Grow the frag directory by one entry.
|
inline |
Allocate a fragment id.
frag_id_t lob::z_frag_page_t::alloc_fragment | ( | ulint | size, |
z_frag_entry_t & | entry | ||
) |
Allocate a fragment with the given payload.
[in] | size | the payload size. |
[in] | entry | the index entry of the given frag page. |
|
static |
Determine if the given length of data can fit into a fragment page.
[in] | index | the clust index into which LOB is inserted. |
[in] | data_size | The length of data to operate. |
|
inline |
Free the fragment page.
|
private |
Deallocate all the free slots from the end of the page directory.
|
inlineprivate |
Deallocate the given fragment id.
[in] | frag_id | The fragment that needs to be deallocated. |
|
inlineprivate |
|
inline |
void lob::z_frag_page_t::dealloc_with_entry | ( | z_first_page_t & | first, |
mtr_t * | alloc_mtr | ||
) |
Free the fragment page along with its entry.
[in] | first | first page of LOB. |
[in] | alloc_mtr | mini trx to perform this modification. |
|
inline |
|
inline |
|
inline |
|
inline |
ulint lob::z_frag_page_t::get_big_free_len | ( | ) | const |
Get the big free space in this page.
|
inline |
Obtain the file address of the fragment entry that denotes the current fragment page.
|
inlineprivate |
z_frag_entry_t lob::z_frag_page_t::get_frag_entry_s | ( | ) |
z_frag_entry_t lob::z_frag_page_t::get_frag_entry_x | ( | ) |
|
inline |
|
inline |
|
inline |
Get the number of fragments in this frag page.
|
inline |
Get the next page number.
|
inline |
Get the frag page number.
|
inline |
|
inline |
|
inline |
|
inline |
Get the prev page number.
Get the prev page number (FIL_PAGE_PREV).
[in] | mtr | Mini-transaction latch context. |
ulint lob::z_frag_page_t::get_total_free_len | ( | ) | const |
Get the total cumulative free space in this page.
ulint lob::z_frag_page_t::get_total_stored_data | ( | ) | const |
Get the total amount of stored data in this page.
|
inline |
|
inline |
|
inline |
Insert the given fragment node into the fragment list.
[in,out] | frag | the fragment node to be inserted. |
|
inline |
|
inline |
|
inline |
Determine if the given fragment node is the last fragment node adjacent to the directory.
|
inline |
|
inline |
|
inlinestatic |
The maximum free space available in a fragment page.
Adjustment needs to be done with the frag_node_t::overhead().
|
inline |
|
inline |
|
inline |
The maximum free space available in a fragment page.
Adjustment needs to be done with the frag_node_t::overhead().
|
inline |
|
inline |
|
inline |
std::ostream & lob::z_frag_page_t::print_frags_in_order | ( | std::ostream & | out | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the next page.
|
inline |
Set the prev page.
|
inline |
|
inline |
Write the space identifier to the page header, without generating redo log records.
[in] | space_id | the space identifier. |
|
inline |
|
inline |
|
inline |
|
inline |
Split one free fragment into two.
This is not splitting a fragment page. This is just splitting one free fragment into two. When we want to allocate one fragment, we identify a big enough free fragment and split it into two - one will be the allocated portion and other will become a free fragment.
[in] | free_frag | the free fragment that will be split. |
[in] | size | the payload size in bytes. |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
static |
The location of z_frag_entry_t for this page.
|
static |
The offset within page where the fragments can occupy .
|
static |
The offset within page where the fragment list begins.
|
static |
The offset within page where the free space list begins.
|
static |
Offset of number of page directory entries (from end)
|
static |
Offset of first page directory entry (from end)
|
static |
Version information.
One byte.
|
static |