MySQL 9.0.0
Source Code Documentation
lob::bulk::first_page_t Struct Reference

An adapter class for handling blobs in bulk load. More...

#include <lob0bulk.h>

Inheritance diagram for lob::bulk::first_page_t:
[legend]

Public Member Functions

 first_page_t ()
 
void init (Btree_multi::Page_load *page_load)
 Initialize the first page. More...
 
void set_next_page (page_no_t page_no)
 
void set_page_type ()
 
void set_version_0 ()
 
void set_trx_id (trx_id_t id)
 
void set_data_len (ulint len)
 Set the length of data stored in bytes. More...
 
void incr_data_len (ulint len)
 Increment the length of data stored in bytes. More...
 
flst_node_talloc_index_entry ()
 Allocate an index entry. More...
 
void set_last_trx_id (trx_id_t id)
 Set the last transaction identifier. More...
 
void init_lob_version ()
 Initialize the LOB version to 1. More...
 
trx_id_t get_trx_id () const
 Get the current transaction identifier. More...
 
page_no_t get_page_no () const
 Get the page number of this first page. More...
 
void reset_index_entry (flst_node_t *node)
 
void append_to_index (flst_node_t *node)
 
index_entry_tget_index_entry ()
 
std::vector< buf_block_t * > & get_blocks_cache ()
 Get a reference to the cache of blocks. More...
 
- Public Member Functions inherited from lob::first_page_t
 first_page_t ()=default
 The default constructor. More...
 
 first_page_t (buf_block_t *block, mtr_t *mtr)
 Constructor. More...
 
 first_page_t (buf_block_t *block)
 Constructor. More...
 
 first_page_t (buf_block_t *block, mtr_t *mtr, dict_index_t *index)
 Constructor. More...
 
 first_page_t (mtr_t *mtr, dict_index_t *index)
 Constructor. More...
 
void set_version_0 ()
 Set the LOB format version number to 0. More...
 
uint8_t get_flags ()
 Obtain the flags value. More...
 
bool can_be_partially_updated ()
 When the bit is set, the LOB is not partially updatable anymore. More...
 
void import (trx_id_t trx_id)
 Do tablespace import. More...
 
void mark_cannot_be_partially_updated (trx_t *trx)
 When the bit is set, the LOB is not partially updatable anymore. More...
 
buf_block_talloc (mtr_t *alloc_mtr, bool is_bulk)
 Allocate the first page for uncompressed LOB. More...
 
void free_all_index_pages ()
 Free all the index pages. More...
 
void free_all_data_pages ()
 Free all the data pages. More...
 
buf_block_tload_s (page_id_t page_id, page_size_t page_size)
 Load the first page of LOB with s-latch. More...
 
buf_block_tload_x (const page_id_t &page_id, const page_size_t &page_size, mtr_t *mtr)
 Load the first page of LOB with x-latch. More...
 
buf_block_tload_x (mtr_t *mtr) const
 Load the first page of LOB with x-latch in the given mtr context. More...
 
buf_block_tload_x (const page_id_t &page_id, const page_size_t &page_size)
 Load the first page of LOB with x-latch. More...
 
buf_block_tget_block ()
 Get the buffer block of the LOB first page. More...
 
flst_node_taddr2ptr_x (const fil_addr_t &addr, mtr_t *mtr) const
 Load the file list node from the given location. More...
 
flst_node_taddr2ptr_x (fil_addr_t &addr) const
 Load the file list node from the given location. More...
 
flst_node_taddr2ptr (const fil_addr_t &addr)
 Load the file list node from the given location, assuming that it exists in the first page itself. More...
 
flst_node_taddr2ptr_s (fil_addr_t &addr)
 Load the file list node from the given location. More...
 
flst_node_taddr2ptr_s_cache (std::map< page_no_t, buf_block_t * > &cache, fil_addr_t &addr) const
 Load the file list node from the given location. More...
 
void dealloc ()
 Free the first page. More...
 
void destroy ()
 Free all the pages associated with this LOB. More...
 
void make_empty ()
 Free all the pages associated with this LOB, except the first page. More...
 
bool is_empty () const
 Check if the index list is empty or not. More...
 
flst_node_talloc_index_entry (bool bulk)
 Allocate one index entry. More...
 
bytenodes_begin () const
 Get a pointer to the beginning of the index entry nodes in the first part of the page. More...
 
void set_trx_id_no_redo (trx_id_t id)
 Set the transaction identifier in the first page header without generating redo logs. More...
 
void set_trx_id (trx_id_t id)
 Set the transaction identifier in the first page header. More...
 
