MySQL 8.0.39
Source Code Documentation
File_segment_inode Class Reference

A wrapper class to operate on a file segment inode pointer (fseg_inode_t*) More...

#include <fsp0fsp.h>

Public Member Functions

 File_segment_inode (space_id_t space_id, const page_size_t &page_size, fseg_inode_t *inode, mtr_t *mtr)
 Constructor. More...
 
void write_not_full_n_used (uint32_t n_used)
 Update the value of FSEG_NOT_FULL_N_USED. More...
 
uint32_t read_not_full_n_used () const
 Get the current value of FSEG_NOT_FULL_N_USED. More...
 
uint64_t get_seg_id () const
 Get the segment identifier value. More...
 
std::ostream & print (std::ostream &out) const
 Print the current object into the given output stream. More...
 
bool verify_not_full_n_used ()
 Verify the stored FSEG_NOT_FULL_N_USED value. More...
 

Private Member Functions

page_no_t calculate_not_full_n_used ()
 Calculate the value of FSEG_NOT_FULL_N_USED by traversing the FSEG_NOT_FULL list. More...
 
bool do_verify ()
 To reduce the cost of verification of FSEG_NOT_FULL_N_USED, do it only when this function returns true. More...
 

Private Attributes

space_id_t m_space_id
 Unique tablespace identifier. More...
 
const page_size_tm_page_size
 The page size used in this tablespace. More...
 
fseg_inode_tm_fseg_inode
 file segment inode pointer that is being wrapped by this object. More...
 
mtr_tm_mtr
 The mini-transaction operation context. More...
 
std::random_device m_rd
 
std::default_random_engine m_random_engine
 
std::uniform_int_distribution< int > m_dist
 

Detailed Description

A wrapper class to operate on a file segment inode pointer (fseg_inode_t*)

Constructor & Destructor Documentation

◆ File_segment_inode()

File_segment_inode::File_segment_inode ( space_id_t  space_id,
const page_size_t page_size,
fseg_inode_t inode,
mtr_t mtr 
)
inline

Constructor.

Parameters
[in]space_idTable space identifier
[in]page_sizeSize of each page in the tablespace.
[in]inodeFile segment inode pointer
[in]mtrMini-transaction context.

Member Function Documentation

◆ calculate_not_full_n_used()

page_no_t File_segment_inode::calculate_not_full_n_used ( )
private

Calculate the value of FSEG_NOT_FULL_N_USED by traversing the FSEG_NOT_FULL list.

Returns
the calculated value of FSEG_NOT_FULL_N_USED.

◆ do_verify()

bool File_segment_inode::do_verify ( )
inlineprivate

To reduce the cost of verification of FSEG_NOT_FULL_N_USED, do it only when this function returns true.

Returns
true for 10% of the time.

◆ get_seg_id()

uint64_t File_segment_inode::get_seg_id ( ) const
inline

Get the segment identifier value.

Returns
the segment identifier value.

◆ print()

std::ostream & File_segment_inode::print ( std::ostream &  out) const

Print the current object into the given output stream.

Returns
the output stream.

◆ read_not_full_n_used()

uint32_t File_segment_inode::read_not_full_n_used ( ) const

Get the current value of FSEG_NOT_FULL_N_USED.

Returns
the current value of FSEG_NOT_FULL_N_USED.

◆ verify_not_full_n_used()

bool File_segment_inode::verify_not_full_n_used ( )

Verify the stored FSEG_NOT_FULL_N_USED value.

Returns
true if correct value, false if incorrect.

◆ write_not_full_n_used()

void File_segment_inode::write_not_full_n_used ( uint32_t  n_used)

Update the value of FSEG_NOT_FULL_N_USED.

Parameters
[in]n_usedthe new value of FSEG_NOT_FULL_N_USED.

Member Data Documentation

◆ m_dist

std::uniform_int_distribution<int> File_segment_inode::m_dist
private

◆ m_fseg_inode

fseg_inode_t* File_segment_inode::m_fseg_inode
private

file segment inode pointer that is being wrapped by this object.

◆ m_mtr

mtr_t* File_segment_inode::m_mtr
private

The mini-transaction operation context.

◆ m_page_size

const page_size_t& File_segment_inode::m_page_size
private

The page size used in this tablespace.

◆ m_random_engine

std::default_random_engine File_segment_inode::m_random_engine
private

◆ m_rd

std::random_device File_segment_inode::m_rd
private

◆ m_space_id

space_id_t File_segment_inode::m_space_id
private

Unique tablespace identifier.


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