MySQL 8.4.2
Source Code Documentation
|
The proper function call sequence of Page_load is as below: – Page_load::init – Page_load::insert – Page_load::finish – Page_load::commit. More...
#include <btr0mtib.h>
Public Types | |
using | Rec_offsets = ulint * |
Public Member Functions | |
Page_load (dict_index_t *index, Btree_load *btree_load) | |
Ctor. More... | |
~Page_load () noexcept | |
Destructor. More... | |
bool | is_corrupted () const |
Check if page is corrupted. More... | |
void | print_child_page_nos () noexcept |
Print the child page numbers. More... | |
bool | is_memory () const |
Check if state of this page is BUF_BLOCK_MEMORY. More... | |
Page_load (dict_index_t *index, trx_id_t trx_id, page_no_t page_no, size_t level, Flush_observer *observer, Btree_load *btree_load=nullptr) noexcept | |
Constructor. More... | |
void | set_trx_id (const trx_id_t trx_id) |
Set the transaction id. More... | |
void | set_flush_observer (Flush_observer *observer) |
Set the flush observer. More... | |
bool | is_leaf () const |
void | set_page_no (const page_no_t page_no) |
Set the page number of this object. More... | |
void | set_leaf_seg (const fseg_header_t *hdr) |
void | set_top_seg (const fseg_header_t *hdr) |
dberr_t | init () noexcept |
Initialize members and allocate page if needed and start mtr. More... | |
dberr_t | init_mem (const page_no_t new_page_no, Page_extent *page_extent) noexcept |
dberr_t | alloc () noexcept |
Allocate a page for this Page_load object. More... | |
dberr_t | reinit () noexcept |
Re-initialize this page. More... | |
void | reset () noexcept |
Reset this object so that Page_load::init() can be called again on this object. 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... | |
dberr_t | commit () noexcept |
Commit mtr for a page. More... | |
void | rollback () noexcept |
Commit mtr for a page. 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_t * | get_node_ptr () noexcept |
Get node pointer. More... | |
dtuple_t * | get_node_ptr (mem_heap_t *heap) noexcept |
Get node pointer. More... | |
size_t | copy_all (const page_t *src_page) noexcept |
Copy all records from page. More... | |
size_t | copy_to (std::vector< Page_load * > &to_pages) |
Distribute all records from this page to the given pages. 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... | |
page_no_t | get_prev () noexcept |
Get previous page (FIL_PAGE_PREV). 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... | |
page_id_t | get_page_id () const noexcept |
size_t | get_page_size () const noexcept |
Get the physical page size of the underlying tablespace. More... | |
space_id_t | space () const noexcept |
Get the table space ID. More... | |
bool | verify_space_id () const |
Obtain tablespace id from the frame and the buffer block and ensure that they are the same. More... | |
size_t | get_level () const noexcept |
Get page level. More... | |
void | set_level (size_t level) noexcept |
Set the level of this page. More... | |
size_t | get_rec_no () const |
Get record no. More... | |
const page_t * | get_page () const noexcept |
Get page. More... | |
page_t * | get_page () noexcept |
void | init_for_writing () |
size_t | get_data_size () const |
bool | is_index_locked () noexcept |
Check if index is X locked. More... | |
size_t | copy_records (const rec_t *first_rec) noexcept |
Copy given and all following records. 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... | |
void | set_min_rec_flag (mtr_t *mtr) |
Set the REC_INFO_MIN_REC_FLAG on the first user record in this page. More... | |
void | set_min_rec_flag () |
Set the REC_INFO_MIN_REC_FLAG on the first user record in this page. More... | |
bool | is_min_rec_flag () const |
void | set_level_ctx (Level_ctx *level_ctx) |
Set the level context object for this page load. More... | |
bool | has_level_ctx () const |
Check if this page load object contains a level context object. More... | |
void | free () |
Free the memory block. More... | |
dict_index_t * | index () |
buf_block_t * | get_block () |
void | set_page_extent (Page_extent *page_extent) |
void | set_cached () |
Mark the Page load as cached. More... | |
bool | is_cached () const |
Static Public Member Functions | |
static Page_load * | create (Btree_load *btree_load, Page_extent *page_extent) |
A static member function to create this object. More... | |
static void | drop (Page_load *page_load) |
Release the page loader. More... | |
Private Attributes | |
mem_heap_t * | m_heap {} |
Memory heap for internal allocation. More... | |
dict_index_t * | m_index {} |
The index B-tree. More... | |
mtr_t * | m_mtr {} |
The min-transaction. More... | |
trx_id_t | m_trx_id {} |
The transaction id. More... | |
buf_block_t * | m_block {} |
The buffer block. More... | |
page_t * | m_page {} |
The page. More... | |
rec_t * | m_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... | |
byte * | m_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_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_observer * | m_flush_observer {} |
Flush observer. More... | |
rec_t * | m_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... | |
Btree_load * | m_btree_load {} |
Level_ctx * | m_level_ctx {} |
Page_extent * | m_page_extent {} |
std::atomic_bool | m_is_cached {false} |
true iff the the Page load is cached. More... | |
Friends | |
class | Btree_load |
Additional Inherited Members | |
Private Member Functions inherited from ut::Non_copyable | |
Non_copyable (const Non_copyable &)=delete | |
Non_copyable & | operator= (const Non_copyable &)=delete |
Non_copyable ()=default | |
~Non_copyable ()=default | |
The proper function call sequence of Page_load is as below: – Page_load::init – Page_load::insert – Page_load::finish – Page_load::commit.
using Btree_multi::Page_load::Rec_offsets = ulint * |
Page_load::Page_load | ( | dict_index_t * | index, |
Btree_load * | btree_load | ||
) |
Ctor.
[in] | index | B-tree index |
[in] | btree_load | btree object to which this page belongs. |
|
noexcept |
Destructor.
|
inlinenoexcept |
Constructor.
[in] | index | B-tree index |
[in] | trx_id | Transaction id |
[in] | page_no | Page number |
[in] | level | Page level |
[in] | observer | Flush observer |
[in] | btree_load | btree object to which this page belongs. |
|
noexcept |
Allocate a page for this Page_load object.
|
noexcept |
Commit mtr for a page.
|
noexcept |
Copy all records from page.
[in] | src_page | Page with records to copy. |
|
noexcept |
Copy given and all following records.
[in] | first_rec | First record to copy |
size_t Page_load::copy_to | ( | std::vector< Page_load * > & | to_pages | ) |
Distribute all records from this page to the given pages.
[in,out] | to_pages | array of Page_load objects. return total number of records processed. |
|
static |
A static member function to create this object.
[in] | btree_load | the bulk load object to which this Page_load belongs. |
[in] | page_extent | page extent to which this page belongs. |
|
static |
Release the page loader.
Delete if not cached.
[in] | page_load | page loader to delete. |
|
noexcept |
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.
void Page_load::free | ( | ) |
Free the memory block.
|
inline |
|
inline |
|
inlinenoexcept |
Get page level.
|
inlinenoexcept |
Get node pointer.
|
noexcept |
Get node pointer.
[in] | heap | allocate node pointer in the given heap. |
|
inlinenoexcept |
Get page.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Get page no.
|
inlinenoexcept |
Get the physical page size of the underlying tablespace.
|
noexcept |
Get previous page (FIL_PAGE_PREV).
|
inline |
Get record no.
|
inline |
Check if this page load object contains a level context object.
|
inline |
|
noexcept |
Initialize members and allocate page if needed and start mtr.
void Page_load::init_for_writing | ( | ) |
|
noexcept |
|
noexcept |
Insert a tuple in the page.
[in] | tuple | Tuple to insert |
[in] | big_rec | External record |
[in] | rec_size | Record size |
|
noexcept |
Insert a record in the page, check for duplicates too.
[in] | rec | Record |
[in] | offsets | Record offsets |
|
inline |
bool Page_load::is_corrupted | ( | ) | const |
Check if page is corrupted.
|
noexcept |
Check if index is X locked.
|
inline |
|
inline |
Check if state of this page is BUF_BLOCK_MEMORY.
bool Page_load::is_min_rec_flag | ( | ) | const |
|
inlinenoexcept |
Check if required space is available in the page for the rec to be inserted.
We check fill factor & padding here.
[in] | rec_size | Required space |
|
noexcept |
Start mtr and latch block.
|
noexcept |
Check whether the record needs to be stored externally.
|
noexcept |
Print the child page numbers.
|
noexcept |
Re-initialize this page.
|
noexcept |
Reset this object so that Page_load::init() can be called again on this object.
|
noexcept |
Commit mtr for a page.
|
inline |
Mark the Page load as cached.
Flush thread should not free this Page.
|
inline |
Set the flush observer.
[in] | observer | the flush observer object to use. |
|
inline |
|
inlinenoexcept |
Set the level of this page.
|
inline |
Set the level context object for this page load.
[in] | level_ctx | the level context object. |
void Page_load::set_min_rec_flag | ( | ) |
Set the REC_INFO_MIN_REC_FLAG on the first user record in this page.
void Page_load::set_min_rec_flag | ( | mtr_t * | mtr | ) |
Set the REC_INFO_MIN_REC_FLAG on the first user record in this page.
[in] | mtr | mini transaction context. |
|
noexcept |
Set next page.
[in] | next_page_no | Next page no |
|
inline |
void Page_load::set_page_no | ( | const page_no_t | page_no | ) |
Set the page number of this object.
|
noexcept |
Set previous page.
[in] | prev_page_no | Previous page no |
|
inline |
|
inline |
Set the transaction id.
[in] | trx_id | the transaction id to used. |
|
inlinenoexcept |
Get the table space ID.
|
noexcept |
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.
[in] | big_rec | External record |
[in] | offsets | Record offsets |
bool Page_load::verify_space_id | ( | ) | const |
Obtain tablespace id from the frame and the buffer block and ensure that they are the same.
|
friend |
|
private |
The buffer block.
|
private |
|
private |
The current rec, just before the next insert rec.
|
private |
Flush observer.
|
private |
The free space left in the page.
|
private |
Memory heap for internal allocation.
|
private |
The heap top in page for next insert.
|
private |
The index B-tree.
|
private |
true iff the the Page load is cached.
|
private |
Flag: is page in compact format.
|
private |
Last record assigned to a slot.
|
private |
The page level in B-tree.
|
private |
|
private |
Page modified flag.
|
private |
The modify clock value of the buffer block when the block is re-pinned.
|
private |
The min-transaction.
|
private |
The page.
|
private |
|
private |
The page no.
|
private |
User record no.
|
private |
The reserved space for fill factor.
|
private |
Number of records assigned to slots.
|
private |
Total data in the page.
|
private |
The transaction id.