#include <btr0mtib.h>
◆ Type
Enumerator |
---|
PAGE | Allocate by Page.
|
EXTENT | Allocate by extent.
|
◆ ~Bulk_extent_allocator()
Btree_multi::Bulk_extent_allocator::~Bulk_extent_allocator |
( |
| ) |
|
|
inline |
Destructor to ensure thread stop.
◆ allocate()
dberr_t Btree_multi::Bulk_extent_allocator::allocate |
( |
bool |
is_leaf, |
|
|
bool |
alloc_page, |
|
|
Page_range_t & |
range, |
|
|
std::function< void()> & |
fn_wait_begin, |
|
|
std::function< void()> & |
fn_wait_end |
|
) |
| |
Allocate a page range - currently ans Extent.
- Parameters
-
[in] | is_leaf | true if leaf segment, otherwise non-leaf segment |
[in] | alloc_page | if true, allocate in pages otherwise allocate extent |
[out] | range | page range |
[in,out] | fn_wait_begin | begin callback if wait is needed |
[in,out] | fn_wait_end | end callback if wait is needed |
- Returns
- Innodb error code.
◆ allocate_extent()
Allocate one extent.
- Parameters
-
[in] | is_leaf | true if leaf segment, otherwise non-leaf segment |
[in,out] | mtr | mini tranaction to be used for allocation |
[out] | range | page rannge for the extent |
- Returns
- innodb error code.
◆ allocate_extents()
dberr_t Btree_multi::Bulk_extent_allocator::allocate_extents |
( |
bool |
is_leaf, |
|
|
size_t |
num_extents |
|
) |
| |
|
private |
Allocate extents and fill the cache.
- Parameters
-
[in] | is_leaf | true if leaf segment, otherwise non-leaf segment |
[in] | num_extents | number of extents to allocate |
- Returns
- innodb error code.
◆ allocate_page()
dberr_t Btree_multi::Bulk_extent_allocator::allocate_page |
( |
bool |
is_leaf, |
|
|
Page_range_t & |
range |
|
) |
| |
|
private |
Allocate one page.
- Parameters
-
[in] | is_leaf | true if leaf segment, otherwise non-leaf segment |
[out] | range | page rannge for the page |
- Returns
- innodb error code.
◆ allocator_wait()
void Btree_multi::Bulk_extent_allocator::allocator_wait |
( |
| ) |
const |
|
private |
◆ check()
bool Btree_multi::Bulk_extent_allocator::check |
( |
size_t & |
n_leaf, |
|
|
size_t & |
n_non_leaf, |
|
|
bool & |
trigger |
|
) |
| |
|
private |
Check if leaf and non-leaf extent cache needs to be filled.
- Parameters
-
[out] | n_leaf | number of leaf extents to allocate |
[out] | n_non_leaf | number of non-leaf extents to allocate |
[out] | trigger | true if consumers should be triggered |
- Returns
- true if allocator should stop.
◆ init()
uint64_t Btree_multi::Bulk_extent_allocator::init |
( |
dict_table_t * |
table, |
|
|
trx_t * |
trx, |
|
|
size_t |
size, |
|
|
size_t |
num_threads, |
|
|
bool |
in_pages |
|
) |
| |
Check size and set extent allocator size parameters.
- Parameters
-
[in] | table | Innodb dictionary table object |
[in] | trx | transaction performing bulk load |
[in] | size | total data size to be loaded |
[in] | num_threads | number of concurrent threads |
[in] | in_pages | if true, allocate in pages |
- Returns
- tablespace extend size in bytes.
◆ is_interrupted()
bool Btree_multi::Bulk_extent_allocator::is_interrupted |
( |
| ) |
|
|
private |
- Returns
- true if operation is interrupted.
◆ run()
dberr_t Btree_multi::Bulk_extent_allocator::run |
( |
| ) |
|
|
private |
Exetent thread executor.
- Returns
- innodb error code.
◆ start()
void Btree_multi::Bulk_extent_allocator::start |
( |
| ) |
|
◆ stop()
void Btree_multi::Bulk_extent_allocator::stop |
( |
| ) |
|
Stop extent allocator thread, if active.
◆ m_allocator_condition
std::condition_variable Btree_multi::Bulk_extent_allocator::m_allocator_condition |
|
mutableprivate |
Condition variable for allocator thread.
◆ m_allocator_wait_count
size_t Btree_multi::Bulk_extent_allocator::m_allocator_wait_count {} |
|
mutableprivate |
Number of times allocator had to wait.
◆ m_allocator_wait_time
std::chrono::microseconds Btree_multi::Bulk_extent_allocator::m_allocator_wait_time |
|
mutableprivate |
Total allocator wait time in micro seconds.
◆ m_concurrency
size_t Btree_multi::Bulk_extent_allocator::m_concurrency {} |
|
private |
Number of concurrent consumers.
◆ m_consumer_condition
std::condition_variable Btree_multi::Bulk_extent_allocator::m_consumer_condition |
|
mutableprivate |
Condition variable for extent consumer threads.
◆ m_consumer_wait_count
size_t Btree_multi::Bulk_extent_allocator::m_consumer_wait_count {} |
|
mutableprivate |
Number of times consumer(s) had to wait.
◆ m_consumer_wait_time
std::chrono::microseconds Btree_multi::Bulk_extent_allocator::m_consumer_wait_time |
|
mutableprivate |
Total consumer wait time in micro seconds.
◆ m_error
Error code, protected by m_mutex.
◆ m_leaf_extents
Extent_cache Btree_multi::Bulk_extent_allocator::m_leaf_extents |
|
private |
◆ m_mutex
std::mutex Btree_multi::Bulk_extent_allocator::m_mutex |
|
mutableprivate |
This mutex protects the m_queue.
◆ m_non_leaf_extents
Extent_cache Btree_multi::Bulk_extent_allocator::m_non_leaf_extents |
|
private |
◆ m_stop
bool Btree_multi::Bulk_extent_allocator::m_stop {false} |
|
private |
Flag to indicate if the bulk allocator thread should stop.
◆ m_table
dict_table_t* Btree_multi::Bulk_extent_allocator::m_table {} |
|
private |
Innodb dictionary table object.
◆ m_thread
std::thread Btree_multi::Bulk_extent_allocator::m_thread |
|
private |
◆ m_trx
trx_t* Btree_multi::Bulk_extent_allocator::m_trx {} |
|
private |
Innodb transaction - used for checking interrupt.
◆ m_type
◆ S_BULK_EXTEND_SIZE_MAX
constexpr size_t Btree_multi::Bulk_extent_allocator::S_BULK_EXTEND_SIZE_MAX = 64 |
|
staticconstexprprivate |
Maximum size by which the tablespace is extended each time.
◆ S_MAX_RANGES
constexpr size_t Btree_multi::Bulk_extent_allocator::S_MAX_RANGES = 2 * 1024 |
|
staticconstexprprivate |
Upper bound for max ranges.
The documentation for this class was generated from the following files: