MySQL 8.3.0
Source Code Documentation
lob::z_frag_page_t Struct Reference

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_taddr2ptr_x (fil_addr_t &addr)
 
flst_node_taddr2ptr_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
 
byteslots_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_talloc (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_tload_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...
 
byteframe () 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_tm_block
 
mtr_tm_mtr
 
dict_index_tm_index
 

Detailed Description

The fragment page.

This page will contain fragments from different zlib streams.

Constructor & Destructor Documentation

◆ z_frag_page_t() [1/3]

lob::z_frag_page_t::z_frag_page_t ( buf_block_t block,
mtr_t mtr,
dict_index_t index 
)
inline

Constructor.

Parameters
[in]blockBuffer block containing the fragment page.
[in]mtrMini-transaction context.
[in]indexClustered index to which LOB belongs.

◆ z_frag_page_t() [2/3]

lob::z_frag_page_t::z_frag_page_t ( mtr_t mtr,
dict_index_t index 
)
inline

Constructor.

Parameters
[in]mtrMini-transaction context.
[in]indexClustered index to which LOB belongs.

◆ z_frag_page_t() [3/3]

lob::z_frag_page_t::z_frag_page_t ( buf_block_t block)
inlineexplicit

Constructor.

Parameters
[in]blockthe buffer block containing the fragment page.

Member Function Documentation

◆ addr2ptr_s()

flst_node_t * lob::z_frag_page_t::addr2ptr_s ( fil_addr_t addr)
inline

◆ addr2ptr_x()

flst_node_t * lob::z_frag_page_t::addr2ptr_x ( fil_addr_t addr)
inline

◆ alloc()

buf_block_t * lob::z_frag_page_t::alloc ( z_first_page_t first,
page_no_t  hint,
bool  bulk 
)

Allocate the fragment page.

Parameters
[in]firstfirst page of this LOB.
[in]hinthint page number for allocation.
[in]bulktrue if bulk operation (OPCODE_INSERT_BULK) false otherwise.
Returns
the allocated buffer block.

◆ alloc_dir_entry()

ulint lob::z_frag_page_t::alloc_dir_entry ( )

Grow the frag directory by one entry.

Returns
the fragment identifier that was newly added.

◆ alloc_frag_id()

ulint lob::z_frag_page_t::alloc_frag_id ( )
inline

Allocate a fragment id.

Returns
On success, return fragment id.
On failure, return FRAG_ID_NULL.

◆ alloc_fragment()

frag_id_t lob::z_frag_page_t::alloc_fragment ( ulint  size,
z_frag_entry_t entry 
)

Allocate a fragment with the given payload.

Parameters
[in]sizethe payload size.
[in]entrythe index entry of the given frag page.
Returns
the frag_id of the allocated fragment.
FRAG_ID_NULL if fragment could not be allocated.

◆ can_data_fit()

bool lob::z_frag_page_t::can_data_fit ( dict_index_t index,
ulint  data_size 
)
static

Determine if the given length of data can fit into a fragment page.

Parameters
[in]indexthe clust index into which LOB is inserted.
[in]data_sizeThe length of data to operate.
Returns
true if data can fit into fragment page, false otherwise.

◆ dealloc()

void lob::z_frag_page_t::dealloc ( )
inline

Free the fragment page.

◆ dealloc_frag_id() [1/2]

void lob::z_frag_page_t::dealloc_frag_id ( )
private

Deallocate all the free slots from the end of the page directory.

◆ dealloc_frag_id() [2/2]

void lob::z_frag_page_t::dealloc_frag_id ( ulint  frag_id)
inlineprivate

Deallocate the given fragment id.

Parameters
[in]frag_idThe fragment that needs to be deallocated.

◆ dealloc_fragment() [1/2]

void lob::z_frag_page_t::dealloc_fragment ( frag_node_t frag)
inlineprivate

◆ dealloc_fragment() [2/2]

void lob::z_frag_page_t::dealloc_fragment ( ulint  frag_id)
inline

◆ dealloc_with_entry()

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.

Parameters
[in]firstfirst page of LOB.
[in]alloc_mtrmini trx to perform this modification.

◆ decr_n_dir_entries()

void lob::z_frag_page_t::decr_n_dir_entries ( ) const
inline

◆ frag_id_to_addr()

paddr_t lob::z_frag_page_t::frag_id_to_addr ( ulint  frag_id) const
inline

◆ frag_list()

plist_base_node_t lob::z_frag_page_t::frag_list ( ) const
inline

◆ frame()

byte * lob::z_frag_page_t::frame ( ) const
inline

◆ free_list()

plist_base_node_t lob::z_frag_page_t::free_list ( ) const
inline

◆ get_big_free_len()

ulint lob::z_frag_page_t::get_big_free_len ( ) const

Get the big free space in this page.

◆ get_frag_entry()

fil_addr_t lob::z_frag_page_t::get_frag_entry ( ) const
inline

Obtain the file address of the fragment entry that denotes the current fragment page.

Returns
the file address of the fragment entry.

◆ get_frag_entry_addr()

fil_addr_t lob::z_frag_page_t::get_frag_entry_addr ( ) const
inlineprivate

◆ get_frag_entry_s()

z_frag_entry_t lob::z_frag_page_t::get_frag_entry_s ( )

◆ get_frag_entry_x()

z_frag_entry_t lob::z_frag_page_t::get_frag_entry_x ( )

◆ get_frag_node()

frag_node_t lob::z_frag_page_t::get_frag_node ( frag_id_t  id) const
inline

◆ get_n_dir_entries()

ulint lob::z_frag_page_t::get_n_dir_entries ( ) const
inline

◆ get_n_frags()

ulint lob::z_frag_page_t::get_n_frags ( ) const
inline

Get the number of fragments in this frag page.

◆ get_next_page_no()

page_no_t lob::z_frag_page_t::get_next_page_no ( ) const
inline

Get the next page number.

Returns
next page number.

◆ get_nth_dir_entry()

ulint lob::z_frag_page_t::get_nth_dir_entry ( ulint  frag_id)
inline

◆ get_page_no()

page_no_t lob::z_frag_page_t::get_page_no ( ) const
inline

Get the frag page number.

◆ get_page_size()

ulint lob::z_frag_page_t::get_page_size ( ) const
inline

◆ get_page_type()

page_type_t lob::z_frag_page_t::get_page_type ( ) const
inline

◆ get_page_type_str()

const char * lob::z_frag_page_t::get_page_type_str ( ) const
inline

◆ get_prev_page_no() [1/2]

page_no_t lob::z_frag_page_t::get_prev_page_no ( ) const
inline

Get the prev page number.

Returns
prev page number.

◆ get_prev_page_no() [2/2]

page_no_t lob::z_frag_page_t::get_prev_page_no ( mtr_t mtr) const
inline

Get the prev page number (FIL_PAGE_PREV).

Parameters
[in]mtrMini-transaction latch context.
Returns
prev page number.

◆ get_total_free_len()

ulint lob::z_frag_page_t::get_total_free_len ( ) const

Get the total cumulative free space in this page.

◆ get_total_stored_data()

ulint lob::z_frag_page_t::get_total_stored_data ( ) const

Get the total amount of stored data in this page.

◆ incr_n_dir_entries()

void lob::z_frag_page_t::incr_n_dir_entries ( ) const
inline

◆ init_last_dir_entry()

ulint lob::z_frag_page_t::init_last_dir_entry ( )
inline

◆ insert_into_frag_list()

void lob::z_frag_page_t::insert_into_frag_list ( frag_node_t frag)
inline

Insert the given fragment node into the fragment list.

Parameters
[in,out]fragthe fragment node to be inserted.

◆ insert_into_free_list()

void lob::z_frag_page_t::insert_into_free_list ( frag_node_t frag)
inline

◆ is_border_frag()

bool lob::z_frag_page_t::is_border_frag ( const frag_node_t node) const
inline

◆ is_last_frag()

bool lob::z_frag_page_t::is_last_frag ( const frag_node_t node) const
inline

Determine if the given fragment node is the last fragment node adjacent to the directory.

Returns
true if it is last fragment node, false otherwise.

◆ load_x()

buf_block_t * lob::z_frag_page_t::load_x ( page_no_t  page_no)
inline

◆ locate_free_slot()

ulint lob::z_frag_page_t::locate_free_slot ( )
inline

◆ max_payload()

static ulint lob::z_frag_page_t::max_payload ( dict_index_t index)
inlinestatic

The maximum free space available in a fragment page.

Adjustment needs to be done with the frag_node_t::overhead().

◆ merge_free_frags() [1/2]

void lob::z_frag_page_t::merge_free_frags ( )
inline

◆ merge_free_frags() [2/2]

void lob::z_frag_page_t::merge_free_frags ( frag_node_t frag)
inline

◆ payload()

ulint lob::z_frag_page_t::payload ( )
inline

The maximum free space available in a fragment page.

Adjustment needs to be done with the frag_node_t::overhead().

◆ print()

std::ostream & lob::z_frag_page_t::print ( std::ostream &  out) const
inline

◆ print_frag_id()

std::ostream & lob::z_frag_page_t::print_frag_id ( std::ostream &  out)
inline

◆ print_frag_list()

std::ostream & lob::z_frag_page_t::print_frag_list ( std::ostream &  out) const
inline

◆ print_frags_in_order()

std::ostream & lob::z_frag_page_t::print_frags_in_order ( std::ostream &  out) const

◆ print_free_list()

std::ostream & lob::z_frag_page_t::print_free_list ( std::ostream &  out) const
inline

◆ print_page_dir()

std::ostream & lob::z_frag_page_t::print_page_dir ( std::ostream &  out) const
inline

◆ set_block_null()

void lob::z_frag_page_t::set_block_null ( )
inline

◆ set_frag_entry()

void lob::z_frag_page_t::set_frag_entry ( const fil_addr_t addr) const
inline

◆ set_frag_entry_null()

void lob::z_frag_page_t::set_frag_entry_null ( ) const
inline

◆ set_index()

void lob::z_frag_page_t::set_index ( dict_index_t index)
inline

◆ set_mtr()

void lob::z_frag_page_t::set_mtr ( mtr_t mtr)
inline

◆ set_n_dir_entries()

void lob::z_frag_page_t::set_n_dir_entries ( ulint  n) const
inline

◆ set_nth_dir_entry()

void lob::z_frag_page_t::set_nth_dir_entry ( ulint  frag_id,
paddr_t  val 
)
inline

◆ set_page_next()

void lob::z_frag_page_t::set_page_next ( page_no_t  page_no)
inline

Set the next page.

◆ set_page_prev() [1/2]

void lob::z_frag_page_t::set_page_prev ( page_no_t  page_no)
inline

Set the prev page.

◆ set_page_prev() [2/2]

void lob::z_frag_page_t::set_page_prev ( page_no_t  page_no,
mtr_t mtr 
)
inline

Set the prev page.

◆ set_page_type()

void lob::z_frag_page_t::set_page_type ( )
inline

◆ set_space_id_no_redo()

void lob::z_frag_page_t::set_space_id_no_redo ( space_id_t  space_id)
inline

Write the space identifier to the page header, without generating redo log records.

Parameters
[in]space_idthe space identifier.

◆ set_version_0()

void lob::z_frag_page_t::set_version_0 ( )
inline

◆ slots_end_ptr()

byte * lob::z_frag_page_t::slots_end_ptr ( ) const
inline

◆ space_used_by_dir()

ulint lob::z_frag_page_t::space_used_by_dir ( ) const
inline

◆ split_free_frag()

void lob::z_frag_page_t::split_free_frag ( frag_node_t free_frag,
ulint  size 
)
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.

Parameters
[in]free_fragthe free fragment that will be split.
[in]sizethe payload size in bytes.

◆ update_frag_entry()

void lob::z_frag_page_t::update_frag_entry ( )
inline

◆ validate_lists()

bool lob::z_frag_page_t::validate_lists ( ) const
inline

Member Data Documentation

◆ m_block

buf_block_t* lob::z_frag_page_t::m_block
private

◆ m_index

dict_index_t* lob::z_frag_page_t::m_index
private

◆ m_mtr

mtr_t* lob::z_frag_page_t::m_mtr
private

◆ OFFSET_FRAG_ENTRY

const ulint lob::z_frag_page_t::OFFSET_FRAG_ENTRY = OFFSET_VERSION + 1
static

The location of z_frag_entry_t for this page.

◆ OFFSET_FRAGS_BEGIN

const ulint lob::z_frag_page_t::OFFSET_FRAGS_BEGIN
static
Initial value:
=
static const ulint SIZE
The total size (in bytes) of a page list base node.
Definition: lob0impl.h:257
static const ulint OFFSET_FRAGS_LIST
The offset within page where the fragment list begins.
Definition: lob0impl.h:1362

The offset within page where the fragments can occupy .

◆ OFFSET_FRAGS_LIST

const ulint lob::z_frag_page_t::OFFSET_FRAGS_LIST
static
Initial value:
=
static const ulint OFFSET_FREE_LIST
The offset within page where the free space list begins.
Definition: lob0impl.h:1359

The offset within page where the fragment list begins.

◆ OFFSET_FREE_LIST

const ulint lob::z_frag_page_t::OFFSET_FREE_LIST = OFFSET_FRAG_ENTRY + FIL_ADDR_SIZE
static

The offset within page where the free space list begins.

◆ OFFSET_PAGE_DIR_ENTRY_COUNT

const ulint lob::z_frag_page_t::OFFSET_PAGE_DIR_ENTRY_COUNT = FIL_PAGE_DATA_END + 2
static

Offset of number of page directory entries (from end)

◆ OFFSET_PAGE_DIR_ENTRY_FIRST

const ulint lob::z_frag_page_t::OFFSET_PAGE_DIR_ENTRY_FIRST
static
Initial value:
=
static const ulint OFFSET_PAGE_DIR_ENTRY_COUNT
Offset of number of page directory entries (from end)
Definition: lob0impl.h:1370

Offset of first page directory entry (from end)

◆ OFFSET_VERSION

const ulint lob::z_frag_page_t::OFFSET_VERSION = FIL_PAGE_DATA
static

Version information.

One byte.

◆ SIZE_OF_PAGE_DIR_ENTRY

const ulint lob::z_frag_page_t::SIZE_OF_PAGE_DIR_ENTRY = 2
static

The documentation for this struct was generated from the following files: