MySQL 9.1.0
Source Code Documentation
IORequest Class Reference

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

#include <os0file.h>

Public Types

enum  {
  UNSET = 0 , READ = 1 , WRITE = 2 , DBLWR = 4 ,
  DATA_FILE = 8 , LOG = 16 , DISABLE_PARTIAL_IO_WARNINGS = 32 , DO_NOT_WAKE = 64 ,
  IGNORE_MISSING = 128 , PUNCH_HOLE = 256 , NO_COMPRESSION = 512 , ROW_LOG = 1024 ,
  DISABLE_PUNCH_HOLE_OPTIMISATION = 2048
}
 Flags passed in the request, they can be ORred together. More...
 

Public Member Functions

 IORequest ()
 Default constructor. More...
 
 IORequest (int type)
 
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 punch_hole () 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 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_compressed () const
 
bool is_compression_enabled () const
 
void disable_compression ()
 Disable transformations. More...
 
Encryption encryption_algorithm () const
 Get the encryption algorithm. More...
 
bool is_encrypted () const
 
void clear_encrypted ()
 Clear all encryption related flags. More...
 
void dblwr ()
 Note that the IO is for double write buffer page write. More...
 
bool is_dblwr () const
 
std::string to_string () const
 
Encryptionget_encryption_info () noexcept
 Get a reference to the underlying encryption information. More...
 
void set_encrypted_block (const file::Block *eblock) noexcept
 Set the encrypted block to the given value. More...
 
const file::Blockget_encrypted_block () const noexcept
 Get the encrypted block. More...
 

Static Public Member Functions

static bool ignore_missing (int type)
 
static bool is_punch_hole_supported ()
 
static std::string type_str (const ulint type)
 

Private Attributes

uint32_t m_block_size {}
 
int m_type {}
 Request type bit flags. More...
 
Compression m_compression {}
 Compression algorithm. More...
 
Encryption m_encryption {}
 Encryption algorithm. More...
 
const file::Blockm_eblock {}
 The encrypted block. 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...
 

Detailed Description

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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Flags passed in the request, they can be ORred together.

Enumerator
UNSET 
READ 
WRITE 
DBLWR 

Request for a doublewrite page IO.

DATA_FILE 

Enumerations below can be ORed to READ/WRITE above.

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.

Constructor & Destructor Documentation

◆ IORequest() [1/2]

IORequest::IORequest ( )
inline

Default constructor.

◆ IORequest() [2/2]

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

Member Function Documentation

◆ 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

◆ dblwr()

void IORequest::dblwr ( )
inline

Note that the IO is for double write buffer page write.

◆ 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.

◆ encryption_algorithm()

Encryption IORequest::encryption_algorithm ( ) const
inline

Get the encryption algorithm.

Returns
the encryption algorithm

◆ get_encrypted_block()

const file::Block * IORequest::get_encrypted_block ( ) const
inlinenoexcept

Get the encrypted block.

Returns
the encrypted block.

◆ 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() [1/2]

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

◆ ignore_missing() [2/2]

static bool IORequest::ignore_missing ( int  type)
inlinestatic
Returns
true if ignore missing flag is set

◆ is_compressed()

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

◆ is_compression_enabled()

bool IORequest::is_compression_enabled ( ) const
inline
Returns
true if the page read should not be transformed.

◆ is_dblwr()

bool IORequest::is_dblwr ( ) const
inline
Returns
true if the request is for a dblwr page.

◆ is_encrypted()

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

◆ 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_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

◆ punch_hole()

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

◆ set_encrypted_block()

void IORequest::set_encrypted_block ( const file::Block eblock)
inlinenoexcept

Set the encrypted block to the given value.

Parameters
[in]eblockthe encrypted block.

◆ 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.

◆ type_str()

std::string IORequest::type_str ( const ulint  type)
static

Enumerations below can be ORed to READ/WRITE above

Data file

◆ validate()

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

Member Data Documentation

◆ m_block_size

uint32_t IORequest::m_block_size {}
private

◆ m_compression

Compression IORequest::m_compression {}
private

Compression algorithm.

◆ m_eblock

const file::Block* IORequest::m_eblock {}
private

The encrypted block.

◆ 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

int IORequest::m_type {}
private

Request type bit flags.


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