MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
log_module.h
1/* Copyright (c) 2021-2022 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 2024/01/30
13//
14
15#pragma once
16
17#include <stdint.h>
18
24{
25public:
26 enum class Id
27 {
28 BUFFER_POOL,
32 };
33
34public:
35 explicit LogModule(Id id) : id_(id) {}
36 explicit LogModule(int32_t id) : id_(static_cast<Id>(id)) {}
37
38 Id id() const { return id_; }
39 int32_t index() const { return static_cast<int32_t>(id_); }
40
41 const char *name() const
42 {
43 switch (id_) {
44 case Id::BUFFER_POOL: return "BUFFER_POOL";
45 case Id::BPLUS_TREE: return "BPLUS_TREE";
46 case Id::RECORD_MANAGER: return "RECORD_MANAGER";
47 case Id::TRANSACTION: return "TRANSACTION";
48 default: return "UNKNOWN";
49 }
50 }
51
52private:
53 Id id_;
54};
日志模块
Definition: log_module.h:24
Id
Definition: log_module.h:27
@ RECORD_MANAGER
B+树
@ BPLUS_TREE
缓冲池
@ TRANSACTION
记录管理