MySQL 9.1.0
Source Code Documentation
Btree_multi::Level_ctx Struct Reference

Context information for each level. More...

#include <btr0mtib.h>

Public Member Functions

 Level_ctx (dict_index_t *index, size_t level, Btree_load *btree_load)
 Constructor. More...
 
 ~Level_ctx ()
 Destructor. More...
 
dberr_t init ()
 Initialize. More...
 
bool is_leaf () const
 Check if this is leaf level. More...
 
Page_loadcreate_page_load ()
 
void free_page_load ()
 Free the current page load. More...
 
dberr_t alloc_page_num (page_no_t &page_no)
 Allocate a page number. More...
 
dberr_t alloc_extent ()
 Allocate one extent in the relevant file segment. More...
 
buf_block_talloc (const page_no_t new_page_no) noexcept
 Allocate private memory buffer (BUF_BLOCK_MEMORY) block for given page number. More...
 
void set_current_page_load (Page_load *sibling)
 
Page_loadget_page_load () const
 
trx_id_t get_trx_id () const
 
void build_extent_cache ()
 Build the extent cache. More...
 
bool load_extent_from_cache ()
 Load one extent from extent cache. More...
 
void build_page_cache ()
 Build page loader cache for current exent. More...
 
Page_loadget_page_load_from_cache ()
 Get a free page loader from cache. More...
 
bool is_page_tracked (const page_no_t &page_no) const
 

Static Public Member Functions

static Level_ctxcreate (dict_index_t *index, size_t level, Btree_load *btree_load)
 Static member function construct a Level_ctx object. More...
 
static void destroy (Level_ctx *obj)
 Static member function to destroy a Level_ctx object. More...
 

Public Attributes

Page_extentm_page_extent {}
 The current extent that is being loaded. More...
 
std::vector< Page_extent * > m_cached_extents
 Pre allocated extents to prevent repeated allocation and free. More...
 
page_no_t m_first_page {FIL_NULL}
 The page_no of the first page in this level. More...
 
page_no_t m_last_page {FIL_NULL}
 The page_no of the last page in this level. More...
 
dict_index_tm_index {}
 The index which is being built. More...
 
const size_t m_level {}
 The B-tree level whose context information is stored in this obj. More...
 
Page_loadm_page_load {}
 The Page_load of the current page being loaded. More...
 
Btree_loadm_btree_load
 A back pointer to conceptually higher level btree load object. More...
 
size_t m_stat_n_pages {}
 Number of pages allocated at this level. More...
 
size_t m_stat_n_extents {}
 Number of extents allocated at this level. More...
 
bool m_extent_full {true}
 True if the current extent is full. More...
 
std::vector< page_no_tm_pages_allocated
 

Detailed Description

Context information for each level.

Constructor & Destructor Documentation

◆ Level_ctx()

Btree_multi::Level_ctx::Level_ctx ( dict_index_t index,
size_t  level,
Btree_load btree_load 
)
inline

Constructor.

Parameters
[in]indexdictionary index object.
[in]levelthe B-tree level of this context object.
[in]btree_loada back pointer to the Btree_load object to which this Level_ctx object is a part of.

◆ ~Level_ctx()

Btree_multi::Level_ctx::~Level_ctx ( )

Destructor.

Member Function Documentation

◆ alloc()

buf_block_t * Btree_multi::Level_ctx::alloc ( const page_no_t  new_page_no)
noexcept

Allocate private memory buffer (BUF_BLOCK_MEMORY) block for given page number.

◆ alloc_extent()

dberr_t Btree_multi::Level_ctx::alloc_extent ( )

Allocate one extent in the relevant file segment.

No associated buffer blocks are allocated.

Returns
DB_SUCCESS on success, error code on failure.

◆ alloc_page_num()

dberr_t Btree_multi::Level_ctx::alloc_page_num ( page_no_t page_no)

Allocate a page number.

Subsequently a Page_load will be created with the allocated page number.

Parameters
[out]page_nopage number that was allocated.
Returns
DB_SUCCESS on success, error code on failure.

◆ build_extent_cache()

void Btree_multi::Level_ctx::build_extent_cache ( )

Build the extent cache.

◆ build_page_cache()

void Btree_multi::Level_ctx::build_page_cache ( )

Build page loader cache for current exent.

◆ create()

Level_ctx * Btree_multi::Level_ctx::create ( dict_index_t index,
size_t  level,
Btree_load btree_load 
)
static

Static member function construct a Level_ctx object.

Parameters
[in]indexdictionary index object.
[in]levelthe B-tree level of this context object.
[in]btree_loada back pointer to the Btree_load object to which this Level_ctx object is a part of.
Returns
level context object on success, nullptr on error.

◆ create_page_load()

Page_load * Btree_multi::Level_ctx::create_page_load ( )

◆ destroy()

void Btree_multi::Level_ctx::destroy ( Level_ctx obj)
static

Static member function to destroy a Level_ctx object.

Parameters
[in]objthe Level_ctx object to destroy.

◆ free_page_load()

void Btree_multi::Level_ctx::free_page_load ( )

Free the current page load.

◆ get_page_load()

Page_load * Btree_multi::Level_ctx::get_page_load ( ) const
inline

◆ get_page_load_from_cache()

Page_load * Btree_multi::Level_ctx::get_page_load_from_cache ( )

Get a free page loader from cache.

Returns
page loader or nullptr if not found.

◆ get_trx_id()

trx_id_t Btree_multi::Level_ctx::get_trx_id ( ) const
inline

◆ init()

dberr_t Btree_multi::Level_ctx::init ( void  )

Initialize.

Returns
DB_SUCCESS on success, an error code on failure.

◆ is_leaf()

bool Btree_multi::Level_ctx::is_leaf ( ) const
inline

Check if this is leaf level.

Returns
true if this is leaf level, false otherwise.

◆ is_page_tracked()

bool Btree_multi::Level_ctx::is_page_tracked ( const page_no_t page_no) const

◆ load_extent_from_cache()

bool Btree_multi::Level_ctx::load_extent_from_cache ( )

Load one extent from extent cache.

Returns
true iff successful.

◆ set_current_page_load()

void Btree_multi::Level_ctx::set_current_page_load ( Page_load sibling)
inline

Member Data Documentation

◆ m_btree_load

Btree_load* Btree_multi::Level_ctx::m_btree_load

A back pointer to conceptually higher level btree load object.

◆ m_cached_extents

std::vector<Page_extent *> Btree_multi::Level_ctx::m_cached_extents

Pre allocated extents to prevent repeated allocation and free.

◆ m_extent_full

bool Btree_multi::Level_ctx::m_extent_full {true}

True if the current extent is full.

◆ m_first_page

page_no_t Btree_multi::Level_ctx::m_first_page {FIL_NULL}

The page_no of the first page in this level.

◆ m_index

dict_index_t* Btree_multi::Level_ctx::m_index {}

The index which is being built.

◆ m_last_page

page_no_t Btree_multi::Level_ctx::m_last_page {FIL_NULL}

The page_no of the last page in this level.

◆ m_level

const size_t Btree_multi::Level_ctx::m_level {}

The B-tree level whose context information is stored in this obj.

◆ m_page_extent

Page_extent* Btree_multi::Level_ctx::m_page_extent {}

The current extent that is being loaded.

◆ m_page_load

Page_load* Btree_multi::Level_ctx::m_page_load {}

The Page_load of the current page being loaded.

◆ m_pages_allocated

std::vector<page_no_t> Btree_multi::Level_ctx::m_pages_allocated

◆ m_stat_n_extents

size_t Btree_multi::Level_ctx::m_stat_n_extents {}

Number of extents allocated at this level.

◆ m_stat_n_pages

size_t Btree_multi::Level_ctx::m_stat_n_pages {}

Number of pages allocated at this level.


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