MySQL 9.6.0
Source Code Documentation
ddl_bulk::Loader::Thread_data Class Reference

#include <ddl0bulk.h>

Public Member Functions

void init (const row_prebuilt_t *prebuilt)
 Initialize thread specific data. More...
 
dberr_t load (const row_prebuilt_t *prebuilt, Btree_multi::Btree_load *sub_tree, const Rows_mysql &rows, Bulk_load::Stat_callbacks &wait_cbk)
 Load rows to a sub-tree for a specific thread. More...
 
bool set_source_table_data (const row_prebuilt_t *prebuilt, const Bulk_load::Source_table_data &source_table)
 
dberr_t copy_existing_data (const row_prebuilt_t *prebuilt, Btree_multi::Btree_load *sub_tree, Bulk_load::Stat_callbacks &wait_cbk)
 
dberr_t open_blob (Btree_multi::Btree_load *sub_tree, Blob_context &blob_ctx, lob::ref_t &ref)
 Create a blob. More...
 
dberr_t write_blob (Btree_multi::Btree_load *sub_tree, Blob_context blob_ctx, lob::ref_t &ref, const byte *data, size_t len)
 Write data into the blob. More...
 
dberr_t close_blob (Btree_multi::Btree_load *sub_tree, Blob_context blob_ctx, lob::ref_t &ref)
 Indicate that the blob has been completed, so that resources can be removed, and as necessary flushing can be done. More...
 
void free ()
 Free thread specific data. More...
 
dberr_t get_error () const
 
std::string get_error_string () const
 
