![]() |
MySQL 26.7.0
Source Code Documentation
|
#include <fil0tablespace_node_handle_interface.h>
Public Types | |
| enum class | Status { SUCCESS = 0 , IO_ERROR } |
| enum class | Status_IO { SUCCESS = 0 , IO_DECRYPT_FAIL , CORRUPTION , IO_OVERFLOW , OUT_OF_MEMORY , IO_DECOMPRESS_FAIL , IO_NO_PUNCH_HOLE , UNSUPPORTED , IO_ERROR } |
| using | byte = unsigned char |
| using | Page_number = uint32_t |
| Type used for numbering the pages in the node. More... | |
| using | Callback = std::function< void(dberr_t io_result)> |
Public Member Functions | |
| virtual | ~Tablespace_node_handle_interface ()=default |
| Closes the opened node handle. More... | |
| virtual bool | needs_flushes_for_durability () const =0 |
| Returns true if the node must be flushed in general to ensure data durability. More... | |
| virtual Status | flush ()=0 |
| Ensures any data written so far to this tablespace node before this call will be made durable and will survive either software or hardware crash. More... | |
| virtual Status | truncate (Page_number size)=0 |
| Truncate the node storage to the given size. More... | |
| virtual Status | fill_range_with_zeros (Page_number first_page, Page_number number_of_pages, bool optimize_writes)=0 |
Makes the number_of_pages pages, starting with page number first_page contain all zeros. More... | |
| virtual Status_IO | read_page (IORequest req, byte *buffer, Page_number page_no)=0 |
| Reads a requested page synchronously. More... | |
| virtual Status_IO | read_page_async (IORequest req, byte *buffer, Page_number page_no, Callback callback)=0 |
| Reads a requested page asynchronously. More... | |
| virtual Status_IO | write_page (IORequest req, byte *buffer, size_t buffer_len, Page_number page_no)=0 |
| Writes a requested page synchronously. More... | |
| virtual Status_IO | write_page_async (IORequest req, byte *buffer, size_t buffer_len, Page_number page_no, Callback callback)=0 |
| Writes a requested page asynchronously. More... | |
| using ib::fil::Tablespace_node_handle_interface::byte = unsigned char |
| using ib::fil::Tablespace_node_handle_interface::Callback = std::function<void(dberr_t io_result)> |
| using ib::fil::Tablespace_node_handle_interface::Page_number = uint32_t |
Type used for numbering the pages in the node.
|
strong |
|
strong |
|
virtualdefault |
Closes the opened node handle.
|
pure virtual |
Makes the number_of_pages pages, starting with page number first_page contain all zeros.
This can be use to efficiently extend the node size. It may be implemented more efficiently than actually writing buffers with zeros, but only if optimize_writes is set to true.
| [in] | first_page | Number of page in node from to be overwritten with zeros. |
| [in] | number_of_pages | Number of pages to overwrite with zeros. |
| [in] | optimize_writes | If true the implementation can use faster and possibly less robust way to zero the range. |
Implemented in ib::fil::Tablespace_node_handle.
|
pure virtual |
Ensures any data written so far to this tablespace node before this call will be made durable and will survive either software or hardware crash.
Implemented in ib::fil::Tablespace_node_handle.
|
pure virtual |
Returns true if the node must be flushed in general to ensure data durability.
Implemented in ib::fil::Tablespace_node_handle.
|
pure virtual |
Reads a requested page synchronously.
Before the page is returned, the page will be decrypted and decompressed, depending on information present in the page header.
The size of the buffer in bytes should be at least the tablespace physical page size which was passed to tablespaces_nodes::open() or calculated from flags passed to tablespaces_nodes::create().
| [in] | req | IO request type, compression and encryption information. |
| [out] | buffer | A buffer where to read the data in. It must be aligned in memory to physical page size. It must be able to store physical page size bytes. The memory pointed is managed by the caller and must remain valid until the call finishes. TODO : buffer to be replaced with std::span. |
| [in] | page_no | Offset from the first page in the node to read from. |
Implemented in ib::fil::Tablespace_node_handle.
|
pure virtual |
Reads a requested page asynchronously.
After the operation is completed, successfully or not, the callback is called with the result error code, probably in a different thread. If the request is successful, it will always be called from a different thread in context that has no latches taken.
Before the page is returned, the page will be decrypted and decompressed, depending on information present in the page header.
The size of the buffer in bytes should be at least the tablespace physical page size which was passed to tablespaces_nodes::open() or calculated from flags passed to tablespaces_nodes::create().
| [in] | req | IO request type, compression and encryption information. |
| [out] | buffer | A buffer where to read the data in. It must be aligned in memory to physical page size. It must be able to store physical page size bytes. The memory pointed is managed by the caller and must remain valid until the callback is being called. TODO : buffer to be replaced with std::span. |
| [in] | page_no | Offset from the first page in the node to read from. |
| [in] | callback | A callback to be called exactly once when the result of this IO operation is known. It may be a success if the read or write succeeded or a subset of dberr_t errors if the read could not be executed or if it failed. It can be called synchronously in this thread before returning from this method, or can be executed asynchronously from another thread, when sync is false, before or after this call returns. |
Implemented in ib::fil::Tablespace_node_handle.
|
pure virtual |
Truncate the node storage to the given size.
| [in] | size | Expected size in pages of node after truncation. If the size provided is more than or equal to the current size of the node storage, return success. |
Implemented in ib::fil::Tablespace_node_handle.
|
pure virtual |
Writes a requested page synchronously.
The page will be encrypted and compressed, below this implementation depending on information present in the page header.
If punch hole is supported and requested, this API implementation punches the hole depending on input buffer compression metadata (check Punch Hole Optimization), the capability of Implementation and settings in IORequest.
If compression/encryption is to be done, the input buffer may be modified accordingly with post encryption/compression metadata (eg : Page type, compression info).
The size of the buffer in bytes should be at most the tablespaces physical page size which was passed to tablespaces_nodes::open() or calculated from flags passed to tablespaces_nodes::create(). In other words, buffer_len must not be greater than the tablespace physical page size. In case of punch hole, the buffer_len can be less than physical page size but it must be divisible by 512. And the buffer will be written out and rest of the page will be hole-punched.
| [in] | req | IO request type, compression and encryption information. |
| [out] | buffer | A buffer containing the data to be written. Data from this buffer might be copied and the copy transformed before writing it. It must be aligned in memory to the OS block size (UNIV_SECTOR_SIZE). The memory pointed is managed by the caller and must remain valid until the call returns. |
| [in] | buffer_len | Size of the buffer to be written. It always has to be a multiply of OS block size (UNIV_SECTOR_SIZE). In case of write of an already compressed data, it is a length of the compressed data buffer. Otherwise it should be physical page size. Actual number of bytes written can be smaller if the tablespace has compression enabled and data was not compressed already. TODO : buffer and buffer_len to be replaced with std::span. |
| [in] | page_no | Offset from the first page in the node to write to. |
Implemented in ib::fil::Tablespace_node_handle.
|
pure virtual |
Writes a requested page asynchronously.
After the operation is completed, successfully or not, the callback is called with the result error code, probably in a different thread. If the request is successful, it will always be called from a different thread in context that has no latches taken.
The page will be encrypted and compressed, below this implementation depending on information present in the page header.
If punch hole is supported and requested, this API implementation punches the hole depending on input buffer compression metadata (check Punch Hole Optimization), the capability of Implementation and settings in IORequest.
If compression/encryption is to be done, the input buffer may be modified accordingly with post encryption/compression metadata (eg : Page type, compression info).
The size of the buffer in bytes should be at most the tablespaces physical page size which was passed to tablespaces_nodes::open() or calculated from flags passed to tablespaces_nodes::create(). In other words, buffer_len must not be greater than the tablespace physical page size. In case of punch hole, the buffer_len can be less than physical page size but it must be divisible by 512. And the buffer will be written out and rest of the page will be hole-punched.
| [in] | req | IO request type, compression and encryption information. |
| [out] | buffer | A buffer containing the data to be written. Data from this buffer might be copied and the copy transformed before writing it. It must be aligned in memory to the OS block size (UNIV_SECTOR_SIZE). The memory pointed is managed by the caller and must remain valid until the callback is being called. |
| [out] | buffer_len | Size of the buffer to be written. It must be aligned to OS block size (UNIV_SECTOR_SIZE). In case of write of an already compressed data, it is a length of the compressed data buffer. Otherwise it should be physical page size. Actual number of bytes written can be smaller if the tablespace has compression enabled and data was not compressed already. TODO : buffer and buffer_len to be replaced with std::span. |
| [in] | page_no | Offset from the first page in the node to write to. |
| [in] | callback | A callback to be called exactly once when the result of this IO operation is known. It may be a success if the read or write succeeded or a subset of dberr_t errors if the write could not be executed or if it failed. It can be called synchronously in this thread before returning from this method, or can be executed asynchronously from another thread, when sync is false, before or after this call returns. |
Implemented in ib::fil::Tablespace_node_handle.