MySQL 9.1.0
Source Code Documentation
Page_load Class Reference

The proper function call sequence of Page_load is as below: – Page_load::init – Page_load::insert – Page_load::finish – Page_load::compress(COMPRESSED table only) – Page_load::page_split(COMPRESSED table only) – Page_load::commit. More...

Inheritance diagram for Page_load:
[legend]

Classes

struct  Split_point
 Page split point descriptor. More...
 

Public Member Functions

 Page_load (dict_index_t *index, trx_id_t trx_id, page_no_t page_no, size_t level, Flush_observer *observer) noexcept
 Constructor. More...
 
 ~Page_load () noexcept
 Destructor. More...
 

Private Types

using Rec_offsets = ulint *
 

Private Member Functions

dberr_t init () noexcept
 Initialize members and allocate page if needed and start mtr. More...
 
dberr_t insert (const dtuple_t *tuple, const big_rec_t *big_rec, size_t rec_size) noexcept
 Insert a tuple in the page. More...
 
void finish () noexcept
 Mark end of insertion to the page. More...
 
void commit () noexcept
 Commit mtr for a page. More...
 
void rollback () noexcept
 Commit mtr for a page. More...
 
bool compress () noexcept
 Compress if it is compressed table. More...
 
bool need_ext (const dtuple_t *tuple, size_t rec_size) const noexcept
 Check whether the record needs to be stored externally. More...
 
dtuple_tget_node_ptr () noexcept
 Get node pointer. More...
 
void split (Page_load &new_page_load) noexcept
 Split the page records between this and given bulk. More...
 
void copy_all (const page_t *src_page) noexcept
 Copy all records from page. More...
 
void set_next (page_no_t next_page_no) noexcept
 Set next page. More...
 
void set_prev (page_no_t prev_page_no) noexcept
 Set previous page. More...
 
void release () noexcept
 Release block by committing mtr. More...
 
void latch () noexcept
 Start mtr and latch block. More...
 
bool is_space_available (size_t rec_size) const noexcept
 Check if required space is available in the page for the rec to be inserted. More...
 
page_no_t get_page_no () const noexcept
 Get page no. More...
 
size_t get_level () const noexcept
 Get page level. More...
 
size_t get_rec_no () const
 Get record no. More...
 
const page_tget_page () const noexcept
 Get page. More...
 
bool is_table_compressed () const noexcept
 Check if table is compressed. More...
 
bool is_index_locked () noexcept
 Check if index is X locked. More...
 
Split_point get_split_rec () noexcept
 Get page split point. More...
 
void copy_records (const rec_t *first_rec) noexcept
 Copy given and all following records. More...
 
void split_trim (const Split_point &split_point) noexcept
 Remove all records after split rec including itself. More...
 
dberr_t insert (const rec_t *rec, Rec_offsets offsets) noexcept
 Insert a record in the page, check for duplicates too. More...
 
dberr_t store_ext (const big_rec_t *big_rec, Rec_offsets offsets) noexcept
 Store external record Since the record is not logged yet, so we don't log update to the record. More...
 
- Private Member Functions inherited from ut::Non_copyable
 Non_copyable (const Non_copyable &)=delete
 
Non_copyableoperator= (const Non_copyable &)=delete
 
 Non_copyable ()=default
 
 ~Non_copyable ()=default
 

Private Attributes

mem_heap_tm_heap {}
 Memory heap for internal allocation. More...
 
dict_index_tm_index {}
 The index B-tree. More...
 
mtr_tm_mtr {}
 The min-transaction. More...
 
trx_id_t m_trx_id {}
 The transaction id. More...
 
buf_block_tm_block {}
 The buffer block. More...
 
page_tm_page {}
 The page. More...
 
page_zip_des_tm_page_zip {}
 The page zip descriptor. More...
 
rec_tm_cur_rec {}
 The current rec, just before the next insert rec. More...
 
page_no_t m_page_no {}
 The page no. More...
 
size_t m_level {}
 The page level in B-tree. More...
 
const bool m_is_comp {}
 Flag: is page in compact format. More...
 
bytem_heap_top {}
 The heap top in page for next insert. More...
 
size_t m_rec_no {}
 User record no. More...
 
size_t m_free_space {}
 The free space left in the page. More...
 
size_t m_reserved_space {}
 The reserved space for fill factor. More...
 
size_t m_padding_space {}
 The padding space for compressed page. More...
 
size_t m_total_data {}
 Total data in the page. More...
 
uint64_t m_modify_clock {}
 The modify clock value of the buffer block when the block is re-pinned. More...
 
Flush_observerm_flush_observer {}
 Flush observer. More...
 
rec_tm_last_slotted_rec {}
 Last record assigned to a slot. More...
 
size_t m_slotted_rec_no {}
 Number of records assigned to slots. More...
 
bool m_modified {}
 Page modified flag. More...
 
int32_t m_n_blocks_buf_fixed {}
 Number of blocks which are buffer fixed but not pushed to mtr memo. More...
 

Friends

class Btree_load
 

Detailed Description

The proper function call sequence of Page_load is as below: – Page_load::init – Page_load::insert – Page_load::finish – Page_load::compress(COMPRESSED table only) – Page_load::page_split(COMPRESSED table only) – Page_load::commit.

Member Typedef Documentation

◆ Rec_offsets

using Page_load::Rec_offsets = ulint *
private

Constructor & Destructor Documentation

◆ Page_load()

Page_load::Page_load ( dict_index_t index,
trx_id_t  trx_id,
page_no_t  page_no,
size_t  level,
Flush_observer observer 
)
inlinenoexcept

Constructor.

Parameters
[in]indexB-tree index
[in]trx_idTransaction id
[in]page_noPage number
[in]levelPage level
[in]observerFlush observer

◆ ~Page_load()

Page_load::~Page_load ( )
inlinenoexcept

Destructor.

Member Function Documentation

◆ commit()

void Page_load::commit ( )
privatenoexcept

Commit mtr for a page.

◆ compress()

bool Page_load::compress ( )
privatenoexcept

Compress if it is compressed table.

Returns
true compress successfully or no need to compress
false compress failed.

◆ copy_all()

void Page_load::copy_all ( const page_t src_page)
privatenoexcept

Copy all records from page.

Parameters
[in]src_pagePage with records to copy.

◆ copy_records()

void Page_load::copy_records ( const rec_t first_rec)
privatenoexcept

Copy given and all following records.

Parameters
[in]first_recFirst record to copy

◆ finish()

void Page_load::finish ( )
privatenoexcept

Mark end of insertion to the page.

