Meta.h 2.5 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"
X
Xu Peng 已提交
9 10
#include "Options.h"
#include "Status.h"
X
Xu Peng 已提交
11

X
Xu Peng 已提交
12 13 14 15
#include <cstddef>
#include <ctime>
#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 22

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

26 27
    virtual
    ~Meta() = 0;
28

29 30
    virtual Status
    CreateTable(TableSchema &table_schema) = 0;
G
groot 已提交
31

32 33
    virtual Status
    DescribeTable(TableSchema &table_schema) = 0;
X
Xu Peng 已提交
34

35 36
    virtual Status
    HasTable(const std::string &table_id, bool &has_or_not) = 0;
37

38 39
    virtual Status
    AllTables(std::vector<TableSchema> &table_schema_array) = 0;
P
peng.xu 已提交
40

41 42
    virtual Status
    DeleteTable(const std::string &table_id) = 0;
43

44 45
    virtual Status
    DeleteTableFiles(const std::string &table_id) = 0;
46

47 48
    virtual Status
    CreateTableFile(TableFileSchema &file_schema) = 0;
X
xj.lin 已提交
49

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

53 54
    virtual Status
    GetTableFiles(const std::string &table_id, const std::vector<size_t> &ids, TableFilesSchema &table_files) = 0;
X
Xu Peng 已提交
55

56 57
    virtual Status
    UpdateTableFilesToIndex(const std::string &table_id) = 0;
X
Xu Peng 已提交
58

59 60
    virtual Status
    UpdateTableFile(TableFileSchema &file_schema) = 0;
X
Xu Peng 已提交
61

62 63
    virtual Status
    UpdateTableFiles(TableFilesSchema &files) = 0;
P
peng.xu 已提交
64

65 66
    virtual Status
    FilesToSearch(const std::string &table_id, const DatesT &partition, DatePartionedTableFilesSchema &files) = 0;
X
Xu Peng 已提交
67

68 69
    virtual Status
    FilesToMerge(const std::string &table_id, DatePartionedTableFilesSchema &files) = 0;
X
Xu Peng 已提交
70

71 72
    virtual Status
    Size(uint64_t &result) = 0;
X
Xu Peng 已提交
73

74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
    virtual Status
    Archive() = 0;

    virtual Status
    FilesToIndex(TableFilesSchema &) = 0;

    virtual Status
    HasNonIndexFiles(const std::string &table_id, bool &has) = 0;

    virtual Status
    CleanUp() = 0;

    virtual Status
    CleanUpFilesWithTTL(uint16_t) = 0;

    virtual Status
    DropAll() = 0;

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

    static DateT
    GetDate(const std::time_t &t, int day_delta = 0);

    static DateT
    GetDate();

    static DateT
    GetDateWithDelta(int day_delta);
103

X
Xu Peng 已提交
104 105
}; // MetaData

106
} // namespace meta
X
Xu Peng 已提交
107
} // namespace engine
J
jinhai 已提交
108
} // namespace milvus
X
Xu Peng 已提交
109
} // namespace zilliz