MySQL 8.0.32
Source Code Documentation
lob::zInserter Class Reference

Insert or write the compressed BLOB as a single zlib stream. More...

#include <lob0zip.h>

Inheritance diagram for lob::zInserter:
[legend]

Public Member Functions

 zInserter (InsertContext *ctx)
 Constructor. More...
 
 ~zInserter ()
 Destructor. More...
 
dberr_t prepare ()
 Prepare to write a compressed BLOB. More...
 
dberr_t write ()
 Write all the BLOBs of the clustered index record. More...
 
dberr_t write_one_blob (size_t blob_j)
 Write one blob field data. More...
 
dberr_t finish (bool validate=true)
 Cleanup after completing the write of compressed BLOB. More...
 
void log_page_type (page_t *blob_page, ulint nth_blob_page)
 Write the page type of the BLOB page and also generate the redo log record. More...
 
ulint calc_total_pages ()
 Calculate the total number of pages needed to store the given blobs. More...
 
int write_into_single_page ()
 Write contents into a single BLOB page. More...
 
void commit_blob_mtr ()
 Commit the BLOB mtr. More...
 
int write_single_blob_page (big_rec_field_t &field, ulint nth_blob_page)
 Write one blob page. More...
 
int write_first_page (big_rec_field_t &field)
 Write first blob page. More...
 
bool validate_blobrefs () const
 Verify that all pointers to externally stored columns in the record is be valid. More...
 
void update_length_in_blobref (big_rec_field_t &field)
 For the given blob field, update its length in the blob reference which is available in the clustered index record. More...
 
dberr_t set_page_next ()
 Make the current page as next page of previous page. More...
 
dberr_t write_one_small_blob (size_t blob_j)
 Write one small blob field data. More...
 

Private Member Functions

void add_to_blob_dir (const blob_page_info_t &page_info)
 Add the BLOB page information to the directory. More...
 
- Private Member Functions inherited from lob::BaseInserter
 BaseInserter (InsertContext *ctx)
 Constructor. More...
 
mtr_tstart_blob_mtr ()
 Start the BLOB mtr. More...
 
buf_block_talloc_blob_page ()
 Allocate one BLOB page. More...
 
page_tget_previous_blob_page ()
 Get the previous BLOB page frame. More...
 
buf_block_tget_previous_blob_block ()
 Get the previous BLOB page block. More...
 
bool is_index_sdi ()
 Check if the index is SDI index. More...
 
page_tcur_page () const
 Get the current BLOB page frame. More...
 

Private Attributes

mem_heap_tm_heap
 
z_stream m_stream
 
blob_dir_t m_dir
 The BLOB directory information. More...
 
- Private Attributes inherited from lob::BaseInserter
InsertContextm_ctx
 The BLOB operation context. More...
 
dberr_t m_err
 Success or failure status of the operation so far. More...
 
mtr_t m_blob_mtr
 The mini trx used to write into blob pages. More...
 
page_no_t m_prev_page_no
 The previous BLOB page number. More...
 
buf_block_tm_cur_blob_block
 The current BLOB buf_block_t object. More...
 
page_no_t m_cur_blob_page_no
 The current BLOB page number. More...
 

Detailed Description

Insert or write the compressed BLOB as a single zlib stream.

Constructor & Destructor Documentation

◆ zInserter()

lob::zInserter::zInserter ( InsertContext ctx)
inline

Constructor.

Parameters
[in]ctxblob operation context.

◆ ~zInserter()

lob::zInserter::~zInserter ( )
inline

Destructor.

Member Function Documentation

◆ add_to_blob_dir()

void lob::zInserter::add_to_blob_dir ( const blob_page_info_t page_info)
inlineprivate

Add the BLOB page information to the directory.

Parameters
[in]page_infoBLOB page information.

◆ calc_total_pages()

ulint lob::zInserter::calc_total_pages ( )
inline

Calculate the total number of pages needed to store the given blobs.

◆ commit_blob_mtr()

void lob::zInserter::commit_blob_mtr ( )
inline

Commit the BLOB mtr.

◆ finish()

dberr_t lob::zInserter::finish ( bool  validate = true)
inline

Cleanup after completing the write of compressed BLOB.

Parameters
[in]validateif true, validate all the lob references. if false, skip this validation.
Returns
DB_SUCCESS on success, error code on failure.

◆ log_page_type()

void lob::zInserter::log_page_type ( page_t blob_page,
ulint  nth_blob_page 
)
inline

Write the page type of the BLOB page and also generate the redo log record.

Parameters
[in]blob_pagethe BLOB page
[in]nth_blob_pagethe count of BLOB page from the beginning of the BLOB.

◆ prepare()

dberr_t lob::zInserter::prepare ( )

Prepare to write a compressed BLOB.

Setup the zlib compression stream.

Returns
DB_SUCCESS on success, error code on failure.

◆ set_page_next()

dberr_t lob::zInserter::set_page_next ( )

Make the current page as next page of previous page.

In other words, make the page m_cur_blob_page_no as the next page (FIL_PAGE_NEXT) of page m_prev_page_no.

Returns
DB_SUCCESS on success, or error code on failure.

◆ update_length_in_blobref()

void lob::zInserter::update_length_in_blobref ( big_rec_field_t field)

For the given blob field, update its length in the blob reference which is available in the clustered index record.

Parameters
[in]fieldthe concerned blob field.

◆ validate_blobrefs()

bool lob::zInserter::validate_blobrefs ( ) const
inline

Verify that all pointers to externally stored columns in the record is be valid.

If validation fails, this function doesn't return.

Returns
true if valid.

◆ write()

dberr_t lob::zInserter::write ( )

Write all the BLOBs of the clustered index record.

Returns
DB_SUCCESS on success, error code on failure.

◆ write_first_page()

int lob::zInserter::write_first_page ( big_rec_field_t field)

Write first blob page.

Parameters
[in]fieldthe big record field.
Returns
code as returned by the zlib.

◆ write_into_single_page()

int lob::zInserter::write_into_single_page ( )

Write contents into a single BLOB page.

Returns
code as returned by zlib.

◆ write_one_blob()

dberr_t lob::zInserter::write_one_blob ( size_t  blob_j)

Write one blob field data.

Parameters
[in]blob_jthe blob field number
Returns
DB_SUCCESS on success, error code on failure.

◆ write_one_small_blob()

dberr_t lob::zInserter::write_one_small_blob ( size_t  blob_j)

Write one small blob field data.

Refer to ref_t to determine the definition of small blob.

Parameters
[in]blob_jthe blob field number
Returns
DB_SUCCESS on success, error code on failure.

◆ write_single_blob_page()

int lob::zInserter::write_single_blob_page ( big_rec_field_t field,
ulint  nth_blob_page 
)

Write one blob page.

This function will be repeatedly called with an increasing nth_blob_page to completely write a BLOB.

Parameters
[in]fieldthe big record field.
[in]nth_blob_pagecount of the BLOB page (starting from 1).
Returns
code as returned by the zlib.

Member Data Documentation

◆ m_dir

blob_dir_t lob::zInserter::m_dir
private

The BLOB directory information.

◆ m_heap

mem_heap_t* lob::zInserter::m_heap
private

◆ m_stream

z_stream lob::zInserter::m_stream
private

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