Meta.h 2.4 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;

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

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

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

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

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

X
Xu Peng 已提交
55
    virtual Status Archive() = 0;
X
Xu Peng 已提交
56

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

59 60
    virtual Status CleanUp() = 0;
    virtual Status CleanUpFilesWithTTL(uint16_t) = 0;
X
Xu Peng 已提交
61

62
    virtual Status DropAll() = 0;
X
Xu Peng 已提交
63

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

X
Xu Peng 已提交
66 67 68
    static DateT GetDate(const std::time_t& t, int day_delta = 0);
    static DateT GetDate();
    static DateT GetDateWithDelta(int day_delta);
69

X
Xu Peng 已提交
70 71
}; // MetaData

72
} // namespace meta
X
Xu Peng 已提交
73
} // namespace engine
J
jinhai 已提交
74
} // namespace milvus
X
Xu Peng 已提交
75
} // namespace zilliz