#include <btr0load.h>
- Note
- We should call commit(false) for a Page_load object, which is not in m_page_loaders after page_commit, and we will commit or abort Page_load objects in function "finish".
◆ Page_loaders
◆ Btree_load()
Constructor.
- Parameters
-
[in] | index | B-tree index. |
[in] | trx_id | Transaction id. |
[in] | observer | Flush observer |
◆ ~Btree_load()
Btree_load::~Btree_load |
( |
| ) |
|
|
noexcept |
◆ build()
Load the btree from the cursor.
- Parameters
-
[in,out] | cursor | Cursor to read tuples from. |
- Returns
- DB_SUCCESS or error code.
◆ finalize_page_loads()
Btree page bulk load finish.
Commits the last page in each level if no error occurs. Also releases all page bulks.
- Parameters
-
[in] | err | Whether bulk load was successful until now |
[out] | last_page_no | Last page number |
- Returns
- error code
◆ finish()
Btree bulk load finish.
We commit the last page in each level and copy the last page in top level to the root page of the index if no error occurs.
- Parameters
-
[in] | err | Whether bulk load was successful until now |
- Returns
- error code
◆ get_n_recs()
uint64_t Btree_load::get_n_recs |
( |
| ) |
|
|
inlinenoexcept |
Public getter function to return number of records inserted.
- Returns
- Number of records inserted
◆ insert() [1/2]
Insert a tuple to a page in a level.
- Parameters
-
[in] | dtuple | Tuple to insert |
[in] | level | B-tree level |
- Returns
- error code
◆ insert() [2/2]
Insert a tuple to a page.
- Parameters
-
[in] | page_load | Page bulk object |
[in] | tuple | Tuple to insert |
[in] | big_rec | Big record vector, maybe NULL if there is no Data to be stored externally. |
[in] | rec_size | Record size |
- Returns
- error code
◆ latch()
void Btree_load::latch |
( |
| ) |
|
|
noexcept |
Re-latch latch on the rightmost leaf page in the index tree.
◆ load_root_page()
Set the root page on completion.
- Parameters
-
[in] | last_page_no | Last page number (the new root). |
- Returns
- DB_SUCCESS or error code.
◆ log_free_check()
void Btree_load::log_free_check |
( |
| ) |
|
|
privatenoexcept |
◆ page_commit()
Commit(finish) a page.
We set next/prev page no, compress a page of compressed table and split the page if compression fails, insert a node pointer to father page if needed, and commit mini-transaction.
- Parameters
-
[in] | page_load | Page to commit |
[in] | next_page_load | Next page |
[in] | insert_father | Flag whether need to insert node ptr |
- Returns
- error code
◆ page_split()
Split a page.
- Parameters
-
[in] | page_load | Page to split |
[in] | next_page_load | Next page |
- Returns
- error code
◆ prepare_space()
dberr_t Btree_load::prepare_space |
( |
Page_load *& |
page_load, |
|
|
size_t |
level, |
|
|
size_t |
rec_size |
|
) |
| |
|
privatenoexcept |
Prepare space to insert a tuple.
- Parameters
-
[in,out] | page_load | Page bulk that will be used to store the record. It may be replaced if there is not enough space to hold the record. |
[in] | level | B-tree level |
[in] | rec_size | Record size |
- Returns
- error code
◆ release()
void Btree_load::release |
( |
| ) |
|
|
noexcept |
Release latch on the rightmost leaf page in the index tree.
◆ m_flush_observer
◆ m_index
◆ m_index_online
unsigned Btree_load::m_index_online {} |
|
private |
State of the index.
Used for asserting at the end of a bulk load operation to ensure that the online status of the index does not change
◆ m_n_recs
uint64_t Btree_load::m_n_recs {} |
|
private |
Number of records inserted.
◆ m_page_loaders
Page cursor vector for all level.
◆ m_root_level
size_t Btree_load::m_root_level {} |
|
private |
◆ m_trx_id
The documentation for this class was generated from the following files: