![]() |
MySQL 9.4.0
Source Code Documentation
|
Simulated AIO handler for reaping IO requests. More...
Public Member Functions | |
| SimulatedAIOHandler (AIO *array, ulint segment) | |
| Constructor. More... | |
| ~SimulatedAIOHandler () | |
| Destructor. More... | |
| void | init (ulint n_slots) |
| Reset the state of the handler. More... | |
| Slot * | check_completed (ulint *n_reserved) |
| Check if there is a slot for which the i/o has already been done. More... | |
| bool | select (std::chrono::steady_clock::time_point current_time) |
| If there are at least 2 seconds old requests, then pick the oldest one to prevent starvation. More... | |
| void | merge () |
| Check if there are several consecutive blocks to read or write. More... | |
| ulint | allocate_buffer () |
| We have now collected n_consecutive I/O requests in the array; allocate a single buffer which can hold all data, and perform the I/O. More... | |
| void | copy_to_buffer (ulint len) |
| We have to compress the individual pages and punch holes in them on a page by page basis when writing to tables that can be compressed at the IO level. More... | |
| void | io () |
| Do the I/O with ordinary, synchronous i/o functions: More... | |
| void | io_complete () |
| Do the decompression of the pages read in. More... | |
| void | done () |
| Mark the i/os done in slots. More... | |
| Slot * | first_slot () |
| ulint | check_pending (ulint global_segment, os_event_t event) |
| Wait for I/O requests. More... | |
Private Types | |
| typedef std::vector< Slot * > | slots_t |
Private Member Functions | |
| void | read (Slot *slot) |
| Do the file read. More... | |
| void | write (Slot *slot) |
| Do the file write. More... | |
| bool | adjacent (const Slot *s1, const Slot *s2) const |
| bool | merge_adjacent (Slot *¤t) |
| bool | select_lowest_offset () |
| There were no old requests. More... | |
| bool | select_oldest (std::chrono::steady_clock::time_point current_time) |
| Select the oldest slot in the array if there are any older than 2s. More... | |
Private Attributes | |
| ulint | m_n_elems |
| AIO * | m_array |
| ulint | m_n_slots |
| ulint | m_segment |
| slots_t | m_slots |
| byte * | m_buf |
Simulated AIO handler for reaping IO requests.
|
private |
Constructor.
| [in,out] | array | The AIO array |
| [in] | segment | Local segment in the array |
|
inline |
Destructor.
|
inline |
We have now collected n_consecutive I/O requests in the array; allocate a single buffer which can hold all data, and perform the I/O.
Check if there is a slot for which the i/o has already been done.
| [out] | n_reserved | Number of reserved slots |
| ulint SimulatedAIOHandler::check_pending | ( | ulint | global_segment, |
| os_event_t | event | ||
| ) |
Wait for I/O requests.
| [in] | global_segment | The global segment |
| [in,out] | event | Wait on event if no active requests |
|
inline |
We have to compress the individual pages and punch holes in them on a page by page basis when writing to tables that can be compressed at the IO level.
| [in] | len | Value returned by allocate_buffer |
|
inline |
Mark the i/os done in slots.
|
inline |
|
inline |
Reset the state of the handler.
| [in] | n_slots | Number of pending AIO operations supported |
|
inline |
Do the I/O with ordinary, synchronous i/o functions:
|
inline |
Do the decompression of the pages read in.
|
inline |
Check if there are several consecutive blocks to read or write.
Merge them if found.
|
inlineprivate |
|
inlineprivate |
Do the file read.
| [in,out] | slot | Slot that has the IO context |
|
inline |
If there are at least 2 seconds old requests, then pick the oldest one to prevent starvation.
If several requests have the same age, then pick the one at the lowest offset.
| [in] | current_time | Time of start of the slot selection. |
|
inlineprivate |
There were no old requests.
Look for an I/O request at the lowest offset in the array (we ignore the high 32 bits of the offset in these heuristics)
|
inlineprivate |
Select the oldest slot in the array if there are any older than 2s.
| [in] | current_time | Time of start of the slot selection. |
|
inlineprivate |
Do the file write.
| [in,out] | slot | Slot that has the IO context |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |