MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
vacuous_log_handler.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/02/01
13//
14
15#pragma once
16
17#include "storage/clog/log_handler.h"
18
25{
26public:
27 VacuousLogHandler() = default;
28 virtual ~VacuousLogHandler() = default;
29
30 RC init(const char *path) override { return RC::SUCCESS; }
31 RC start() override { return RC::SUCCESS; }
32 RC stop() override { return RC::SUCCESS; }
33 RC await_termination() override { return RC::SUCCESS; }
34 RC replay(LogReplayer &replayer, LSN start_lsn) override { return RC::SUCCESS; }
35 RC iterate(function<RC(LogEntry &)> consumer, LSN start_lsn) override { return RC::SUCCESS; }
36
37 RC wait_lsn(LSN lsn) override { return RC::SUCCESS; }
38
39 LSN current_lsn() const override { return 0; }
40
41private:
42 RC _append(LSN &lsn, LogModule module, vector<char> &&) override
43 {
44 lsn = 0;
45 return RC::SUCCESS;
46 }
47};
描述一条日志
Definition: log_entry.h:44
对外提供服务的CLog模块
Definition: log_handler.h:40
日志模块
Definition: log_module.h:24
日志回放接口类
Definition: log_replayer.h:26
VacuousLogHandler is a log handler implenmentation that do nothing in all methods....
Definition: vacuous_log_handler.h:25
RC init(const char *path) override
初始化日志模块
Definition: vacuous_log_handler.h:30
RC await_termination() override
等待日志模块停止
Definition: vacuous_log_handler.h:33
RC wait_lsn(LSN lsn) override
等待某个LSN的日志被刷新到磁盘
Definition: vacuous_log_handler.h:37
RC start() override
启动日志模块
Definition: vacuous_log_handler.h:31
RC replay(LogReplayer &replayer, LSN start_lsn) override
回放日志
Definition: vacuous_log_handler.h:34
RC _append(LSN &lsn, LogModule module, vector< char > &&) override
写入一条日志
Definition: vacuous_log_handler.h:42
RC iterate(function< RC(LogEntry &)> consumer, LSN start_lsn) override
迭代日志
Definition: vacuous_log_handler.h:35
RC stop() override
停止日志模块
Definition: vacuous_log_handler.h:32