![]()  | 
  
    MySQL 8.4.7
    
   Source Code Documentation 
   | 
 
In memory data block in Page ID archiving system. More...
#include <arch0arch.h>
Public Member Functions | |
| Arch_Block (byte *blk_buf, uint size, Arch_Blk_Type type) | |
| Constructor: Initialize elements.  More... | |
| void | copy_data (const Arch_Block *block) | 
| Do a deep copy of the members of the block passed as the parameter.  More... | |
| void | begin_write (Arch_Page_Pos pos) | 
| Set the block ready to begin writing page ID.  More... | |
| void | end_write () | 
| End writing to a block.  More... | |
| bool | is_init () const | 
| Check if block is initialised or not.  More... | |
| bool | is_active () const | 
| bool | is_flushable () const | 
| Check if the block can be flushed or not.  More... | |
| void | set_flushed () | 
| Set current block flushed.  More... | |
| bool | add_page (buf_page_t *page, Arch_Page_Pos *pos) | 
| Add page ID to current block.  More... | |
| void | add_reset (lsn_t reset_lsn, Arch_Page_Pos reset_pos) | 
| bool | get_data (Arch_Page_Pos *read_pos, uint read_len, byte *read_buff) | 
| Copy page Ids from this block at read position to a buffer.  More... | |
| bool | set_data (uint read_len, byte *read_buff, uint read_offset) | 
| Copy page Ids from a buffer to this block.  More... | |
| dberr_t | flush (Arch_Group *file_group, Arch_Blk_Flush_Type type) | 
| Flush this block to the file group.  More... | |
| void | update_block_header (lsn_t stop_lsn, lsn_t reset_lsn) | 
| uint | get_data_len () const | 
| void | set_data_len (uint data_len) | 
| Set the data length of the block.  More... | |
| void | set_reset_lsn (lsn_t reset_lsn) | 
| Set the reset length of the block.  More... | |
| uint64_t | get_number () const | 
| lsn_t | get_stop_lsn () const | 
| lsn_t | get_oldest_lsn () const | 
| Get oldest LSN among the pages that are added to this block.  More... | |
| Arch_Blk_State | get_state () const | 
| Get current state of the block.  More... | |
Static Public Member Functions | |
| static bool | validate (byte *block) | 
| Check if the block data is valid.  More... | |
| static uint | get_file_index (uint64_t block_num, Arch_Blk_Type type) | 
| Get file index of the file the block belongs to.  More... | |
| static Arch_Blk_Type | get_type (byte *block) | 
| Get block type from the block header.  More... | |
| static uint | get_data_len (byte *block) | 
| Get block data length from the block header.  More... | |
| static lsn_t | get_stop_lsn (byte *block) | 
| Get the stop lsn stored in the block header.  More... | |
| static uint64_t | get_block_number (byte *block) | 
| Get the block number from the block header.  More... | |
| static lsn_t | get_reset_lsn (byte *block) | 
| Get the reset lsn stored in the block header.  More... | |
| static uint32_t | get_checksum (byte *block) | 
| Get the checksum stored in the block header.  More... | |
| static uint64_t | get_file_offset (uint64_t block_num, Arch_Blk_Type type) | 
| Fetch the offset for a block in the archive file.  More... | |
Private Attributes | |
| byte * | m_data | 
| Block data buffer.  More... | |
| uint | m_data_len {} | 
| Block data length in bytes.  More... | |
| uint | m_size | 
| Total block size in bytes.  More... | |
| Arch_Blk_State | m_state {ARCH_BLOCK_INIT} | 
| State of the block.  More... | |
| uint64_t | m_number {} | 
| Unique block number.  More... | |
| Arch_Blk_Type | m_type | 
| Type of block.  More... | |
| lsn_t | m_stop_lsn {LSN_MAX} | 
| Checkpoint lsn at the time the last page ID was added to the block.  More... | |
| lsn_t | m_oldest_lsn {LSN_MAX} | 
| Oldest LSN of all the page IDs added to the block since the last checkpoint.  More... | |
| lsn_t | m_reset_lsn {LSN_MAX} | 
| Start LSN or the last reset LSN of the group.  More... | |
In memory data block in Page ID archiving system.
      
  | 
  inline | 
