MiniOB
1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
src
observer
storage
clog
log_module.h
1
/* Copyright (c) 2021-2022 OceanBase and/or its affiliates. All rights reserved.
2
miniob is licensed under Mulan PSL v2.
3
You can use this software according to the terms and conditions of the Mulan PSL v2.
4
You may obtain a copy of Mulan PSL v2 at:
5
http://license.coscl.org.cn/MulanPSL2
6
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9
See 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
23
class
LogModule
24
{
25
public
:
26
enum class
Id
27
{
28
BUFFER_POOL,
29
BPLUS_TREE
,
30
RECORD_MANAGER
,
31
TRANSACTION
32
};
33
34
public
:
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
52
private
:
53
Id
id_;
54
};
LogModule
日志模块
Definition:
log_module.h:24
LogModule::Id
Id
Definition:
log_module.h:27
LogModule::Id::RECORD_MANAGER
@ RECORD_MANAGER
B+树
LogModule::Id::BPLUS_TREE
@ BPLUS_TREE
缓冲池
LogModule::Id::TRANSACTION
@ TRANSACTION
记录管理
制作者
1.9.5