MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
page.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11//
12// Created by Wangyunlai on 2023/03/07.
13//
14
15#pragma once
16
17#include <stdint.h>
18#include "common/types.h"
19
20using TrxID = int32_t;
21
22static constexpr int BP_INVALID_PAGE_NUM = -1;
23
24static constexpr PageNum BP_HEADER_PAGE = 0;
25
26static constexpr const int BP_PAGE_SIZE = (1 << 13);
27static constexpr const int BP_PAGE_DATA_SIZE = (BP_PAGE_SIZE - sizeof(PageNum) - sizeof(LSN));
28
33struct Page
34{
35 PageNum page_num;
36 LSN lsn;
37 char data[BP_PAGE_DATA_SIZE];
38};
表示一个页面,可能放在内存或磁盘上
Definition: page.h:34