Meta.h 3.0 KB
Newer Older
X
Xu Peng 已提交
1 2 3 4 5
/*******************************************************************************
 * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 * Proprietary and confidential.
 ******************************************************************************/
X
Xu Peng 已提交
6
#pragma once
X
Xu Peng 已提交
7

X
Xu Peng 已提交
8
#include "MetaTypes.h"
G
groot 已提交
9 10
#include "db/Options.h"
#include "db/Status.h"
11
#include "db/Types.h"
X
Xu Peng 已提交
12

X
Xu Peng 已提交
13 14 15
#include <cstddef>
#include <memory>

X
Xu Peng 已提交
16
namespace zilliz {
J
jinhai 已提交
17
namespace milvus {
X
Xu Peng 已提交
18
namespace engine {
19 20
namespace meta {

X
Xu Peng 已提交
21
class Meta {
22
 public:
23
    using Ptr = std::shared_ptr<Meta>;
X
Xu Peng 已提交
24

25
    virtual ~Meta() = default;
26

27
    virtual Status CreateTable(TableSchema &table_schema) = 0;
P
peng.xu 已提交
28

29
    virtual Status DescribeTable(TableSchema &table_schema) = 0;
30

31
    virtual Status HasTable(const std::string &table_id, bool &has_or_not) = 0;
G
groot 已提交
32

33
    virtual Status AllTables(std::vector<TableSchema> &table_schema_array) = 0;
34

35
    virtual Status UpdateTableIndexParam(const std::string &table_id, const TableIndex& index) = 0;
36

37
    virtual Status UpdateTableFlag(const std::string &table_id, int64_t flag) = 0;
X
xj.lin 已提交
38

39
    virtual Status DeleteTable(const std::string &table_id) = 0;
X
Xu Peng 已提交
40

41
    virtual Status DeleteTableFiles(const std::string &table_id) = 0;
X
Xu Peng 已提交
42

43
    virtual Status CreateTableFile(TableFileSchema &file_schema) = 0;
X
Xu Peng 已提交
44

45
    virtual Status DropPartitionsByDates(const std::string &table_id, const DatesT &dates) = 0;
X
Xu Peng 已提交
46

47 48 49
    virtual Status GetTableFiles(const std::string &table_id,
                                 const std::vector<size_t> &ids,
                                 TableFilesSchema &table_files) = 0;
P
peng.xu 已提交
50

51
    virtual Status UpdateTableFilesToIndex(const std::string &table_id) = 0;
X
xj.lin 已提交
52

53
    virtual Status UpdateTableFile(TableFileSchema &file_schema) = 0;
X
Xu Peng 已提交
54

55
    virtual Status UpdateTableFiles(TableFilesSchema &files) = 0;
X
Xu Peng 已提交
56

57 58 59 60
    virtual Status FilesToSearch(const std::string &table_id,
                                 const std::vector<size_t> &ids,
                                 const DatesT &partition,
                                 DatePartionedTableFilesSchema &files) = 0;
61

62
    virtual Status FilesToMerge(const std::string &table_id, DatePartionedTableFilesSchema &files) = 0;
63

64
    virtual Status Size(uint64_t &result) = 0;
65

66
    virtual Status Archive() = 0;
67

68
    virtual Status FilesToIndex(TableFilesSchema &) = 0;
69

70 71 72
    virtual Status FilesByType(const std::string &table_id,
                               const std::vector<int> &file_types,
                               std::vector<std::string>& file_ids) = 0;
73

74
    virtual Status DescribeTableIndex(const std::string &table_id, TableIndex& index) = 0;
75

76
    virtual Status DropTableIndex(const std::string &table_id) = 0;
77

78
    virtual Status CleanUp() = 0;
79

80
    virtual Status CleanUpFilesWithTTL(uint16_t) = 0;
81

82
    virtual Status DropAll() = 0;
83

84
    virtual Status Count(const std::string &table_id, uint64_t &result) = 0;
85

X
Xu Peng 已提交
86 87
}; // MetaData

88
} // namespace meta
X
Xu Peng 已提交
89
} // namespace engine
J
jinhai 已提交
90
} // namespace milvus
X
Xu Peng 已提交
91
} // namespace zilliz