#include <btr0mtib.h>
◆ ~Bulk_flusher()
Btree_multi::Bulk_flusher::~Bulk_flusher |
( |
| ) |
|
◆ add()
void Btree_multi::Bulk_flusher::add |
( |
Page_extent * |
page_extent, |
|
|
std::function< void()> & |
fn_wait_begin, |
|
|
std::function< void()> & |
fn_wait_end |
|
) |
| |
Add a page extent to the bulk flush queue.
- Parameters
-
[in,out] | page_extent | extent to be added to the queue |
[in,out] | fn_wait_begin | begin callback if wait is needed |
[in,out] | fn_wait_end | end callback if wait is needed |
◆ check_and_notify()
dberr_t Btree_multi::Bulk_flusher::check_and_notify |
( |
| ) |
const |
Check for flusher error and wake up flusher thread.
- Returns
- Innodb error code.
◆ do_work()
void Btree_multi::Bulk_flusher::do_work |
( |
fil_node_t * |
node, |
|
|
void * |
iov, |
|
|
size_t |
iov_size |
|
) |
| |
|
private |
Do the actual work of flushing.
- Parameters
-
[in,out] | node | space file node |
[in,out] | iov | vector IO array |
[in] | iov_size | vector IO array size |
◆ get_error()
dberr_t Btree_multi::Bulk_flusher::get_error |
( |
| ) |
const |
◆ get_max_queue_size()
size_t Btree_multi::Bulk_flusher::get_max_queue_size |
( |
| ) |
const |
|
inline |
Get the maximum allowed queue size.
- Returns
- the maximum allowed queue size.
◆ info()
void Btree_multi::Bulk_flusher::info |
( |
| ) |
|
|
private |
Print useful information to the server log file while exiting.
◆ is_error()
bool Btree_multi::Bulk_flusher::is_error |
( |
| ) |
const |
|
inline |
- Returns
- true iff error has occurred.
◆ is_work_available()
bool Btree_multi::Bulk_flusher::is_work_available |
( |
| ) |
|
Check if work is available for the bulk flusher thread.
- Returns
- true if work is available.
◆ run()
dberr_t Btree_multi::Bulk_flusher::run |
( |
| ) |
|
Thread main function.
- Returns
- innodb error code.
◆ set_error()
void Btree_multi::Bulk_flusher::set_error |
( |
dberr_t |
error_code | ) |
|
|
private |
Set error code.
- Parameters
-
[in] | error_code | error code to set. It could be DB_SUCCESS. |
◆ should_i_stop()
bool Btree_multi::Bulk_flusher::should_i_stop |
( |
| ) |
const |
|
inlineprivate |
Check if the bulk flush thread should stop working.
◆ start()
void Btree_multi::Bulk_flusher::start |
( |
space_id_t |
space_id, |
|
|
size_t |
index, |
|
|
size_t |
queue_size |
|
) |
| |
Start a new thread to do the flush work.
- Parameters
-
[in] | space_id | space for flushing pages to |
[in] | index | loader index |
[in] | queue_size | flusher queue size |
◆ wait()
void Btree_multi::Bulk_flusher::wait |
( |
| ) |
|
|
private |
When no work is available, put the thread to sleep.
◆ wait_to_stop()
void Btree_multi::Bulk_flusher::wait_to_stop |
( |
| ) |
|
Wait till the bulk flush thread stops.
◆ m_condition
std::condition_variable Btree_multi::Bulk_flusher::m_condition |
|
mutableprivate |
Condition variable to wait upon.
◆ m_error
Error code, protected by m_mutex.
◆ m_flush_thread
std::thread Btree_multi::Bulk_flusher::m_flush_thread |
|
private |
◆ m_flushed_page_nos
std::vector<page_no_t> Btree_multi::Bulk_flusher::m_flushed_page_nos |
Vector of page numbers that are flushed by this Bulk_flusher object.
◆ m_id
size_t Btree_multi::Bulk_flusher::m_id {} |
|
private |
◆ m_is_error
std::atomic<bool> Btree_multi::Bulk_flusher::m_is_error {false} |
|
private |
Set if error is encountered during flush.
◆ m_max_queue_size
size_t Btree_multi::Bulk_flusher::m_max_queue_size {4} |
|
private |
Maximum queue size, defaults to 4.
◆ m_mutex
std::mutex Btree_multi::Bulk_flusher::m_mutex |
|
mutableprivate |
This mutex protects the m_queue.
◆ m_n_sleep
size_t Btree_multi::Bulk_flusher::m_n_sleep {} |
|
private |
◆ m_pages_flushed
size_t Btree_multi::Bulk_flusher::m_pages_flushed {} |
|
private |
◆ m_priv_queue
std::vector<Page_extent *> Btree_multi::Bulk_flusher::m_priv_queue |
|
private |
Private queue (private to the bulk flush thread) containing the extents to flush.
◆ m_queue
std::vector<Page_extent *> Btree_multi::Bulk_flusher::m_queue |
|
private |
This queue is protected by the m_mutex.
◆ m_space_id
space_id_t Btree_multi::Bulk_flusher::m_space_id {} |
|
private |
Bulk flusher is specific to a tablespace for now.
◆ m_stop
std::atomic<bool> Btree_multi::Bulk_flusher::m_stop {false} |
|
private |
Flag to indicate if the bulk flusher thread should stop.
If true, the bulk flusher thread will stop after emptying the queue. If false, the bulk flusher thread will go to sleep after emptying the queue.
◆ m_wait_time
std::chrono::microseconds Btree_multi::Bulk_flusher::m_wait_time |
|
private |
Total sleep time in micro seconds.
◆ s_sleep_duration
constexpr std::chrono::milliseconds Btree_multi::Bulk_flusher::s_sleep_duration {100} |
|
staticconstexprprivate |
The sleep duration in milliseconds.
The documentation for this class was generated from the following files: