MySQL 26.7.0
Source Code Documentation
IORequest Class Reference

Types for AIO operations. More...

#include <os0file.h>

Public Types

enum class  Type : uint16_t {
  UNSET = 0 , READ = 1 << 0 , WRITE = 1 << 1 , DBLWR = 1 << 2 ,
  DATA_FILE = 1 << 3 , LOG = 1 << 4 , DISABLE_PARTIAL_IO_WARNINGS = 1 << 5 , DO_NOT_WAKE = 1 << 6 ,
  IGNORE_MISSING = 1 << 7 , PUNCH_HOLE = 1 << 8 , NO_COMPRESSION = 1 << 9 , ROW_LOG = 1 << 10 ,
  DISABLE_PUNCH_HOLE_OPTIMISATION = 1 << 11 , IBUF = 1 << 12 , NO_WRITE_TRANSFORMATIONS = 1 << 13
}
 Flags that can be used to specify the IORequest mode and additional options, to be used as bitmask type. More...
 

Public Member Functions

 IORequest ()=delete
 Default constructor. More...
 
 IORequest (Type type)
 
bool is_ibuf () const
 
bool is_read () const
 
bool is_write () const
 
bool is_log () const
 
bool is_row_log () const
 
bool is_wake () const
 
bool is_partial_io_warning_disabled () const
 
void disable_partial_io_warnings ()
 Disable partial read warnings. More...
 
bool ignore_missing () const
 
bool is_punch_hole_requested () const
 
bool is_punch_hole_optimisation_disabled () const
 
bool validate () const
 
void set_punch_hole ()
 Set the punch hole flag. More...
 
void disable_punch_hole_optimisation ()
 Set the force punch hole flag. More...
 
void set_ibuf ()
 
void clear_do_not_wake ()
 Clear the do not wake flag. More...
 
void clear_punch_hole ()
 Clear the punch hole flag. More...
 
ulint block_size () const
 
void block_size (ulint block_size)
 Set the block size for IO. More...
 
uint32_t get_original_size () const
 Returns original size of the IO to make. More...
 
void set_original_size (uint32_t original_size)
 
void clear_compressed ()
 Clear all compression related flags. More...
 
bool operator== (const IORequest &rhs) const
 Compare two requests. More...
 
void compression_algorithm (Compression::Type type)
 Set compression algorithm. More...
 
Compression compression_algorithm () const
 Get the compression algorithm. More...
 
bool is_compression_requested () const
 
bool is_compression_enabled () const
 
void disable_compression ()
 Disable transformations. More...
 
bool are_write_transformations_enabled () const
 
void disable_write_transformations ()
 Disable transformations. More...
 
Encryption encryption_algorithm () const
 Get the encryption algorithm. More...
 
bool is_encryption_requested () const
 
void clear_encrypted ()
 Clear all encryption related flags. More...
 
bool is_dblwr () const
 
std::string to_string () const
 
Encryptionget_encryption_info () noexcept
 Get a reference to the underlying encryption information. More...
 

Static Public Member Functions

static bool is_punch_hole_supported ()
 

Private Attributes

uint32_t m_block_size {}
 
Type m_type {}
 Request type bit flags. More...
 
Compression m_compression {}
 Compression algorithm. More...
 
Encryption m_encryption {}
 Encryption algorithm. More...
 
uint32_t m_elen {}
 The length of data in encrypted block. More...
 
uint32_t m_original_size {}
 Length of the original IO size. More...
 

Friends

constexpr friend IORequest::Type operator~ (const IORequest::Type type)
 
constexpr friend IORequest::Type operator& (const IORequest::Type a, const IORequest::Type b)
 
constexpr friend IORequest::Typeoperator|= (IORequest::Type &a, const IORequest::Type b)
 
constexpr friend IORequest::Typeoperator&= (IORequest::Type &a, const IORequest::Type b)
 

Detailed Description

Types for AIO operations.

The IO Context that is passed down to the low level IO code

Member Enumeration Documentation

◆ Type

enum class IORequest::Type : uint16_t
strong

Flags that can be used to specify the IORequest mode and additional options, to be used as bitmask type.

