MySQL 8.3.0
Source Code Documentation
PageConverter Class Reference
Inheritance diagram for PageConverter:
[legend]

Public Member Functions

 PageConverter (row_import *cfg, trx_t *trx) 1
 Constructor. More...
 
 ~PageConverter () 1 override
 
space_id_t get_space_id () const 1 override
 
ulint get_space_flags () const 1 override
 
dberr_t operator() (os_offset_t offset, buf_block_t *block) override 1
 Called for every page in the tablespace. More...
 
- Public Member Functions inherited from AbstractCallback
 AbstractCallback (trx_t *trx)
 Constructor. More...
 
 ~AbstractCallback () override
 Free any extent descriptor instance. More...
 
dberr_t init (os_offset_t file_size, const buf_block_t *block) override 1
 Determine the page size to use for traversing the tablespace. More...
 
bool is_compressed_table () const 1
 
- Public Member Functions inherited from PageCallback
 PageCallback ()
 Default constructor. More...
 
virtual ~PageCallback () 1=default
 
void set_file (const char *filename, pfs_os_file_t file) 1
 Set the name of the physical file and the file handle that is used to open it for the file that is being iterated over. More...
 
void set_page_size (const buf_frame_t *page) 1
 Set the tablespace table size. More...
 
const page_size_tget_page_size () const
 The compressed page size. More...
 
 PageCallback (PageCallback &&)=delete
 
 PageCallback (const PageCallback &)=delete
 
PageCallbackoperator= (const PageCallback &)=delete
 

Private Types

enum  import_page_status_t { IMPORT_PAGE_STATUS_OK , IMPORT_PAGE_STATUS_ALL_ZERO , IMPORT_PAGE_STATUS_CORRUPTED }
 Status returned by PageConverter::validate() More...
 

Private Member Functions

dberr_t update_page (buf_block_t *block, ulint &page_type) 1
 Update the page, set the space id, max trx id and index id. More...
 
bool trigger_corruption () 1
 
dberr_t update_index_page (buf_block_t *block) 1
 Update the space, index id, trx id. More...
 
dberr_t update_records (buf_block_t *block) 1
 Update the BLOB references and write UNDO log entries for rows that can't be purged optimistically. More...
 
import_page_status_t validate (os_offset_t offset, buf_block_t *block) 1
 Validate the page, check for corruption. More...
 
dberr_t update_header (buf_block_t *block) 1
 Validate the space flags and update tablespace header page. More...
 
dberr_t adjust_cluster_index_blob_column (rec_t *rec, const ulint *offsets, ulint i) 1
 Adjust the BLOB reference for a single column that is externally stored. More...
 
dberr_t adjust_cluster_index_blob_columns (rec_t *rec, const ulint *offsets) 1
 Adjusts the BLOB reference in the clustered index row for all externally stored columns. More...
 
dberr_t adjust_cluster_index_blob_ref (rec_t *rec, const ulint *offsets) 1
 In the clustered index, adjist the BLOB pointers as needed. More...
 
bool purge () 1
 Purge delete-marked records, only if it is possible to do so without re-organising the B+tree. More...
 
dberr_t adjust_cluster_record (const dict_index_t *index, rec_t *rec, const ulint *offsets) 1
 Adjust the BLOB references and sys fields for the current record. More...
 
row_index_tfind_index (space_index_t id) 1
 Find an index with the matching id. More...
 

Private Attributes

row_importm_cfg
 Config for table that is being imported. More...
 
row_index_tm_index
 Current index whose pages are being imported. More...
 
lsn_t m_current_lsn
 Current system LSN. More...
 
page_zip_des_tm_page_zip_ptr
 Alias for m_page_zip, only set for compressed pages. More...
 
RecIterator m_rec_iter
 Iterator over records in a block. More...
 
ulint m_offsets_ [REC_OFFS_NORMAL_SIZE]
 Record offset. More...
 
ulintm_offsets
 Pointer to m_offsets_. More...
 
mem_heap_tm_heap
 Memory heap for the record offsets. More...
 
dict_index_tm_cluster_index
 Cluster index instance. More...
 

Additional Inherited Members

- Public Attributes inherited from PageCallback
page_size_t m_page_size
 The tablespace page size. More...
 
pfs_os_file_t m_file
 File handle to the tablespace. More...
 
const char * m_filepath
 Physical file path. More...
 
- Protected Member Functions inherited from AbstractCallback
buf_frame_tget_frame (buf_block_t *block) const 1
 Get the data page depending on the table type, compressed or not. More...
 
dberr_t periodic_check () 1
 Check for session interrupt. More...
 
const xdes_txdes (ulint page_no, const page_t *page) const 1
 Get the physical offset of the extent descriptor within the page. More...
 
dberr_t set_current_xdes (page_no_t page_no, const page_t *page) 1
 Set the current page directory (xdes). More...
 
bool is_root_page (const page_t *page) const 1
 
bool is_free (page_no_t page_no) const 1
 Check if the page is marked as free in the extent descriptor. More...
 
- Protected Attributes inherited from AbstractCallback
trx_tm_trx
 Covering transaction. More...
 
space_id_t m_space
 Space id of the file being iterated over. More...
 
page_no_t m_free_limit
 Minimum page number for which the free list has not been initialized: the pages >= this limit are, by definition, free; note that in a single-table tablespace where size < 64 pages, this number is 64, i.e., we have initialized the space about the first extent, but have not physically allocated those pages to the file. More...
 
page_no_t m_size
 Current size of the space in pages. More...
 
xdes_tm_xdes
 Current extent descriptor page. More...
 
page_no_t m_xdes_page_no
 Physical page offset in the file of the extent descriptor. More...
 
uint32_t m_space_flags
 Flags value read from the header page. More...
 
uint32_t m_table_flags
 Derived from m_space_flags and row format type, the row format type is determined from the page header. More...
 

Member Enumeration Documentation

◆ import_page_status_t

Status returned by PageConverter::validate()

Enumerator
IMPORT_PAGE_STATUS_OK 

Page is OK.

IMPORT_PAGE_STATUS_ALL_ZERO 

Page is all zeros.

IMPORT_PAGE_STATUS_CORRUPTED 

Page is corrupted.

Constructor & Destructor Documentation

◆ PageConverter()

PageConverter::PageConverter ( row_import cfg,
trx_t trx 
)

Constructor.

Parameters
cfgconfig of table being imported.
trxtransaction covering the import

◆ ~PageConverter()

PageConverter::~PageConverter ( )
inlineoverride

Member Function Documentation

◆ adjust_cluster_index_blob_column()

dberr_t PageConverter::adjust_cluster_index_blob_column ( rec_t rec,
const ulint offsets,
ulint  i 
)
private

Adjust the BLOB reference for a single column that is externally stored.

Parameters
recrecord to update
offsetscolumn offsets for the record
icolumn ordinal value
Returns
DB_SUCCESS or error code

◆ adjust_cluster_index_blob_columns()

dberr_t PageConverter::adjust_cluster_index_blob_columns ( rec_t rec,
const ulint offsets 
)
private

Adjusts the BLOB reference in the clustered index row for all externally stored columns.

Parameters
recrecord to update
offsetscolumn offsets for the record
Returns
DB_SUCCESS or error code

◆ adjust_cluster_index_blob_ref()

dberr_t PageConverter::adjust_cluster_index_blob_ref ( rec_t rec,
const ulint offsets 
)
private

In the clustered index, adjist the BLOB pointers as needed.

In the clustered index, adjust BLOB pointers as needed.

Also update the BLOB reference, write the new space id.

Parameters
recrecord to update
offsetscolumn offsets for the record
Returns
DB_SUCCESS or error code

◆ adjust_cluster_record()

