@@ -31,15 +31,15 @@ See the Mulan PSL v2 for more details. */
31
31
32
32
/* *
33
33
* @brief B+树的实现
34
- * @defgroup B+Tree
34
+ * @defgroup BPlusTree
35
35
*/
36
36
37
37
#define EMPTY_RID_PAGE_NUM -1 // TODO remove me
38
38
#define EMPTY_RID_SLOT_NUM -1
39
39
40
40
/* *
41
41
* @brief B+树的操作类型
42
- * @ingroup B+Tree
42
+ * @ingroup BPlusTree
43
43
*/
44
44
enum class BplusTreeOperationType
45
45
{
@@ -50,7 +50,7 @@ enum class BplusTreeOperationType
50
50
51
51
/* *
52
52
* @brief 属性比较
53
- * @ingroup B+Tree
53
+ * @ingroup BPlusTree
54
54
*/
55
55
class AttrComparator
56
56
{
@@ -92,7 +92,7 @@ class AttrComparator
92
92
93
93
/* *
94
94
* @brief 键值比较
95
- * @ingroup B+Tree
95
+ * @ingroup BPlusTree
96
96
*/
97
97
class KeyComparator
98
98
{
@@ -125,7 +125,7 @@ class KeyComparator
125
125
126
126
/* *
127
127
* @brief 属性打印,调试使用
128
- * @ingroup B+Tree
128
+ * @ingroup BPlusTree
129
129
*/
130
130
class AttrPrinter
131
131
{
@@ -174,7 +174,7 @@ class AttrPrinter
174
174
175
175
/* *
176
176
* @brief 键值打印,调试使用
177
- * @ingroup B+Tree
177
+ * @ingroup BPlusTree
178
178
*/
179
179
class KeyPrinter
180
180
{
@@ -205,7 +205,7 @@ class KeyPrinter
205
205
206
206
/* *
207
207
* @brief the meta information of bplus tree
208
- * @ingroup B+Tree
208
+ * @ingroup BPlusTree
209
209
* @details this is the first page of bplus tree.
210
210
* only one field can be supported, can you extend it to multi-fields?
211
211
*/
@@ -216,12 +216,12 @@ struct IndexFileHeader
216
216
memset (this , 0 , sizeof (IndexFileHeader));
217
217
root_page = BP_INVALID_PAGE_NUM;
218
218
}
219
- PageNum root_page;
220
- int32_t internal_max_size;
221
- int32_t leaf_max_size;
222
- int32_t attr_length;
223
- int32_t key_length; // attr length + sizeof(RID)
224
- AttrType attr_type;
219
+ PageNum root_page; // /< 根节点在磁盘中的页号
220
+ int32_t internal_max_size; // /< 内部节点最大的键值对数
221
+ int32_t leaf_max_size; // /< 叶子节点最大的键值对数
222
+ int32_t attr_length; // /< 键值的长度
223
+ int32_t key_length; // /< attr length + sizeof(RID)
224
+ AttrType attr_type; // /< 键值的类型
225
225
226
226
const std::string to_string ()
227
227
{
@@ -240,9 +240,11 @@ struct IndexFileHeader
240
240
241
241
/* *
242
242
* @brief the common part of page describtion of bplus tree
243
- * @ingroup B+Tree
243
+ * @ingroup BPlusTree
244
+ * @code
244
245
* storage format:
245
246
* | page type | item number | parent page id |
247
+ * @endcode
246
248
*/
247
249
struct IndexNode
248
250
{
@@ -255,11 +257,12 @@ struct IndexNode
255
257
256
258
/* *
257
259
* @brief leaf page of bplus tree
258
- * @ingroup B+Tree
260
+ * @ingroup BPlusTree
261
+ * @code
259
262
* storage format:
260
263
* | common header | prev page id | next page id |
261
264
* | key0, rid0 | key1, rid1 | ... | keyn, ridn |
262
- *
265
+ * @endcode
263
266
* the key is in format: the key value of record and rid.
264
267
* so the key in leaf page must be unique.
265
268
* the value is rid.
@@ -278,11 +281,12 @@ struct LeafIndexNode : public IndexNode
278
281
279
282
/* *
280
283
* @brief internal page of bplus tree
281
- * @ingroup B+Tree
284
+ * @ingroup BPlusTree
285
+ * @code
282
286
* storage format:
283
287
* | common header |
284
288
* | key(0),page_id(0) | key(1), page_id(1) | ... | key(n), page_id(n) |
285
- *
289
+ * @endcode
286
290
* the first key is ignored(key0).
287
291
* so it will waste space, can you fix this?
288
292
*/
@@ -298,7 +302,7 @@ struct InternalIndexNode : public IndexNode
298
302
299
303
/* *
300
304
* @brief IndexNode 仅作为数据在内存或磁盘中的表示
301
- * @ingroup B+Tree
305
+ * @ingroup BPlusTree
302
306
* IndexNodeHandler 负责对IndexNode做各种操作。
303
307
* 作为一个类来说,虚函数会影响“结构体”真实的内存布局,所以将数据存储与操作分开
304
308
*/
@@ -337,7 +341,7 @@ class IndexNodeHandler
337
341
338
342
/* *
339
343
* @brief 叶子节点的操作
340
- * @ingroup B+Tree
344
+ * @ingroup BPlusTree
341
345
*/
342
346
class LeafIndexNodeHandler : public IndexNodeHandler
343
347
{
@@ -388,7 +392,7 @@ class LeafIndexNodeHandler : public IndexNodeHandler
388
392
389
393
/* *
390
394
* @brief 内部节点的操作
391
- * @ingroup B+Tree
395
+ * @ingroup BPlusTree
392
396
*/
393
397
class InternalIndexNodeHandler : public IndexNodeHandler
394
398
{
@@ -453,7 +457,7 @@ class InternalIndexNodeHandler : public IndexNodeHandler
453
457
454
458
/* *
455
459
* @brief B+树的实现
456
- * @ingroup B+Tree
460
+ * @ingroup BPlusTree
457
461
*/
458
462
class BplusTreeHandler
459
463
{
@@ -587,7 +591,7 @@ class BplusTreeHandler
587
591
588
592
/* *
589
593
* @brief B+树的扫描器
590
- * @ingroup B+Tree
594
+ * @ingroup BPlusTree
591
595
*/
592
596
class BplusTreeScanner
593
597
{
0 commit comments