MySQL  8.0.19
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_RECOVER = 4,
  DATA_FILE = 8, LOG = 16, DISABLE_PARTIAL_IO_WARNINGS = 32, DO_NOT_WAKE = 64,
  IGNORE_MISSING = 128, PUNCH_HOLE = 256, NO_COMPRESSION = 512
}
 Flags passed in the request, they can be ORred together. More...
 

Public Member Functions

 IORequest ()
 Default constructor. More...
 
 IORequest (ulint type)
 
bool is_read () const
 
bool is_write () const
 
bool is_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 validate () const
 
void set_punch_hole ()
 Set the 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...
 
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...
 
void encryption_algorithm (Encryption::Type type)
 Set encryption algorithm. More...
 
void encryption_key (byte *key, ulint key_len, byte *iv)
 Set encryption key and iv. 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_recover ()
 Note that the IO is for double write recovery. More...
 
bool is_dblwr_recover () const
 

Static Public Member Functions

static bool ignore_missing (ulint type)
 
static bool is_punch_hole_supported ()
 

Private Attributes

uint32_t m_block_size
 
uint16_t m_type
 Request type bit flags. More...
 
Compression m_compression
 Compression algorithm. More...
 
Encryption m_encryption
 Encryption algorithm. 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_RECOVER 

Double write buffer recovery.

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.

Constructor & Destructor Documentation

◆ IORequest() [1/2]

IORequest::IORequest ( )
inline

Default constructor.

◆ IORequest() [2/2]

IORequest::IORequest ( ulint  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_recover()

void IORequest::dblwr_recover ( )
inline

Note that the IO is for double write recovery.

◆ disable_compression()

void IORequest::disable_compression ( )
inline

Disable transformations.

◆ disable_partial_io_warnings()

void IORequest::disable_partial_io_warnings ( )
inline

Disable partial read warnings.

◆ encryption_algorithm() [1/2]

Encryption IORequest::encryption_algorithm ( ) const
inline

Get the encryption algorithm.

Returns
the encryption algorithm

◆ encryption_algorithm() [2/2]

void IORequest::encryption_algorithm ( Encryption::Type  type)
inline

Set encryption algorithm.

Parameters
[in]typeThe encryption algorithm to use

◆ encryption_key()

void IORequest::encryption_key ( byte key,
ulint  key_len,
byte iv 
)
inline

Set encryption key and iv.

Parameters
[in]keyThe encryption key to use
[in]key_lenlength of the encryption key
[in]ivThe encryption iv to use

◆ 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 ( ulint  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_recover()

bool IORequest::is_dblwr_recover ( ) const
inline
Returns
true if the request is from the dblwr recovery

◆ 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_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_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_punch_hole()

void IORequest::set_punch_hole ( )
inline

Set the punch hole flag.

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

Encryption IORequest::m_encryption
private

Encryption algorithm.

◆ m_type

uint16_t IORequest::m_type
private

Request type bit flags.


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