43 using byte =
unsigned char;
243 using Thread_ctxs = std::vector<Thread_data, ut::allocator<Thread_data>>;
274 bool &allocate_in_pages)
const;
305 for (
auto &thr :
m_ctxs) {
307 error = thr.get_error_string();
316 for (
auto &thr :
m_ctxs) {
317 errcode = thr.get_error_code();
327 for (
auto &thr :
m_ctxs) {
Multi Threaded Index Build (MTIB) using BUF_BLOCK_MEMORY and dedicated Bulk_flusher threads.
void * Blob_context
Definition: bulk_data_service.h:49
Definition: btr0mtib.h:895
dberr_t open_blob(Blob_context &blob_ctx, lob::ref_t &ref)
Create a blob.
Definition: btr0mtib.h:908
dberr_t close_blob(Blob_context blob_ctx, lob::ref_t &ref)
Indicate that the blob has been completed, so that resources can be removed, and as necessary flushin...
Definition: btr0mtib.h:928
dberr_t write_blob(Blob_context blob_ctx, lob::ref_t &ref, const byte *data, size_t len)
Write data into the blob.
Definition: btr0mtib.h:918
Definition: btr0mtib.h:479
Implements the row and column memory management for parse and load operations.
Definition: bulk_data_service.h:300
Definition: ddl0bulk.h:45
std::list< Btree_multi::Btree_load * > m_list_subtrees
Each subtree needs to have a disjoint set of keys.
Definition: ddl0bulk.h:121
std::ostringstream m_sout
Definition: ddl0bulk.h:175
Btree_multi::Btree_load * get_subtree()
Get the last subtree created by this thread.
Definition: ddl0bulk.h:113
void free()
Free thread specific data.
Definition: ddl0bulk.cc:304
dberr_t m_err
Error code at thread level.
Definition: ddl0bulk.h:171
dberr_t fill_tuple(const row_prebuilt_t *prebuilt, const Rows_mysql &rows, size_t row_index)
Fill the tuple to set the column data.
Definition: ddl0bulk.cc:442
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.
Definition: ddl0bulk.h:79
dberr_t open_blob(Btree_multi::Btree_load *sub_tree, Blob_context &blob_ctx, lob::ref_t &ref)
Create a blob.
Definition: ddl0bulk.h:67
std::string get_error_string() const
Definition: ddl0bulk.h:100
dtuple_t * m_entry
Tuple for inserting row to cluster index.
Definition: ddl0bulk.h:159
dtuple_t * m_row
Tuple for converting input data to table row.
Definition: ddl0bulk.h:156
unsigned char m_rowid_data[DATA_ROW_ID_LEN]
Column data for system column DATA_ROW_ID.
Definition: ddl0bulk.h:168
int get_error_code() const
Get the client error code (eg.
Definition: ddl0bulk.h:104
mem_heap_t * m_heap
Heap for allocating tuple memory.
Definition: ddl0bulk.h:153
size_t m_nth_index
Definition: ddl0bulk.h:177
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 flushin...
Definition: ddl0bulk.h:90
int m_errcode
Definition: ddl0bulk.h:173
unsigned char m_rollptr_data[DATA_ROLL_PTR_LEN]
Column data for system column Roll pointer.
Definition: ddl0bulk.h:165
void add_subtree(Btree_multi::Btree_load *subtree)
Add given subtree to the list of subtrees.
Definition: ddl0bulk.h:108
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.
Definition: ddl0bulk.cc:179
uint64_t m_last_rowid
The last DB_ROW_ID used by this thread.
Definition: ddl0bulk.h:124
void init(const row_prebuilt_t *prebuilt)
Initialize thread specific data.
Definition: ddl0bulk.cc:46
dberr_t get_error() const
Definition: ddl0bulk.h:99
size_t m_queue_size
Flush queue size used by the Bulk_flusher.
Definition: ddl0bulk.h:116
void fill_index_entry(const row_prebuilt_t *prebuilt)
Fill he cluster index entry from tuple data.
Definition: ddl0bulk.cc:400
void fill_system_columns(const row_prebuilt_t *prebuilt)
Fill system columns for index entry to be loaded.
Definition: ddl0bulk.cc:378
bool store_int_col(const Column_mysql &col, byte *data_ptr, size_t &data_len)
Store integer column in Innodb format.
Definition: ddl0bulk.cc:586
unsigned char m_trx_data[DATA_TRX_ID_LEN]
Column data for system column transaction ID.
Definition: ddl0bulk.h:162
Definition: ddl0bulk.h:40
std::vector< Btree_multi::Btree_load *, ut::allocator< Btree_multi::Btree_load * > > Btree_loads
Definition: ddl0bulk.h:242
Btree_loads m_sub_tree_loads
Sub-tree loading contexts.
Definition: ddl0bulk.h:286
void get_queue_size(size_t memory, size_t &flush_queue_size, bool &allocate_in_pages) const
Calculate the flush queue size to be used based on the available memory.
Definition: ddl0bulk.cc:80
Loader(size_t num_threads, size_t keynr, const trx_t *trx)
Loader context constructor.
Definition: ddl0bulk.h:184
dict_index_t * m_index
Index being loaded.
Definition: ddl0bulk.h:292
const char * get_index_name() const
Definition: ddl0bulk.h:256
const trx_t *const m_trx
Definition: ddl0bulk.h:297
dberr_t begin(const row_prebuilt_t *prebuilt, size_t data_size, size_t memory)
Prepare bulk loading by multiple threads.
Definition: ddl0bulk.cc:104
Btree_multi::Bulk_extent_allocator m_extent_allocator
Allocator to extend tablespace and allocate extents.
Definition: ddl0bulk.h:295
dberr_t load(const row_prebuilt_t *prebuilt, size_t thread_index, const Rows_mysql &rows, Bulk_load::Stat_callbacks &wait_cbk)
Load rows to a sub-tree by a thread.
Definition: ddl0bulk.cc:142
const char * get_table_name() const
Definition: ddl0bulk.h:253
int get_error_code() const
Get the client error code (e.g.
Definition: ddl0bulk.h:314
size_t m_queue_size
Flush queue size used by the Bulk_flusher.
Definition: ddl0bulk.h:300
size_t get_keynr() const
Definition: ddl0bulk.h:205
dict_table_t * m_table
Innodb dictionary table object.
Definition: ddl0bulk.h:289
dberr_t merge_subtrees()
Merge the sub-trees to build the cluster index.
Definition: ddl0bulk.cc:650
dberr_t end(bool is_error)
Finish bulk load operation, combining the sub-trees produced by concurrent threads.
Definition: ddl0bulk.cc:311
void * Blob_context
Definition: ddl0bulk.h:42
dberr_t get_error() const
Definition: ddl0bulk.h:325
std::string get_error_string() const
Definition: ddl0bulk.h:303
dberr_t close_blob(size_t thread_index, Blob_context blob_ctx, lob::ref_t &ref)
Indicate that the blob has been completed, so that resources can be removed, and as necessary flushin...
Definition: ddl0bulk.cc:170
void set_sys_max_rowid(uint64_t max_rowid)
Ensure that dict_sys->row_id is greater than max rowid used in bulk load of this table.
Definition: ddl0bulk.cc:367
dberr_t write_blob(size_t thread_index, Blob_context blob_ctx, lob::ref_t &ref, const byte *data, size_t len)
Write data into the blob.
Definition: ddl0bulk.cc:161
std::vector< Thread_data, ut::allocator< Thread_data > > Thread_ctxs
Definition: ddl0bulk.h:243
Thread_ctxs m_ctxs
All thread specific data.
Definition: ddl0bulk.h:283
dberr_t open_blob(size_t thread_index, Blob_context &blob_ctx, lob::ref_t &ref)
Open a blob.
Definition: ddl0bulk.cc:152
const size_t m_num_threads
Number of threads for bulk loading.
Definition: ddl0bulk.h:278
const size_t m_keynr
Definition: ddl0bulk.h:280
Allocator that allows std::* containers to manage their memory through ut::malloc* and ut::free libra...
Definition: ut0new.h:2183
constexpr size_t DATA_ROLL_PTR_LEN
Rollback data pointer type size in bytes.
Definition: data0type.h:191
constexpr size_t DATA_TRX_ID_LEN
Transaction ID type size in bytes.
Definition: data0type.h:185
constexpr uint32_t DATA_ROW_ID_LEN
stored length for row id
Definition: data0type.h:179
dberr_t
Definition: db0err.h:39
@ DB_SUCCESS
Definition: db0err.h:43
void error(const char *format,...)
PT & ref(PT *tp)
Definition: tablespace_impl.cc:359
Definition: ddl0bulk.cc:44
Definition: aligned_atomic.h:44
ValueType max(X &&first)
Definition: gtid.h:103
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2872
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2876
Interface between Innobase row operations and MySQL.
Callbacks for collecting time statistics.
Definition: bulk_data_service.h:857
Definition: bulk_data_service.h:204
Data structure for an index.
Definition: dict0mem.h:1041
id_name_t name
index name
Definition: dict0mem.h:1049
Data structure for a database table.
Definition: dict0mem.h:1913
table_name_t name
Table name.
Definition: dict0mem.h:1988
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:696
The struct 'lob::ref_t' represents an external field reference.
Definition: lob0lob.h:198
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
A struct for (sometimes lazily) prebuilt structures in an Innobase table handle used within MySQL; th...
Definition: row0mysql.h:515
char * m_name
The name in internal representation.
Definition: dict0mem.h:467
Definition: trx0trx.h:675