MySQL 26.7.0
Source Code Documentation
clone_descriptor_format.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2026, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28/** @file include/clone_descriptor_format.h
29 Shared serialized clone descriptor layout constants.
30
31 *******************************************************/
32
33#ifndef CLONE_DESCRIPTOR_FORMAT_INCLUDED
34#define CLONE_DESCRIPTOR_FORMAT_INCLUDED
35
36#include <cstdint>
37
39
40/** Highest serialized descriptor version supported by this format. */
41inline constexpr std::uint32_t CLONE_DESC_MAX_VERSION = 100;
42
43/** Descriptor version field offset in the serialized header. */
44inline constexpr std::uint32_t CLONE_DESC_VER_OFFSET = 0;
45/** Descriptor length field offset in the serialized header. */
46inline constexpr std::uint32_t CLONE_DESC_LEN_OFFSET =
48/** Descriptor type field offset in the serialized header. */
49inline constexpr std::uint32_t CLONE_DESC_TYPE_OFFSET =
51/** Serialized descriptor header length in bytes. */
52inline constexpr std::uint32_t CLONE_DESC_HEADER_LEN =
54
55/** Serialized type value for file metadata descriptors. */
56inline constexpr std::uint32_t CLONE_DESC_FILE_METADATA_TYPE = 4;
57
58/** Task metadata task index field offset. */
59inline constexpr std::uint32_t CLONE_TASK_INDEX_OFFSET = CLONE_DESC_HEADER_LEN;
60/** Task metadata chunk number field offset. */
61inline constexpr std::uint32_t CLONE_TASK_CHUNK_OFFSET =
63/** Task metadata block number field offset. */
64inline constexpr std::uint32_t CLONE_TASK_BLOCK_OFFSET =
66/** Serialized task metadata descriptor length in bytes. */
67inline constexpr std::uint32_t CLONE_TASK_META_LEN =
69
70/** Locator descriptor clone id field offset. */
71inline constexpr std::uint32_t CLONE_LOC_CID_OFFSET = CLONE_DESC_HEADER_LEN;
72/** Locator descriptor snapshot id field offset. */
73inline constexpr std::uint32_t CLONE_LOC_SID_OFFSET = CLONE_LOC_CID_OFFSET + 8;
74/** Locator descriptor clone array index field offset. */
75inline constexpr std::uint32_t CLONE_LOC_IDX_OFFSET = CLONE_LOC_SID_OFFSET + 8;
76/** Locator descriptor snapshot state field offset. */
77inline constexpr std::uint32_t CLONE_LOC_STATE_OFFSET =
79/** Locator descriptor snapshot sub-state field offset. */
80inline constexpr std::uint32_t CLONE_LOC_META_OFFSET =
82/** Serialized locator descriptor base length in bytes. */
83inline constexpr std::uint32_t CLONE_DESC_LOC_BASE_LEN =
85
86/** File metadata state field offset. */
87inline constexpr std::uint32_t CLONE_FILE_STATE_OFFSET = CLONE_DESC_HEADER_LEN;
88/** File metadata file size field offset. */
89inline constexpr std::uint32_t CLONE_FILE_SIZE_OFFSET =
91/** File metadata allocated size field offset. */
92inline constexpr std::uint32_t CLONE_FILE_ALLOC_SIZE_OFFSET =
94/** File metadata FSP flags field offset. */
95inline constexpr std::uint32_t CLONE_FILE_FSP_OFFSET =
97/** File metadata filesystem block size field offset. */
98inline constexpr std::uint32_t CLONE_FILE_FSBLK_OFFSET =
100/** File metadata flags field offset. */
101inline constexpr std::uint32_t CLONE_FILE_FLAGS_OFFSET =
103/** File metadata zlib compression flag bit. */
104inline constexpr std::uint32_t CLONE_DESC_FILE_FLAG_ZLIB = 1;
105/** File metadata LZ4 compression flag bit. */
106inline constexpr std::uint32_t CLONE_DESC_FILE_FLAG_LZ4 = 2;
107/** File metadata encryption flag bit. */
108inline constexpr std::uint32_t CLONE_DESC_FILE_FLAG_AES = 3;
109/** File metadata renamed flag bit. */
110inline constexpr std::uint32_t CLONE_DESC_FILE_FLAG_RENAMED = 4;
111/** File metadata deleted flag bit. */
112inline constexpr std::uint32_t CLONE_DESC_FILE_FLAG_DELETED = 5;
113/** File metadata key-presence flag bit. */
114inline constexpr std::uint32_t CLONE_DESC_FILE_HAS_KEY = 6;
115/** File metadata tablespace id field offset. */
116inline constexpr std::uint32_t CLONE_FILE_SPACE_ID_OFFSET =
118/** File metadata file index field offset. */
119inline constexpr std::uint32_t CLONE_FILE_IDX_OFFSET =
121/** File metadata begin chunk field offset. */
122inline constexpr std::uint32_t CLONE_FILE_BCHUNK_OFFSET =
124/** File metadata end chunk field offset. */
125inline constexpr std::uint32_t CLONE_FILE_ECHUNK_OFFSET =
127/** File metadata file name length field offset. */
128inline constexpr std::uint32_t CLONE_FILE_FNAMEL_OFFSET =
130/** File metadata file name field offset. */
131inline constexpr std::uint32_t CLONE_FILE_FNAME_OFFSET =
133/** Serialized file metadata descriptor base length in bytes. */
134inline constexpr std::uint32_t CLONE_FILE_BASE_LEN = CLONE_FILE_FNAME_OFFSET;
135
136/** State descriptor clone state field offset. */
137inline constexpr std::uint32_t CLONE_DESC_STATE_OFFSET = CLONE_DESC_HEADER_LEN;
138/** State descriptor task index field offset. */
139inline constexpr std::uint32_t CLONE_DESC_TASK_OFFSET =
141/** State descriptor chunk count field offset. */
142inline constexpr std::uint32_t CLONE_DESC_STATE_NUM_CHUNKS =
144/** State descriptor file count field offset. */
145inline constexpr std::uint32_t CLONE_DESC_STATE_NUM_FILES =
147/** State descriptor estimated byte count field offset. */
148inline constexpr std::uint32_t CLONE_DESC_STATE_EST_BYTES =
150/** State descriptor estimated disk usage field offset. */
151inline constexpr std::uint32_t CLONE_DESC_STATE_EST_DISK =
153/** State descriptor flags field offset. */
154inline constexpr std::uint32_t CLONE_DESC_STATE_FLAGS =
156/** Serialized state descriptor length in bytes. */
157inline constexpr std::uint32_t CLONE_DESC_STATE_LEN =
159/** State descriptor start flag bit. */
160inline constexpr std::uint32_t CLONE_DESC_STATE_FLAG_START = 1;
161/** State descriptor acknowledgement flag bit. */
162inline constexpr std::uint32_t CLONE_DESC_STATE_FLAG_ACK = 2;
163
164/** Data descriptor state field offset. */
165inline constexpr std::uint32_t CLONE_DATA_STATE_OFFSET = CLONE_DESC_HEADER_LEN;
166/** Data descriptor task index field offset. */
167inline constexpr std::uint32_t CLONE_DATA_TASK_INDEX_OFFSET =
169/** Data descriptor chunk number field offset. */
170inline constexpr std::uint32_t CLONE_DATA_TASK_CHUNK_OFFSET =
172/** Data descriptor block number field offset. */
173inline constexpr std::uint32_t CLONE_DATA_TASK_BLOCK_OFFSET =
175/** Data descriptor file index field offset. */
176inline constexpr std::uint32_t CLONE_DATA_FILE_IDX_OFFSET =
178/** Data descriptor data length field offset. */
179inline constexpr std::uint32_t CLONE_DATA_LEN_OFFSET =
181/** Data descriptor file offset field offset. */
182inline constexpr std::uint32_t CLONE_DATA_FOFF_OFFSET =
184/** Data descriptor file size field offset. */
185inline constexpr std::uint32_t CLONE_DATA_FILE_SIZE_OFFSET =
187/** Serialized data descriptor length in bytes. */
188inline constexpr std::uint32_t CLONE_DESC_DATA_LEN =
190
191} // namespace clone_desc_format
192
193#endif // CLONE_DESCRIPTOR_FORMAT_INCLUDED
Definition: clone_descriptor_format.h:38
constexpr std::uint32_t CLONE_FILE_FNAME_OFFSET
File metadata file name field offset.
Definition: clone_descriptor_format.h:131
constexpr std::uint32_t CLONE_DESC_FILE_FLAG_ZLIB
File metadata zlib compression flag bit.
Definition: clone_descriptor_format.h:104
constexpr std::uint32_t CLONE_DESC_STATE_FLAG_ACK
State descriptor acknowledgement flag bit.
Definition: clone_descriptor_format.h:162
constexpr std::uint32_t CLONE_DATA_FILE_SIZE_OFFSET
Data descriptor file size field offset.
Definition: clone_descriptor_format.h:185
constexpr std::uint32_t CLONE_TASK_META_LEN
Serialized task metadata descriptor length in bytes.
Definition: clone_descriptor_format.h:67
constexpr std::uint32_t CLONE_DATA_STATE_OFFSET
Data descriptor state field offset.
Definition: clone_descriptor_format.h:165
constexpr std::uint32_t CLONE_FILE_BASE_LEN
Serialized file metadata descriptor base length in bytes.
Definition: clone_descriptor_format.h:134
constexpr std::uint32_t CLONE_LOC_STATE_OFFSET
Locator descriptor snapshot state field offset.
Definition: clone_descriptor_format.h:77
constexpr std::uint32_t CLONE_LOC_SID_OFFSET
Locator descriptor snapshot id field offset.
Definition: clone_descriptor_format.h:73
constexpr std::uint32_t CLONE_FILE_FLAGS_OFFSET
File metadata flags field offset.
Definition: clone_descriptor_format.h:101
constexpr std::uint32_t CLONE_LOC_IDX_OFFSET
Locator descriptor clone array index field offset.
Definition: clone_descriptor_format.h:75
constexpr std::uint32_t CLONE_DATA_FILE_IDX_OFFSET
Data descriptor file index field offset.
Definition: clone_descriptor_format.h:176
constexpr std::uint32_t CLONE_DESC_STATE_NUM_CHUNKS
State descriptor chunk count field offset.
Definition: clone_descriptor_format.h:142
constexpr std::uint32_t CLONE_DESC_HEADER_LEN
Serialized descriptor header length in bytes.
Definition: clone_descriptor_format.h:52
constexpr std::uint32_t CLONE_DESC_FILE_HAS_KEY
File metadata key-presence flag bit.
Definition: clone_descriptor_format.h:114
constexpr std::uint32_t CLONE_TASK_BLOCK_OFFSET
Task metadata block number field offset.
Definition: clone_descriptor_format.h:64
constexpr std::uint32_t CLONE_DESC_DATA_LEN
Serialized data descriptor length in bytes.
Definition: clone_descriptor_format.h:188
constexpr std::uint32_t CLONE_DESC_LEN_OFFSET
Descriptor length field offset in the serialized header.
Definition: clone_descriptor_format.h:46
constexpr std::uint32_t CLONE_DESC_STATE_EST_DISK
State descriptor estimated disk usage field offset.
Definition: clone_descriptor_format.h:151
constexpr std::uint32_t CLONE_FILE_IDX_OFFSET
File metadata file index field offset.
Definition: clone_descriptor_format.h:119
constexpr std::uint32_t CLONE_DESC_LOC_BASE_LEN
Serialized locator descriptor base length in bytes.
Definition: clone_descriptor_format.h:83
constexpr std::uint32_t CLONE_LOC_META_OFFSET
Locator descriptor snapshot sub-state field offset.
Definition: clone_descriptor_format.h:80
constexpr std::uint32_t CLONE_TASK_CHUNK_OFFSET
Task metadata chunk number field offset.
Definition: clone_descriptor_format.h:61
constexpr std::uint32_t CLONE_DESC_FILE_FLAG_LZ4
File metadata LZ4 compression flag bit.
Definition: clone_descriptor_format.h:106
constexpr std::uint32_t CLONE_TASK_INDEX_OFFSET
Task metadata task index field offset.
Definition: clone_descriptor_format.h:59
constexpr std::uint32_t CLONE_LOC_CID_OFFSET
Locator descriptor clone id field offset.
Definition: clone_descriptor_format.h:71
constexpr std::uint32_t CLONE_FILE_ALLOC_SIZE_OFFSET
File metadata allocated size field offset.
Definition: clone_descriptor_format.h:92
constexpr std::uint32_t CLONE_FILE_ECHUNK_OFFSET
File metadata end chunk field offset.
Definition: clone_descriptor_format.h:125
constexpr std::uint32_t CLONE_DESC_FILE_FLAG_DELETED
File metadata deleted flag bit.
Definition: clone_descriptor_format.h:112
constexpr std::uint32_t CLONE_DESC_STATE_FLAG_START
State descriptor start flag bit.
Definition: clone_descriptor_format.h:160
constexpr std::uint32_t CLONE_FILE_FSP_OFFSET
File metadata FSP flags field offset.
Definition: clone_descriptor_format.h:95
constexpr std::uint32_t CLONE_DATA_FOFF_OFFSET
Data descriptor file offset field offset.
Definition: clone_descriptor_format.h:182
constexpr std::uint32_t CLONE_DESC_STATE_EST_BYTES
State descriptor estimated byte count field offset.
Definition: clone_descriptor_format.h:148
constexpr std::uint32_t CLONE_DESC_STATE_FLAGS
State descriptor flags field offset.
Definition: clone_descriptor_format.h:154
constexpr std::uint32_t CLONE_DESC_TASK_OFFSET
State descriptor task index field offset.
Definition: clone_descriptor_format.h:139
constexpr std::uint32_t CLONE_DESC_STATE_NUM_FILES
State descriptor file count field offset.
Definition: clone_descriptor_format.h:145
constexpr std::uint32_t CLONE_FILE_SPACE_ID_OFFSET
File metadata tablespace id field offset.
Definition: clone_descriptor_format.h:116
constexpr std::uint32_t CLONE_DATA_TASK_CHUNK_OFFSET
Data descriptor chunk number field offset.
Definition: clone_descriptor_format.h:170
constexpr std::uint32_t CLONE_FILE_FNAMEL_OFFSET
File metadata file name length field offset.
Definition: clone_descriptor_format.h:128
constexpr std::uint32_t CLONE_DATA_TASK_BLOCK_OFFSET
Data descriptor block number field offset.
Definition: clone_descriptor_format.h:173
constexpr std::uint32_t CLONE_DESC_FILE_FLAG_RENAMED
File metadata renamed flag bit.
Definition: clone_descriptor_format.h:110
constexpr std::uint32_t CLONE_DESC_TYPE_OFFSET
Descriptor type field offset in the serialized header.
Definition: clone_descriptor_format.h:49
constexpr std::uint32_t CLONE_DESC_STATE_OFFSET
State descriptor clone state field offset.
Definition: clone_descriptor_format.h:137
constexpr std::uint32_t CLONE_DATA_LEN_OFFSET
Data descriptor data length field offset.
Definition: clone_descriptor_format.h:179
constexpr std::uint32_t CLONE_DESC_VER_OFFSET
Descriptor version field offset in the serialized header.
Definition: clone_descriptor_format.h:44
constexpr std::uint32_t CLONE_DESC_FILE_FLAG_AES
File metadata encryption flag bit.
Definition: clone_descriptor_format.h:108
constexpr std::uint32_t CLONE_DATA_TASK_INDEX_OFFSET
Data descriptor task index field offset.
Definition: clone_descriptor_format.h:167
constexpr std::uint32_t CLONE_FILE_BCHUNK_OFFSET
File metadata begin chunk field offset.
Definition: clone_descriptor_format.h:122
constexpr std::uint32_t CLONE_FILE_SIZE_OFFSET
File metadata file size field offset.
Definition: clone_descriptor_format.h:89
constexpr std::uint32_t CLONE_DESC_FILE_METADATA_TYPE
Serialized type value for file metadata descriptors.
Definition: clone_descriptor_format.h:56
constexpr std::uint32_t CLONE_DESC_MAX_VERSION
Highest serialized descriptor version supported by this format.
Definition: clone_descriptor_format.h:41
constexpr std::uint32_t CLONE_FILE_STATE_OFFSET
File metadata state field offset.
Definition: clone_descriptor_format.h:87
constexpr std::uint32_t CLONE_FILE_FSBLK_OFFSET
File metadata filesystem block size field offset.
Definition: clone_descriptor_format.h:98
constexpr std::uint32_t CLONE_DESC_STATE_LEN
Serialized state descriptor length in bytes.
Definition: clone_descriptor_format.h:157