Scan records to set page dirs, and set page header members. The scan is incremental (slots and records which assignment could be "finalized" are not checked again. Check the m_slotted_rec_no usage, note it could be reset in some cases like during split. Note: we refer to page_copy_rec_list_end_to_created_page.

◆ get_level()

size_t Page_load::get_level ( ) const
inlineprivatenoexcept

Get page level.

◆ get_node_ptr()

dtuple_t * Page_load::get_node_ptr ( )
privatenoexcept

Get node pointer.

Returns
node pointer

◆ get_page()

const page_t * Page_load::get_page ( ) const
inlineprivatenoexcept

Get page.

◆ get_page_no()

page_no_t Page_load::get_page_no ( ) const
inlineprivatenoexcept

Get page no.

◆ get_rec_no()

size_t Page_load::get_rec_no ( ) const
inlineprivate

Get record no.

◆ get_split_rec()

Page_load::Split_point Page_load::get_split_rec ( )
privatenoexcept

Get page split point.

We split a page in half when compression fails, and the split record and all following records should be copied to the new page.

Returns
split record descriptor

◆ init()

dberr_t Page_load::init ( void  )
privatenoexcept

Initialize members and allocate page if needed and start mtr.

Note
Must be called and only once right after constructor.
Returns
error code

◆ insert() [1/2]

dberr_t Page_load::insert ( const dtuple_t tuple,
const big_rec_t big_rec,
size_t  rec_size 
)
privatenoexcept

Insert a tuple in the page.

Parameters
[in]tupleTuple to insert
[in]big_recExternal record
[in]rec_sizeRecord size
Returns
error code

◆ insert() [2/2]

dberr_t Page_load::insert ( const rec_t rec,
Rec_offsets  offsets 
)
privatenoexcept

Insert a record in the page, check for duplicates too.

Parameters
[in]recRecord
[in]offsetsRecord offsets
Returns
DB_SUCCESS or error code.

◆ is_index_locked()

bool Page_load::is_index_locked ( )
privatenoexcept

Check if index is X locked.

Returns
true if index is locked.

◆ is_space_available()

bool Page_load::is_space_available ( size_t  rec_size) const
inlineprivatenoexcept

Check if required space is available in the page for the rec to be inserted.

We check fill factor & padding here.

Parameters
[in]rec_sizeRequired space
Returns
true if space is available

◆ is_table_compressed()

bool Page_load::is_table_compressed ( ) const
inlineprivatenoexcept

Check if table is compressed.

Returns
true if table is compressed, false otherwise.

◆ latch()

void Page_load::latch ( )
inlineprivatenoexcept

Start mtr and latch block.

Start mtr and latch the block.

◆ need_ext()

bool Page_load::need_ext ( const dtuple_t tuple,
size_t  rec_size 
) const
privatenoexcept

Check whether the record needs to be stored externally.

Returns
false if the entire record can be stored locally on the page

◆ release()

void Page_load::release ( )
inlineprivatenoexcept

Release block by committing mtr.

◆ rollback()

void Page_load::rollback ( )
privatenoexcept

Commit mtr for a page.

◆ set_next()

void Page_load::set_next ( page_no_t  next_page_no)
privatenoexcept

Set next page.

Parameters
[in]next_page_noNext page no

◆ set_prev()

void Page_load::set_prev ( page_no_t  prev_page_no)
privatenoexcept

Set previous page.

Parameters
[in]prev_page_noPrevious page no

◆ split()

void Page_load::split ( Page_load new_page_load)
privatenoexcept

Split the page records between this and given bulk.

Parameters
new_page_loadThe new bulk to store split records.

◆ split_trim()

void Page_load::split_trim ( const Split_point split_point)
privatenoexcept

Remove all records after split rec including itself.

Parameters
[in]split_pointSplit point descriptor

◆ store_ext()

dberr_t Page_load::store_ext ( const big_rec_t big_rec,
Rec_offsets  offsets 
)
privatenoexcept

Store external record Since the record is not logged yet, so we don't log update to the record.

the blob data is logged first, then the record is logged in bulk mode.

Parameters
[in]big_recExternal record
[in]offsetsRecord offsets
Returns
error code

Friends And Related Function Documentation

◆ Btree_load

friend class Btree_load
friend

Member Data Documentation

◆ m_block

buf_block_t* Page_load::m_block {}
private

The buffer block.

◆ m_cur_rec

rec_t* Page_load::m_cur_rec {}
private

The current rec, just before the next insert rec.

◆ m_flush_observer

Flush_observer* Page_load::m_flush_observer {}
private

Flush observer.

◆ m_free_space

size_t Page_load::m_free_space {}
private

The free space left in the page.

◆ m_heap

mem_heap_t* Page_load::m_heap {}
private

Memory heap for internal allocation.

◆ m_heap_top

byte* Page_load::m_heap_top {}
private

The heap top in page for next insert.

◆ m_index

dict_index_t* Page_load::m_index {}
private

The index B-tree.

◆ m_is_comp

const bool Page_load::m_is_comp {}
private

Flag: is page in compact format.

◆ m_last_slotted_rec

rec_t* Page_load::m_last_slotted_rec {}
private

Last record assigned to a slot.

◆ m_level

size_t Page_load::m_level {}
private

The page level in B-tree.

◆ m_modified

bool Page_load::m_modified {}
private

Page modified flag.

◆ m_modify_clock

uint64_t Page_load::m_modify_clock {}
private

The modify clock value of the buffer block when the block is re-pinned.

◆ m_mtr

mtr_t* Page_load::m_mtr {}
private

The min-transaction.

◆ m_n_blocks_buf_fixed

int32_t Page_load::m_n_blocks_buf_fixed {}
private

Number of blocks which are buffer fixed but not pushed to mtr memo.

◆ m_padding_space

size_t Page_load::m_padding_space {}
private

The padding space for compressed page.

◆ m_page

page_t* Page_load::m_page {}
private

The page.

◆ m_page_no

page_no_t Page_load::m_page_no {}
private

The page no.

◆ m_page_zip

page_zip_des_t* Page_load::m_page_zip {}
private

The page zip descriptor.

◆ m_rec_no

size_t Page_load::m_rec_no {}
private

User record no.

◆ m_reserved_space

size_t Page_load::m_reserved_space {}
private

The reserved space for fill factor.

◆ m_slotted_rec_no

size_t Page_load::m_slotted_rec_no {}
private

Number of records assigned to slots.

◆ m_total_data

size_t Page_load::m_total_data {}
private

Total data in the page.

◆ m_trx_id

trx_id_t Page_load::m_trx_id {}
private

The transaction id.


The documentation for this class was generated from the following file: