MySQL 8.0.32
Source Code Documentation
AbstractCallback Class Reference

Functor that is called for each physical page that is read from the tablespace file. More...

Inheritance diagram for AbstractCallback:
[legend]

Public Member Functions

 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
 
virtual dberr_t operator() (os_offset_t offset, buf_block_t *block) 1=0
 Called for every page in the tablespace. More...
 
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...
 
virtual space_id_t get_space_id () const 1=0
 
virtual ulint get_space_flags () const 1=0
 
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
 

Protected Member Functions

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

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...
 

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...
 

Detailed Description

Functor that is called for each physical page that is read from the tablespace file.


Constructor & Destructor Documentation

◆ AbstractCallback()

AbstractCallback::AbstractCallback ( trx_t trx)
inline

Constructor.

Parameters
trxcovering transaction

◆ ~AbstractCallback()

AbstractCallback::~AbstractCallback ( )
inlineoverride

Free any extent descriptor instance.

Member Function Documentation

◆ get_frame()

buf_frame_t * AbstractCallback::get_frame ( buf_block_t block) const
inlineprotected

Get the data page depending on the table type, compressed or not.

Parameters
blockblock read from disk
Return values
thebuffer frame

◆ init()

dberr_t AbstractCallback::init ( os_offset_t  file_size,
const buf_block_t block 
)
overridevirtual

Determine the page size to use for traversing the tablespace.

Parameters
file_sizesize of the tablespace file in bytes
blockcontents of the first page in the tablespace file.
Return values
DB_SUCCESSor error code.

Implements PageCallback.

◆ is_compressed_table()

bool AbstractCallback::is_compressed_table ( ) const
inline
Returns
true if compressed table.

◆ is_free()

bool AbstractCallback::is_free ( page_no_t  page_no) const
inlineprotected

Check if the page is marked as free in the extent descriptor.

Parameters
page_nopage number to check in the extent descriptor.
Returns
true if the page is marked as free

◆ is_root_page()

bool AbstractCallback::is_root_page ( const page_t page) const
inlineprotected
Returns
true if it is a root page

◆ periodic_check()

dberr_t AbstractCallback::periodic_check ( )
inlineprotected

Check for session interrupt.

If required we could even flush to disk here every N pages.

Return values
DB_SUCCESSor error code

◆ set_current_xdes()

dberr_t AbstractCallback::set_current_xdes ( page_no_t  page_no,
const page_t page 
)
inlineprotected

Set the current page directory (xdes).

If the extent descriptor is marked as free then free the current extent descriptor and set it to 0. This implies that all pages that are covered by this extent descriptor are also freed.

Parameters
page_nooffset of page within the file
pagepage contents
Returns
DB_SUCCESS or error code.

◆ xdes()

const xdes_t * AbstractCallback::xdes ( ulint  page_no,
const page_t page 
) const
inlineprotected

Get the physical offset of the extent descriptor within the page.

Parameters
page_nopage number of the extent descriptor
pagecontents of the page containing the extent descriptor.
Returns
the start of the xdes array in a page

Member Data Documentation

◆ m_free_limit

page_no_t AbstractCallback::m_free_limit
protected

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.

See also
FSP_LIMIT.

◆ m_size

page_no_t AbstractCallback::m_size
protected

Current size of the space in pages.

◆ m_space

space_id_t AbstractCallback::m_space
protected

Space id of the file being iterated over.

◆ m_space_flags

uint32_t AbstractCallback::m_space_flags
protected

Flags value read from the header page.

◆ m_table_flags

uint32_t AbstractCallback::m_table_flags
protected

Derived from m_space_flags and row format type, the row format type is determined from the page header.

◆ m_trx

trx_t* AbstractCallback::m_trx
protected

Covering transaction.

◆ m_xdes

xdes_t* AbstractCallback::m_xdes
protected

Current extent descriptor page.

◆ m_xdes_page_no

page_no_t AbstractCallback::m_xdes_page_no
protected

Physical page offset in the file of the extent descriptor.


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