int get_error_code () const
 Get the client error code (eg. More...
 
void add_subtree (Btree_multi::Btree_load *subtree)
 Add given subtree to the list of subtrees. More...
 
Btree_multi::Btree_loadget_subtree ()
 Get the last subtree created by this thread. More...
 
Btree_multi::Btree_loadget_subtree (Blob_context ctx) const
 

Public Attributes

size_t m_queue_size
 Flush queue size used by the Bulk_flusher. More...
 
std::list< Btree_multi::Btree_load * > m_list_subtrees
 Each subtree needs to have a disjoint set of keys. More...
 
uint64_t m_last_rowid {0}
 The last DB_ROW_ID used by this thread. More...
 

Private Member Functions

void read_input_entry (const Rows_mysql &rows, size_t &row_index, const row_prebuilt_t *prebuilt, mem_heap_t *gcol_heap, bool &gcol_blobs_flushed)
 
void read_table_entry (const row_prebuilt_t *prebuilt)
 
void insert_from_input_and_move_to_next (const row_prebuilt_t *prebuilt, const Rows_mysql &rows, size_t &row_index, Btree_multi::Btree_load *sub_tree, mem_heap_t *gcol_heap, bool &gcol_blobs_flushed)
 
void insert_from_original_table_and_move_to_next (const row_prebuilt_t *prebuilt, Btree_multi::Btree_load *sub_tree)
 
void insert_smaller_entry (const row_prebuilt_t *prebuilt, Btree_multi::Btree_load *sub_tree, const Rows_mysql &rows, size_t &row_index, const ddl::Compare_key &compare_key, mem_heap_t *gcol_heap, bool &gcol_blobs_flushed)
 

Private Attributes

mem_heap_tm_heap {}
 Heap for allocating tuple memory. More...
 
dtuple_tm_input_row {}
 Tuple for converting input data to table row. More...
 
dtuple_tm_table_row {}
 
dtuple_tm_input_entry {}
 Tuple for inserting row to index. More...
 
dtuple_tm_original_table_entry {}
 Tuple for inserting row to index. More...
 
dtuple_tm_error_entry {}
 Contains the tuple we detected an error, either m_original_table_entry or m_input_entry. More...
 
unsigned char m_trx_data [DATA_TRX_ID_LEN]
 Column data for system column transaction ID. More...
 
unsigned char m_rollptr_data [DATA_ROLL_PTR_LEN]
 Column data for system column Roll pointer. More...
 
unsigned char m_rowid_data [DATA_ROW_ID_LEN]
 Column data for system column DATA_ROW_ID. More...
 
dberr_t m_err {DB_SUCCESS}
 Error code at thread level. More...
 
int m_errcode {0}
 
std::ostringstream m_sout
 
size_t m_nth_index {std::numeric_limits<size_t>::max()}
 
Table_reader m_table_reader
 
bool m_more_available_in_input {}
 
bool m_more_available_in_original_table {}
 
std::optional< std::string > m_original_table_name {}
 

Member Function Documentation

◆ add_subtree()

void ddl_bulk::Loader::Thread_data::add_subtree ( Btree_multi::Btree_load subtree)
inline

Add given subtree to the list of subtrees.

Parameters
[in]subtreethe subtree to be added.

◆ close_blob()

dberr_t ddl_bulk::Loader::Thread_data::close_blob ( Btree_multi::Btree_load sub_tree,
Blob_context  blob_ctx,
lob::ref_t ref 
)
inline

Indicate that the blob has been completed, so that resources can be removed, and as necessary flushing can be done.

Parameters
[in]sub_treesub tree to load data to
[in]blob_ctxpointer to blob which has been completely written.
[out]refblob reference to be placed in the record.
Returns
DB_SUCCESS on success or a failure error code.

◆ copy_existing_data()

dberr_t ddl_bulk::Loader::Thread_data::copy_existing_data ( const row_prebuilt_t prebuilt,
Btree_multi::Btree_load sub_tree,
Bulk_load::Stat_callbacks wait_cbk 
)

◆ free()

void ddl_bulk::Loader::Thread_data::free ( )

Free thread specific data.

◆ get_error()

dberr_t ddl_bulk::Loader::Thread_data::get_error ( ) const
inline

◆ get_error_code()

int ddl_bulk::Loader::Thread_data::get_error_code ( ) const
inline

Get the client error code (eg.

ER_LOAD_BULK_DATA_UNSORTED).

Returns
the client error code.

◆ get_error_string()

std::string ddl_bulk::Loader::Thread_data::get_error_string ( ) const
inline

◆ get_subtree() [1/2]

Btree_multi::Btree_load * ddl_bulk::Loader::Thread_data::get_subtree ( )
inline

Get the last subtree created by this thread.

◆ get_subtree() [2/2]

Btree_multi::Btree_load * ddl_bulk::Loader::Thread_data::get_subtree ( Blob_context  ctx) const
inline

◆ init()

void ddl_bulk::Loader::Thread_data::init ( const row_prebuilt_t prebuilt)

Initialize thread specific data.

Parameters
[in]prebuiltprebuilt structures from innodb table handler

◆ insert_from_input_and_move_to_next()

void ddl_bulk::Loader::Thread_data::insert_from_input_and_move_to_next ( const row_prebuilt_t prebuilt,
const Rows_mysql rows,
size_t &  row_index,
Btree_multi::Btree_load sub_tree,
mem_heap_t gcol_heap,
bool &  gcol_blobs_flushed 
)
private

◆ insert_from_original_table_and_move_to_next()

void ddl_bulk::Loader::Thread_data::insert_from_original_table_and_move_to_next ( const row_prebuilt_t prebuilt,
Btree_multi::Btree_load sub_tree 
)
private

◆ insert_smaller_entry()

void ddl_bulk::Loader::Thread_data::insert_smaller_entry ( const row_prebuilt_t prebuilt,
Btree_multi::Btree_load sub_tree,
const Rows_mysql rows,
size_t &  row_index,
const ddl::Compare_key compare_key,
mem_heap_t gcol_heap,
bool &  gcol_blobs_flushed 
)
private

◆ load()

dberr_t ddl_bulk::Loader::Thread_data::load ( const row_prebuilt_t prebuilt,
Btree_multi::Btree_load sub_tree,
const Rows_mysql rows,
Bulk_load::Stat_callbacks wait_cbk 
)

Load rows to a sub-tree for a specific thread.

Parameters
[in]prebuiltprebuilt structures from innodb table handler
[in,out]sub_treesub tree to load data to
[in]rowsrows to be loaded to the cluster index sub-tree
[in]wait_cbkStat callbacks
Returns
innodb error code

◆ open_blob()

dberr_t ddl_bulk::Loader::Thread_data::open_blob ( Btree_multi::Btree_load sub_tree,
Blob_context blob_ctx,
lob::ref_t ref 
)
inline

Create a blob.

Parameters
[in]sub_treesub tree to load data to
[out]blob_ctxpointer to an opaque object representing a blob.
[out]refblob reference to be placed in the record.
Returns
DB_SUCCESS on success or a failure error code.

◆ read_input_entry()

void ddl_bulk::Loader::Thread_data::read_input_entry ( const Rows_mysql rows,
size_t &  row_index,
const row_prebuilt_t prebuilt,
mem_heap_t gcol_heap,
bool &  gcol_blobs_flushed 
)
private

◆ read_table_entry()

void ddl_bulk::Loader::Thread_data::read_table_entry ( const row_prebuilt_t prebuilt)
private

◆ set_source_table_data()

bool ddl_bulk::Loader::Thread_data::set_source_table_data ( const row_prebuilt_t prebuilt,
const Bulk_load::Source_table_data source_table 
)

◆ write_blob()

dberr_t ddl_bulk::Loader::Thread_data::write_blob ( Btree_multi::Btree_load sub_tree,
Blob_context  blob_ctx,
lob::ref_t ref,
const byte data,
size_t  len 
)
inline

Write data into the blob.

Parameters
[in]sub_treesub tree to load data to
[in]blob_ctxpointer to blob into which data is written.
[out]refblob reference to be placed in the record.
[in]databuffer containing data to be written
[in]lenlength of the data to be written.
Returns
DB_SUCCESS on success or a failure error code.

Member Data Documentation

◆ m_err

dberr_t ddl_bulk::Loader::Thread_data::m_err {DB_SUCCESS}
private

Error code at thread level.

◆ m_errcode

int ddl_bulk::Loader::Thread_data::m_errcode {0}
private

◆ m_error_entry

dtuple_t* ddl_bulk::Loader::Thread_data::m_error_entry {}
private

Contains the tuple we detected an error, either m_original_table_entry or m_input_entry.

◆ m_heap

mem_heap_t* ddl_bulk::Loader::Thread_data::m_heap {}
private

Heap for allocating tuple memory.

◆ m_input_entry

dtuple_t* ddl_bulk::Loader::Thread_data::m_input_entry {}
private

Tuple for inserting row to index.

◆ m_input_row

dtuple_t* ddl_bulk::Loader::Thread_data::m_input_row {}
private

Tuple for converting input data to table row.

◆ m_last_rowid

uint64_t ddl_bulk::Loader::Thread_data::m_last_rowid {0}

The last DB_ROW_ID used by this thread.

◆ m_list_subtrees

std::list<Btree_multi::Btree_load *> ddl_bulk::Loader::Thread_data::m_list_subtrees

Each subtree needs to have a disjoint set of keys.

In the case of generated DB_ROW_ID as PK, each thread can build one subtree for one range of row ids.

◆ m_more_available_in_input

bool ddl_bulk::Loader::Thread_data::m_more_available_in_input {}
private

◆ m_more_available_in_original_table

bool ddl_bulk::Loader::Thread_data::m_more_available_in_original_table {}
private

◆ m_nth_index

size_t ddl_bulk::Loader::Thread_data::m_nth_index {std::numeric_limits<size_t>::max()}
private

◆ m_original_table_entry

dtuple_t* ddl_bulk::Loader::Thread_data::m_original_table_entry {}
private

Tuple for inserting row to index.

◆ m_original_table_name

std::optional<std::string> ddl_bulk::Loader::Thread_data::m_original_table_name {}
private

◆ m_queue_size

size_t ddl_bulk::Loader::Thread_data::m_queue_size

Flush queue size used by the Bulk_flusher.

◆ m_rollptr_data

unsigned char ddl_bulk::Loader::Thread_data::m_rollptr_data[DATA_ROLL_PTR_LEN]
private

Column data for system column Roll pointer.

◆ m_rowid_data

unsigned char ddl_bulk::Loader::Thread_data::m_rowid_data[DATA_ROW_ID_LEN]
private

Column data for system column DATA_ROW_ID.

◆ m_sout

std::ostringstream ddl_bulk::Loader::Thread_data::m_sout
private

◆ m_table_reader

Table_reader ddl_bulk::Loader::Thread_data::m_table_reader
private

◆ m_table_row

dtuple_t* ddl_bulk::Loader::Thread_data::m_table_row {}
private

◆ m_trx_data

unsigned char ddl_bulk::Loader::Thread_data::m_trx_data[DATA_TRX_ID_LEN]
private

Column data for system column transaction ID.


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