void init_lob_version ()
 Initialize the LOB version to 1. More...
 
uint32_t get_lob_version ()
 Get the lob version number. More...
 
uint32_t incr_lob_version ()
 Increment the lob version by 1. More...
 
void set_last_trx_id_no_redo (trx_id_t id)
 Set the last transaction identifier, without generating redo log records. More...
 
void set_last_trx_id (trx_id_t id)
 Set the last transaction identifier. More...
 
void set_last_trx_undo_no (undo_no_t undo_no)
 Set the last transaction undo number. More...
 
trx_id_t get_last_trx_id () const
 Get the last transaction identifier. More...
 
undo_no_t get_last_trx_undo_no () const
 Get the last transaction undo number. More...
 
void set_data_len (ulint len)
 Set the length of data stored in bytes. More...
 
ulint write (trx_id_t trxid, const byte *&data, ulint &len)
 Write as much as possible of the given data into the page. More...
 
buf_block_treplace (trx_t *trx, ulint offset, const byte *&ptr, ulint &want, mtr_t *mtr)
 Replace data in the page by making a copy-on-write. More...
 
void replace_inline (ulint offset, const byte *&ptr, ulint &want, mtr_t *mtr)
 Replace data in the page inline. More...
 
ulint get_data_len () const
 
ulint read (ulint offset, byte *ptr, ulint want)
 Read data from the first page. More...
 
void set_page_type ()
 
flst_base_node_tindex_list () const
 
flst_base_node_tfree_list () const
 
std::ostream & print_index_entries (std::ostream &out) const
 
std::ostream & print_index_entries_cache_s (std::ostream &out, BlockCache &cache) const
 
bytedata_begin () const
 Obtain the location where the data begins. More...
 
ulint append (trx_id_t trxid, byte *&data, ulint &len)
 Append data into a LOB first page. More...
 
bool validate () const
 Validate the first page. More...
 
page_type_t get_page_type ()
 
void restart_mtr (mtr_t *mtr)
 Restart the given mtr. More...
 
- Public Member Functions inherited from lob::basic_page_t
 basic_page_t ()
 
 basic_page_t (buf_block_t *block, mtr_t *mtr)
 
 basic_page_t (buf_block_t *block, mtr_t *mtr, dict_index_t *index)
 
void set_space_id_no_redo (space_id_t space_id)
 Update the space identifier to given value without generating any redo log records. More...
 
page_no_t get_page_no () const
 Get page number of the current page. More...
 
page_id_t get_page_id () const
 Get the page id of the current page. More...
 
void set_next_page (page_no_t page_no, mtr_t *mtr)
 Set the FIL_PAGE_NEXT to the given page number, using the given mini transaction context. More...
 
void set_next_page (page_no_t page_no)
 Set the FIL_PAGE_NEXT to the given page number. More...
 
void set_next_page_null ()
 Set the FIL_PAGE_NEXT to FIL_NULL. More...
 
page_no_t get_next_page ()
 
page_type_t get_page_type () const
 
byteframe () const
 
flst_node_tget_flst_node (const fil_addr_t &addr)
 
ulint max_space_available ()
 
buf_block_tget_block () const noexcept
 Get the underlying buffer block. More...
 
void set_block (buf_block_t *block)
 
void set_mtr (mtr_t *mtr)
 

Private Member Functions

void init_lists ()
 Initialize the free list (base node at OFFSET_INDEX_FREE_NODES) and the index list (base node at OFFSET_INDEX_LIST). More...
 

Private Attributes

Btree_multi::Page_loadm_page_load {nullptr}
 
index_entry_t m_index_entry
 Current index entry. More...
 
std::vector< buf_block_t * > m_blocks
 blocks containing the LOB index . More...
 

Additional Inherited Members

- Static Public Member Functions inherited from lob::first_page_t
static ulint payload ()
 Calculate and return the payload. More...
 
static ulint max_space_available ()
 Get the number of bytes used to store LOB data in the first page of uncompressed LOB. More...
 
constexpr static ulint node_count ()
 Get the number of index entries this page can hold. More...
 
static page_type_t get_page_type (dict_index_t *index, const page_id_t &page_id, const page_size_t &page_size)
 
- Static Public Member Functions inherited from lob::basic_page_t
static ulint payload ()
 
- Static Public Attributes inherited from lob::first_page_t
static const ulint OFFSET_VERSION = FIL_PAGE_DATA
 Version information. More...
 
static const ulint OFFSET_FLAGS = FIL_PAGE_DATA + 1
 One byte of flag bits. More...
 
static const uint32_t OFFSET_LOB_VERSION = OFFSET_FLAGS + 1
 LOB version. More...
 
static const ulint OFFSET_LAST_TRX_ID = OFFSET_LOB_VERSION + 4
 The latest transaction that modified this LOB. More...
 
static const ulint OFFSET_LAST_UNDO_NO = OFFSET_LAST_TRX_ID + 6
 The latest transaction undo_no that modified this LOB. More...
 
static const ulint OFFSET_DATA_LEN = OFFSET_LAST_UNDO_NO + 4
 Length of data stored in this page. More...
 
static const ulint OFFSET_TRX_ID = OFFSET_DATA_LEN + 4
 The trx that created the data stored in this page. More...
 
static const ulint OFFSET_INDEX_LIST = OFFSET_TRX_ID + 6
 The offset where the list base node is located. More...
 
static const ulint OFFSET_INDEX_FREE_NODES
 The offset where the list base node is located. More...
 
static const ulint LOB_PAGE_DATA
 The offset where the contents of the first page begins. More...
 
static const ulint LOB_PAGE_TRAILER_LEN = FIL_PAGE_DATA_END
 
- Protected Attributes inherited from lob::basic_page_t
buf_block_tm_block {nullptr}
 
mtr_tm_mtr {nullptr}
 
dict_index_tm_index {nullptr}
 

Detailed Description

An adapter class for handling blobs in bulk load.

Constructor & Destructor Documentation

◆ first_page_t()

lob::bulk::first_page_t::first_page_t ( )
inline

Member Function Documentation

◆ alloc_index_entry()

flst_node_t * lob::bulk::first_page_t::alloc_index_entry ( )

Allocate an index entry.

Returns
nullptr if the free list is empty.
pointer to an index entry.

◆ append_to_index()

void lob::bulk::first_page_t::append_to_index ( flst_node_t node)

◆ get_blocks_cache()

std::vector< buf_block_t * > & lob::bulk::first_page_t::get_blocks_cache ( )
inline

Get a reference to the cache of blocks.

Returns
a reference to the cache of blocks.

◆ get_index_entry()

index_entry_t * lob::bulk::first_page_t::get_index_entry ( )
inline

◆ get_page_no()

page_no_t lob::bulk::first_page_t::get_page_no ( ) const

Get the page number of this first page.

Returns
the page number of this first page.

◆ get_trx_id()

trx_id_t lob::bulk::first_page_t::get_trx_id ( ) const

Get the current transaction identifier.

Returns
the current transaction identifier.

◆ incr_data_len()

void lob::bulk::first_page_t::incr_data_len ( ulint  len)
inline

Increment the length of data stored in bytes.

Parameters
[in]lenamount of data stored in bytes.

◆ init()

void lob::bulk::first_page_t::init ( Btree_multi::Page_load page_load)

Initialize the first page.

◆ init_lists()

void lob::bulk::first_page_t::init_lists ( )
private

Initialize the free list (base node at OFFSET_INDEX_FREE_NODES) and the index list (base node at OFFSET_INDEX_LIST).

◆ init_lob_version()

void lob::bulk::first_page_t::init_lob_version ( )
inline

Initialize the LOB version to 1.

◆ reset_index_entry()

void lob::bulk::first_page_t::reset_index_entry ( flst_node_t node)
inline

◆ set_data_len()

void lob::bulk::first_page_t::set_data_len ( ulint  len)
inline

Set the length of data stored in bytes.

Parameters
[in]lenamount of data stored in bytes.

◆ set_last_trx_id()

void lob::bulk::first_page_t::set_last_trx_id ( trx_id_t  id)
inline

Set the last transaction identifier.

Parameters
[in]idthe trx identifier.

◆ set_next_page()

void lob::bulk::first_page_t::set_next_page ( page_no_t  page_no)

◆ set_page_type()

void lob::bulk::first_page_t::set_page_type ( )
inline

◆ set_trx_id()

void lob::bulk::first_page_t::set_trx_id ( trx_id_t  id)
inline

◆ set_version_0()

void lob::bulk::first_page_t::set_version_0 ( )
inline

Member Data Documentation

◆ m_blocks

std::vector<buf_block_t *> lob::bulk::first_page_t::m_blocks
private

blocks containing the LOB index .

◆ m_index_entry

index_entry_t lob::bulk::first_page_t::m_index_entry
private

Current index entry.

◆ m_page_load

Btree_multi::Page_load* lob::bulk::first_page_t::m_page_load {nullptr}
private

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