Enumerator
UNSET 
READ 
WRITE 
DBLWR 

Enumerations below can be ORed to READ/WRITE above.

Request for page IO during double-write buffer recovery. Setting this option will silence some corruption or decompression errors, will cause to use a safer decompression methods and will cause the fil subsystem to not validate the tablespace file, as we may have not yet recovered the first page with the FSP header from the double-write buffer.

DATA_FILE 

Data file.

LOG 

Log file request.

DISABLE_PARTIAL_IO_WARNINGS 

Disable partial read warnings.

DO_NOT_WAKE 

Do not to wake i/o-handler threads, but the caller will do the waking explicitly later, in this way the caller can post several requests in a batch; NOTE that the batch must not be so big that it exhausts the slots in AIO arrays! NOTE that a simulated batch may introduce hidden chances of deadlocks, because I/Os are not actually handled until all have been posted: use with great caution!

IGNORE_MISSING 

Ignore failed reads of non-existent pages.

PUNCH_HOLE 

Use punch hole if available, only makes sense if compression algorithm != NONE.

Ignored if not set

NO_COMPRESSION 

Force raw read, do not try to compress/decompress.

This can be used to force a read and write without any compression e.g., for redo log, merge sort temporary files and the truncate redo log.

ROW_LOG 

Row log used in online DDL.

DISABLE_PUNCH_HOLE_OPTIMISATION 

We optimise cases where punch hole is not done if the compressed length of the page is the same as the original size of the page.

Ignore such optimisations if this flag is set.

IBUF 

We want async ibuf requests to be performed on a separate IO queue as the default one might get saturated by waits for ibuf reads completions, leading to deadlock.

NO_WRITE_TRANSFORMATIONS 

Force raw write, do not try to compress or encrypt.

Constructor & Destructor Documentation

◆ IORequest() [1/2]

IORequest::IORequest ( )
delete

Default constructor.

◆ IORequest() [2/2]

IORequest::IORequest ( Type  type)
inlineexplicit
Parameters
[in]typeRequest type, can be a value that is ORed from the above enum

Member Function Documentation

◆ are_write_transformations_enabled()

bool IORequest::are_write_transformations_enabled ( ) const
inline
Returns
true iff transformations (compression and/or encryption) should be performed on the buffer in case this is a write operation and the tablespace seems to use them.

◆ block_size() [1/2]

ulint IORequest::block_size ( ) const
inline
Returns
the block size to use for IO

◆ block_size() [2/2]

void IORequest::block_size ( ulint  block_size)
inline

Set the block size for IO.

Parameters
[in]block_sizeBlock size to set

◆ clear_compressed()

void IORequest::clear_compressed ( )
inline

Clear all compression related flags.

◆ clear_do_not_wake()

void IORequest::clear_do_not_wake ( )
inline

Clear the do not wake flag.

◆ clear_encrypted()

void IORequest::clear_encrypted ( )
inline

Clear all encryption related flags.

◆ clear_punch_hole()

void IORequest::clear_punch_hole ( )
inline

Clear the punch hole flag.

◆ compression_algorithm() [1/2]

Compression IORequest::compression_algorithm ( ) const
inline

Get the compression algorithm.

Returns
the compression algorithm

◆ compression_algorithm() [2/2]

void IORequest::compression_algorithm ( Compression::Type  type)
inline

Set compression algorithm.

Parameters
[in]typeThe compression algorithm to use

◆ disable_compression()

void IORequest::disable_compression ( )
inline

Disable transformations.

◆ disable_partial_io_warnings()

void IORequest::disable_partial_io_warnings ( )
inline

Disable partial read warnings.

◆ disable_punch_hole_optimisation()

void IORequest::disable_punch_hole_optimisation ( )
inline

Set the force punch hole flag.

◆ disable_write_transformations()

void IORequest::disable_write_transformations ( )
inline

Disable transformations.

◆ encryption_algorithm()

Encryption IORequest::encryption_algorithm ( ) const
inline

Get the encryption algorithm.

Returns
the encryption algorithm

◆ get_encryption_info()

Encryption & IORequest::get_encryption_info ( )
inlinenoexcept

