MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
ivfflat_index.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/index/index.h"
14
19class IvfflatIndex : public Index
20{
21public:
22 IvfflatIndex(){};
23 virtual ~IvfflatIndex() noexcept {};
24
25 RC create(Table *table, const char *file_name, const IndexMeta &index_meta, const FieldMeta &field_meta)
26 {
27 return RC::UNIMPLEMENTED;
28 };
29 RC open(Table *table, const char *file_name, const IndexMeta &index_meta, const FieldMeta &field_meta)
30 {
31
32 return RC::UNIMPLEMENTED;
33 };
34
35 vector<RID> ann_search(const vector<float> &base_vector, size_t limit) { return vector<RID>(); }
36
37 RC close() { return RC::UNIMPLEMENTED; }
38
39 RC insert_entry(const char *record, const RID *rid) override { return RC::UNIMPLEMENTED; };
40 RC delete_entry(const char *record, const RID *rid) override { return RC::UNIMPLEMENTED; };
41
42 RC sync() override { return RC::UNIMPLEMENTED; };
43
44private:
45 bool inited_ = false;
46 Table *table_ = nullptr;
47 int lists_ = 1;
48 int probes_ = 1;
49};
字段元数据
Definition: field_meta.h:30
描述一个索引
Definition: index_meta.h:34
索引基类
Definition: index.h:38
ivfflat 向量索引
Definition: ivfflat_index.h:20
RC insert_entry(const char *record, const RID *rid) override
插入一条数据
Definition: ivfflat_index.h:39
RC delete_entry(const char *record, const RID *rid) override
删除一条数据
Definition: ivfflat_index.h:40
RC sync() override
同步索引数据到磁盘
Definition: ivfflat_index.h:42
Definition: table.h:42
标识一个记录的位置 一个记录是放在某个文件的某个页面的某个槽位。这里不记录文件信息,记录页面和槽位信息
Definition: record.h:35