dberr_t PageConverter::adjust_cluster_record ( const dict_index_t index,
rec_t rec,
const ulint offsets 
)
private

Adjust the BLOB references and sys fields for the current record.

Parameters
indexthe index being converted
recrecord to update
offsetscolumn offsets for the record
Returns
DB_SUCCESS or error code.

◆ find_index()

row_index_t * PageConverter::find_index ( space_index_t  id)
inlineprivate

Find an index with the matching id.

Returns
row_index_t* instance or 0

◆ get_space_flags()

ulint PageConverter::get_space_flags ( ) const
inlineoverridevirtual
Return values
thespace flags of the tablespace being iterated over

Implements PageCallback.

◆ get_space_id()

space_id_t PageConverter::get_space_id ( ) const
inlineoverridevirtual
Return values
theserver space id of the tablespace being iterated over

Implements PageCallback.

◆ operator()()

dberr_t PageConverter::operator() ( os_offset_t  offset,
buf_block_t block 
)
overridevirtual

Called for every page in the tablespace.

If the page was not updated then its state must be set to BUF_PAGE_NOT_USED.

Parameters
offsetphysical offset within the file
blockblock read from file, note it is not from the buffer pool
Return values
DB_SUCCESSor error code.

Implements PageCallback.

◆ purge()

bool PageConverter::purge ( )
private

Purge delete-marked records, only if it is possible to do so without re-organising the B+tree.

Returns
true if purge succeeded

◆ trigger_corruption()

bool PageConverter::trigger_corruption ( )
inlineprivate
Returns
true error condition is enabled.

◆ update_header()

dberr_t PageConverter::update_header ( buf_block_t block)
private

Validate the space flags and update tablespace header page.

Parameters
blockblock read from file, not from the buffer pool.
Return values
DB_SUCCESSor error code

◆ update_index_page()

dberr_t PageConverter::update_index_page ( buf_block_t block)
private

Update the space, index id, trx id.

Parameters
blockblock to convert
Returns
DB_SUCCESS or error code
DB_SUCCESS or error code

◆ update_page()

dberr_t PageConverter::update_page ( buf_block_t block,
ulint page_type 
)
private

Update the page, set the space id, max trx id and index id.

Parameters
blockblock read from file
page_typetype of the page
Return values
DB_SUCCESSor error code

◆ update_records()

dberr_t PageConverter::update_records ( buf_block_t block)
private

Update the BLOB references and write UNDO log entries for rows that can't be purged optimistically.

Parameters
blockblock to update
Return values
DB_SUCCESSor error code

◆ validate()

PageConverter::import_page_status_t PageConverter::validate ( os_offset_t  offset,
buf_block_t block 
)
private

Validate the page, check for corruption.

Parameters
offsetphysical offset within file.
blockpage read from file.
Returns
0 on success, 1 if all zero, 2 if corrupted

Member Data Documentation

◆ m_cfg

row_import* PageConverter::m_cfg
private

Config for table that is being imported.

◆ m_cluster_index

dict_index_t* PageConverter::m_cluster_index
private

Cluster index instance.

◆ m_current_lsn

lsn_t PageConverter::m_current_lsn
private

Current system LSN.

◆ m_heap

mem_heap_t* PageConverter::m_heap
private

Memory heap for the record offsets.

◆ m_index

row_index_t* PageConverter::m_index
private

Current index whose pages are being imported.

◆ m_offsets

ulint* PageConverter::m_offsets
private

Pointer to m_offsets_.

◆ m_offsets_

ulint PageConverter::m_offsets_[REC_OFFS_NORMAL_SIZE]
private

Record offset.

◆ m_page_zip_ptr

page_zip_des_t* PageConverter::m_page_zip_ptr
private

Alias for m_page_zip, only set for compressed pages.

◆ m_rec_iter

RecIterator PageConverter::m_rec_iter
private

Iterator over records in a block.


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