Get a reference to the underlying encryption information.

Returns
reference to the encryption information.

◆ get_original_size()

uint32_t IORequest::get_original_size ( ) const
inline

Returns original size of the IO to make.

If one was not specified, then 0 is returned.

◆ ignore_missing()

bool IORequest::ignore_missing ( ) const
inline
Returns
true if missing files should be ignored

◆ is_compression_enabled()

bool IORequest::is_compression_enabled ( ) const
inline
Returns
true if the page read/write should not be decompressed/compressed.

◆ is_compression_requested()

bool IORequest::is_compression_requested ( ) const
inline
Returns
true if the page should be compressed

◆ is_dblwr()

bool IORequest::is_dblwr ( ) const
inline
Returns
true if the request is for page for the double-write buffer recovery.

◆ is_encryption_requested()

bool IORequest::is_encryption_requested ( ) const
inline
Returns
true if the page should be encrypted.

◆ is_ibuf()

bool IORequest::is_ibuf ( ) const
inline
Returns
true if it is a read request

◆ is_log()

bool IORequest::is_log ( ) const
inline
Returns
true if it is a redo log write

◆ is_partial_io_warning_disabled()

bool IORequest::is_partial_io_warning_disabled ( ) const
inline
Returns
true if partial read warning disabled

◆ is_punch_hole_optimisation_disabled()

bool IORequest::is_punch_hole_optimisation_disabled ( ) const
inline
Returns
true if punch hole needs to be done always if it's supported and if the page is to be compressed.

◆ is_punch_hole_requested()

bool IORequest::is_punch_hole_requested ( ) const
inline
Returns
true if punch hole should be used

◆ is_punch_hole_supported()

static bool IORequest::is_punch_hole_supported ( )
inlinestatic
Returns
true if punch hole is supported

◆ is_read()

bool IORequest::is_read ( ) const
inline
Returns
true if it is a read request

◆ is_row_log()

bool IORequest::is_row_log ( ) const
inline
Returns
true if it is a row log entry used in online DDL

◆ is_wake()

bool IORequest::is_wake ( ) const
inline
Returns
true if the simulated AIO thread should be woken up

◆ is_write()

bool IORequest::is_write ( ) const
inline
Returns
true if it is a write request

◆ operator==()

bool IORequest::operator== ( const IORequest rhs) const
inline

Compare two requests.

Returns
true if the are equal

◆ set_ibuf()

void IORequest::set_ibuf ( )
inline

◆ set_original_size()

void IORequest::set_original_size ( uint32_t  original_size)
inline

◆ set_punch_hole()

void IORequest::set_punch_hole ( )
inline

Set the punch hole flag.

◆ to_string()

std::string IORequest::to_string ( ) const
inline
Returns
string representation.

◆ validate()

bool IORequest::validate ( ) const
inline
Returns
true if the read should be validated

Friends And Related Function Documentation

◆ operator&

constexpr friend IORequest::Type operator& ( const IORequest::Type  a,
const IORequest::Type  b 
)
friend

◆ operator&=

constexpr friend IORequest::Type & operator&= ( IORequest::Type a,
const IORequest::Type  b 
)
friend

◆ operator|=

constexpr friend IORequest::Type & operator|= ( IORequest::Type a,
const IORequest::Type  b 
)
friend

◆ operator~

constexpr friend IORequest::Type operator~ ( const IORequest::Type  type)
friend

Member Data Documentation

◆ m_block_size

uint32_t IORequest::m_block_size {}
private

◆ m_compression

Compression IORequest::m_compression {}
private

Compression algorithm.

◆ m_elen

uint32_t IORequest::m_elen {}
private

The length of data in encrypted block.

◆ m_encryption

Encryption IORequest::m_encryption {}
private

Encryption algorithm.

◆ m_original_size

uint32_t IORequest::m_original_size {}
private

Length of the original IO size.

For reads it is an expected uncompressed length. For writes it is a length up to which the write is to be extended with a punch hole, if supported.

◆ m_type

Type IORequest::m_type {}
private

Request type bit flags.


The documentation for this class was generated from the following file: