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 23

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

26
    virtual Status CreateTable(TableSchema& table_schema) = 0;
X
Xu Peng 已提交
27
    virtual Status DescribeTable(TableSchema& table_schema) = 0;
28
    virtual Status HasTable(const std::string& table_id, bool& has_or_not) = 0;
G
groot 已提交
29
    virtual Status AllTables(std::vector<TableSchema>& table_schema_array) = 0;
30

G
groot 已提交
31 32 33
    virtual Status DeleteTable(const std::string& table_id) = 0;
    virtual Status DeleteTableFiles(const std::string& table_id) = 0;

X
Xu Peng 已提交
34
    virtual Status CreateTableFile(TableFileSchema& file_schema) = 0;
X
Xu Peng 已提交
35 36
    virtual Status DropPartitionsByDates(const std::string& table_id,
            const DatesT& dates) = 0;
X
Xu Peng 已提交
37

38 39 40 41
    virtual Status GetTableFiles(const std::string& table_id,
            const std::vector<size_t>& ids,
            TableFilesSchema& table_files) = 0;

P
peng.xu 已提交
42 43
    virtual Status UpdateTableFilesToIndex(const std::string& table_id) = 0;

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

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

48 49 50
    virtual Status FilesToSearch(const std::string &table_id,
                                 const DatesT &partition,
                                 DatePartionedTableFilesSchema& files) = 0;
X
xj.lin 已提交
51

X
Xu Peng 已提交
52
    virtual Status FilesToMerge(const std::string& table_id,
53
            DatePartionedTableFilesSchema& files) = 0;
X
Xu Peng 已提交
54

G
groot 已提交
55
    virtual Status Size(uint64_t& result) = 0;
X
Xu Peng 已提交
56

X
Xu Peng 已提交
57
    virtual Status Archive() = 0;
X
Xu Peng 已提交
58

X
Xu Peng 已提交
59
    virtual Status FilesToIndex(TableFilesSchema&) = 0;
X
Xu Peng 已提交
60

P
peng.xu 已提交
61 62
    virtual Status HasNonIndexFiles(const std::string& table_id, bool& has) = 0;

63 64
    virtual Status CleanUp() = 0;
    virtual Status CleanUpFilesWithTTL(uint16_t) = 0;
X
Xu Peng 已提交
65

66
    virtual Status DropAll() = 0;
X
Xu Peng 已提交
67

G
groot 已提交
68
    virtual Status Count(const std::string& table_id, uint64_t& result) = 0;
X
Xu Peng 已提交
69

X
Xu Peng 已提交
70 71 72
    static DateT GetDate(const std::time_t& t, int day_delta = 0);
    static DateT GetDate();
    static DateT GetDateWithDelta(int day_delta);
73

X
Xu Peng 已提交
74 75
}; // MetaData

76
} // namespace meta
X
Xu Peng 已提交
77
} // namespace engine
J
jinhai 已提交
78
} // namespace milvus
X
Xu Peng 已提交
79
} // namespace zilliz