MySQL 9.1.0
Source Code Documentation
clone0snapshot.h File Reference

Database Physical Snapshot. More...

#include "univ.i"
#include "arch0log.h"
#include "arch0page.h"
#include "clone0api.h"
#include "clone0desc.h"
#include "clone0monitor.h"
#include "fil0fil.h"
#include "sql/handler.h"
#include <map>
#include <vector>

Go to the source code of this file.

Classes

struct  Clone_file_ctx
 
struct  Clone_Page
 Page identified by space and page number. More...
 
struct  Less_Clone_Page
 Comparator for storing sorted page ID. More...
 
class  Clone_Snapshot
 Dynamic database snapshot: Holds metadata and handle to data. More...
 
class  Clone_Snapshot::State_transit
 RAII style guard for begin & end of snapshot state transition. More...
 

Typedefs

using Clone_File_Vec = std::vector< Clone_file_ctx * >
 Vector type for storing clone files. More...
 
using Clone_File_Map = std::map< space_id_t, uint >
 Map type for mapping space ID to clone file index. More...
 
using Clone_Page_Vec = std::vector< Clone_Page >
 Vector type for storing clone page IDs. More...
 
using Clone_Page_Set = std::set< Clone_Page, Less_Clone_Page >
 Set for storing unique page IDs. More...
 

Enumerations

enum  Clone_Handle_Type { CLONE_HDL_COPY = 1 , CLONE_HDL_APPLY }
 Clone handle type. More...
 

Variables

const uint SNAPSHOT_DEF_CHUNK_SIZE_POW2 = 12
 Default chunk size in power of 2 in unit of pages. More...
 
const uint SNAPSHOT_DEF_BLOCK_SIZE_POW2 = 6
 Default block size in power of 2 in unit of pages. More...
 
const uint SNAPSHOT_MAX_BLOCK_SIZE_POW2 = 12
 Maximum block size in power of 2 in unit of pages. More...
 

Detailed Description

Database Physical Snapshot.

Typedef Documentation

◆ Clone_File_Map

using Clone_File_Map = std::map<space_id_t, uint>

Map type for mapping space ID to clone file index.

◆ Clone_File_Vec

using Clone_File_Vec = std::vector<Clone_file_ctx *>

Vector type for storing clone files.

◆ Clone_Page_Set

Set for storing unique page IDs.

◆ Clone_Page_Vec

using Clone_Page_Vec = std::vector<Clone_Page>

Vector type for storing clone page IDs.

Enumeration Type Documentation

◆ Clone_Handle_Type

Clone handle type.

Enumerator
CLONE_HDL_COPY 

Clone Handle for COPY.

CLONE_HDL_APPLY 

Clone Handle for APPLY.

Variable Documentation

◆ SNAPSHOT_DEF_BLOCK_SIZE_POW2

const uint SNAPSHOT_DEF_BLOCK_SIZE_POW2 = 6

Default block size in power of 2 in unit of pages.

Data transfer callback is invoked once for each block. This is also the maximum size of data that would be re-send if clone is stopped and resumed. For 16k page size, block size is 1M.

◆ SNAPSHOT_DEF_CHUNK_SIZE_POW2

const uint SNAPSHOT_DEF_CHUNK_SIZE_POW2 = 12

Default chunk size in power of 2 in unit of pages.

Chunks are reserved by each thread for multi-threaded clone. For 16k page size, chunk size is 64M.

◆ SNAPSHOT_MAX_BLOCK_SIZE_POW2

const uint SNAPSHOT_MAX_BLOCK_SIZE_POW2 = 12

Maximum block size in power of 2 in unit of pages.

For 16k page size, maximum block size is 64M.