MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
vacuous_trx.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/4/24.
13//
14
15#pragma once
16
17#include "storage/trx/trx.h"
18
22class VacuousTrxKit : public TrxKit
23{
24public:
25 VacuousTrxKit() = default;
26 virtual ~VacuousTrxKit() = default;
27
28 RC init() override;
29 const std::vector<FieldMeta> *trx_fields() const override;
30 Trx *create_trx(CLogManager *log_manager) override;
31 Trx *create_trx(int32_t trx_id) override;
32 Trx *find_trx(int32_t trx_id) override;
33 void all_trxes(std::vector<Trx *> &trxes) override;
34
35 void destroy_trx(Trx *trx) override;
36};
37
38class VacuousTrx : public Trx
39{
40public:
41 VacuousTrx() = default;
42 virtual ~VacuousTrx() = default;
43
44 RC insert_record(Table *table, Record &record) override;
45 RC delete_record(Table *table, Record &record) override;
46 RC visit_record(Table *table, Record &record, bool readonly) override;
47 RC start_if_need() override;
48 RC commit() override;
49 RC rollback() override;
50
51 int32_t id() const override { return 0; }
52};
日志管理器
Definition: clog.h:357
表示一个记录 当前的记录都是连续存放的空间(内存或磁盘上)。 为了提高访问的效率,record通常直接记录指向页面上的内存,但是需要保证访问这种数据时,拿着锁资源。 为了方便,也提供了复制内存的方法。可...
Definition: record.h:92
Definition: table.h:37
事务管理器
Definition: trx.h:105
事务接口
Definition: trx.h:142
Vacuous(真空的),顾名思义就是没有实现事务功能
Definition: vacuous_trx.h:23
Definition: vacuous_trx.h:39