Constructor: Initialize elements.
| [in] | blk_buf | buffer for data block | 
| [in] | size | buffer size | 
| [in] | type | block type | 
| bool Arch_Block::add_page | ( | buf_page_t * | page, | 
| Arch_Page_Pos * | pos | ||
| ) | 
Add page ID to current block.
| [in] | page | page from buffer pool | 
| [in] | pos | Archiver current position | 
| void Arch_Block::add_reset | ( | lsn_t | reset_lsn, | 
| Arch_Page_Pos | reset_pos | ||
| ) | 
| void Arch_Block::begin_write | ( | Arch_Page_Pos | pos | ) | 
Set the block ready to begin writing page ID.
| [in] | pos | position to initiate block number | 
| void Arch_Block::copy_data | ( | const Arch_Block * | block | ) | 
Do a deep copy of the members of the block passed as the parameter.
| void Arch_Block::end_write | ( | ) | 
End writing to a block.
Change state to ARCH_BLOCK_READY_TO_FLUSH
| dberr_t Arch_Block::flush | ( | Arch_Group * | file_group, | 
| Arch_Blk_Flush_Type | type | ||
| ) | 
Flush this block to the file group.
| [in] | file_group | current archive group | 
| [in] | type | flush type | 
      
  | 
  static | 
Get the block number from the block header.
| [in] | block | block from where to fetch the block number | 
      
  | 
  static | 
Get the checksum stored in the block header.
| [in] | block | block from where to fetch the checksum | 
| bool Arch_Block::get_data | ( | Arch_Page_Pos * | read_pos, | 
| uint | read_len, | ||
| byte * | read_buff | ||
| ) | 
Copy page Ids from this block at read position to a buffer.
| [in] | read_pos | current read position | 
| [in] | read_len | length of data to copy | 
| [out] | read_buff | buffer to copy page IDs. Caller must allocate the buffer. | 
      
  | 
  inline | 
      
  | 
  static | 
Get block data length from the block header.
| [in] | block | block from where to get the data length | 
      
  | 
  static | 
Get file index of the file the block belongs to.
      
  | 
  static | 
Fetch the offset for a block in the archive file.
| [in] | block_num | block number | 
| [in] | type | type of block | 
      
  | 
  inline | 
      
  | 
  inline | 
Get oldest LSN among the pages that are added to this block.
Get the reset lsn stored in the block header.
| [in] | block | block from where to fetch the reset lsn | 
      
  | 
  inline | 
Get current state of the block.
      
  | 
  inline | 
Get the stop lsn stored in the block header.
| [in] | block | block from where to fetch the stop lsn | 
      
  | 
  static | 
Get block type from the block header.
| [in] | block | block from where to get the type | 
      
  | 
  inline | 
      
  | 
  inline | 
Check if the block can be flushed or not.
      
  | 
  inline | 
Check if block is initialised or not.
| bool Arch_Block::set_data | ( | uint | read_len, | 
| byte * | read_buff, | ||
| uint | read_offset | ||
| ) | 
Copy page Ids from a buffer to this block.
| [in] | read_len | length of data to copy | 
| [in] | read_buff | buffer to copy page IDs from | 
| [in] | read_offset | offset from where to write | 
      
  | 
  inline | 
Set the data length of the block.
| [in] | data_len | data length | 
      
  | 
  inline | 
Set current block flushed.
Must hold page archiver sys operation mutex. 
 
      
  | 
  inline | 
Set the reset length of the block.
| [in] | reset_lsn | reset lsn | 
      
  | 
  static | 
Check if the block data is valid.
| [in] | block | block to be validated | 
      
  | 
  private | 
Block data buffer.
      
  | 
  private | 
Block data length in bytes.
      
  | 
  private | 
Unique block number.
Oldest LSN of all the page IDs added to the block since the last checkpoint.
      
  | 
  private | 
Total block size in bytes.
      
  | 
  private | 
State of the block.
Checkpoint lsn at the time the last page ID was added to the block.
      
  | 
  private | 
Type of block.