MySQL 9.0.0
Source Code Documentation
Btree_multi::bulk::Blob_handle Class Reference

Used to insert a single blob into InnoDB. More...

Public Member Functions

 Blob_handle (Blob_inserter &inserter)
 Constructor. More...
 
dberr_t open (lob::ref_t &ref)
 Open a blob. More...
 
dberr_t write (lob::ref_t &ref, const byte *data, size_t len)
 Write data into a blob. More...
 
dberr_t close (lob::ref_t &ref)
 Close the blob. More...
 

Private Member Functions

dberr_t extend ()
 
Page_loadalloc_first_page ()
 Member of Blob_handle. More...
 
Page_loadalloc_data_page ()
 
Page_loadalloc_index_page ()
 
trx_id_t get_trx_id () const
 Get the current transaction id. More...
 

Private Attributes

lob::bulk::first_page_t m_first_page
 The first page of the blob. More...
 
lob::bulk::node_page_t m_node_page
 The LOB index page. More...
 
lob::bulk::data_page_t m_data_page
 The LOB data page. More...
 
Page_loadm_first_page_load {nullptr}
 Contains the BUF_BLOCK_MEMORY for the first blob page. More...
 
Page_loadm_node_page_load {nullptr}
 Contains the BUF_BLOCK_MEMORY for the current index page. More...
 
Page_loadm_data_page_load {nullptr}
 Contains the BUF_BLOCK_MEMORY for the current data page. More...
 
bool is_first_page {true}
 True if m_ptr points within first page. More...
 
bytem_ptr
 Location where blob data needs to be written. More...
 
size_t m_len
 Space available at m_ptr for writing blob data. More...
 
size_t m_blob_length {0}
 Total length of the blob. More...
 
lob::bulk::index_entry_tm_index_entry {nullptr}
 
byte m_ref [lob::ref_t::SIZE]
 This is the blob reference. More...
 
Blob_inserterm_blob_inserter
 A reference to the Blob_inserter, through which extents would be allocated. More...
 

Detailed Description

Used to insert a single blob into InnoDB.

The plan is to keep this private to this module.

Constructor & Destructor Documentation

◆ Blob_handle()

Btree_multi::bulk::Blob_handle::Blob_handle ( Blob_inserter inserter)
inline

Constructor.

Initialize a blob handle.

Parameters
[in]insertera Blob_inserter object that is inserting the blob.

Member Function Documentation

◆ alloc_data_page()

Page_load * Btree_multi::bulk::Blob_handle::alloc_data_page ( )
private

◆ alloc_first_page()

Page_load * Btree_multi::bulk::Blob_handle::alloc_first_page ( )
inlineprivate

Member of Blob_handle.

Allocate the first page of the blob. The returned Page_load object needs to contain a valid page_no and an associated buf_block_t of type BUF_BLOCK_MEMORY. The returned Page_load object is part of an extent that is managed by the m_blob_inserter.

Returns
a pointer to Page_load object or nullptr.

◆ alloc_index_page()

Page_load * Btree_multi::bulk::Blob_handle::alloc_index_page ( )
private

◆ close()

dberr_t Btree_multi::bulk::Blob_handle::close ( lob::ref_t ref)

Close the blob.

Parameters
[in,out]refblob reference object.
Returns
DB_SUCCESS on success, an error code on failure.

◆ extend()

dberr_t Btree_multi::bulk::Blob_handle::extend ( )
private

◆ get_trx_id()

trx_id_t Btree_multi::bulk::Blob_handle::get_trx_id ( ) const
inlineprivate

Get the current transaction id.

Returns
the current transaction id.

◆ open()

dberr_t Btree_multi::bulk::Blob_handle::open ( lob::ref_t ref)

Open a blob.

Parameters
[out]refreference of the blob created. It must have lob::ref_t::SIZE bytes to hold a blob reference.
Returns
DB_SUCCESS on success, an error code on failure.

◆ write()

dberr_t Btree_multi::bulk::Blob_handle::write ( lob::ref_t ref,
const byte data,
size_t  len 
)

Write data into a blob.

The write is done at the end of the blob.

Parameters
[in,out]refblob reference object.
[in]datapointer to blob data
[in]lennumber of bytes to write.
Returns
DB_SUCCESS on success, an error code on failure.

Member Data Documentation

◆ is_first_page

bool Btree_multi::bulk::Blob_handle::is_first_page {true}
private

True if m_ptr points within first page.

◆ m_blob_inserter

Blob_inserter& Btree_multi::bulk::Blob_handle::m_blob_inserter
private

A reference to the Blob_inserter, through which extents would be allocated.

◆ m_blob_length

size_t Btree_multi::bulk::Blob_handle::m_blob_length {0}
private

Total length of the blob.

◆ m_data_page

lob::bulk::data_page_t Btree_multi::bulk::Blob_handle::m_data_page
private

The LOB data page.

◆ m_data_page_load

Page_load* Btree_multi::bulk::Blob_handle::m_data_page_load {nullptr}
private

Contains the BUF_BLOCK_MEMORY for the current data page.

◆ m_first_page

lob::bulk::first_page_t Btree_multi::bulk::Blob_handle::m_first_page
private

The first page of the blob.

◆ m_first_page_load

Page_load* Btree_multi::bulk::Blob_handle::m_first_page_load {nullptr}
private

Contains the BUF_BLOCK_MEMORY for the first blob page.

Once initialized this will not change.

◆ m_index_entry

lob::bulk::index_entry_t* Btree_multi::bulk::Blob_handle::m_index_entry {nullptr}
private

◆ m_len

size_t Btree_multi::bulk::Blob_handle::m_len
private

Space available at m_ptr for writing blob data.

◆ m_node_page

lob::bulk::node_page_t Btree_multi::bulk::Blob_handle::m_node_page
private

The LOB index page.

◆ m_node_page_load

Page_load* Btree_multi::bulk::Blob_handle::m_node_page_load {nullptr}
private

Contains the BUF_BLOCK_MEMORY for the current index page.

◆ m_ptr

byte* Btree_multi::bulk::Blob_handle::m_ptr
private

Location where blob data needs to be written.

◆ m_ref

byte Btree_multi::bulk::Blob_handle::m_ref[lob::ref_t::SIZE]
private

This is the blob reference.

Valid after create() call.


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