MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
lsm_record_scanner.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#pragma once
12
13#include "storage/record/record_scanner.h"
14#include "oblsm/include/ob_lsm_iterator.h"
15#include "oblsm/include/ob_lsm.h"
16#include "sql/expr/tuple.h"
17#include "storage/trx/trx.h"
18
19using namespace oceanbase;
21{
22public:
23 LsmRecordScanner(Table *table, ObLsm *oblsm, Trx *trx) : table_(table), oblsm_(oblsm), trx_(trx) {}
24 ~LsmRecordScanner() = default;
25
29 RC open_scan() override;
30
34 RC close_scan() override;
35
41 RC next(Record &record) override;
42
43private:
44 Table *table_ = nullptr;
45 ObLsm *oblsm_ = nullptr;
46 Trx *trx_ = nullptr;
47 ObLsmIterator *lsm_iter_ = nullptr;
48 RowTuple tuple_;
49 Record record_;
50};
Definition: lsm_record_scanner.h:21
RC close_scan() override
关闭 RecordScanner,释放相应的资源
Definition: lsm_record_scanner.cpp:40
RC open_scan() override
打开 RecordScanner
Definition: lsm_record_scanner.cpp:15
RC next(Record &record) override
获取下一条记录
Definition: lsm_record_scanner.cpp:49
遍历某个表中所有记录
Definition: record_scanner.h:21
表示一个记录
Definition: record.h:101
一行数据的元组
Definition: tuple.h:159
Definition: table.h:42
事务接口
Definition: trx.h:141
Abstract class for iterating over key-value pairs in an LSM-Tree.
Definition: ob_lsm_iterator.h:41
ObLsm is a key-value storage engine for educational purpose. ObLsm learned a lot about design from le...
Definition: ob_lsm.h:29