Meta.h 2.6 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 7
#pragma once
#include <cstddef>
8
#include <ctime>
X
Xu Peng 已提交
9 10
#include <memory>

X
Xu Peng 已提交
11
#include "MetaTypes.h"
X
Xu Peng 已提交
12 13
#include "Options.h"
#include "Status.h"
X
Xu Peng 已提交
14 15 16 17

namespace zilliz {
namespace vecwise {
namespace engine {
18 19
namespace meta {

X
Xu Peng 已提交
20 21 22

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

25
    virtual Status CreateTable(TableSchema& table_schema) = 0;
X
Xu Peng 已提交
26
    virtual Status DescribeTable(TableSchema& table_schema) = 0;
27
    virtual Status has_group(const std::string& table_id_, bool& has_or_not_) = 0;
28

29
    virtual Status add_group_file(TableFileSchema& group_file_info) = 0;
30
    virtual Status delete_group_partitions(const std::string& table_id,
X
Xu Peng 已提交
31
            const meta::DatesT& dates) = 0;
X
Xu Peng 已提交
32

33
    virtual Status has_group_file(const std::string& table_id_,
34 35
                                  const std::string& file_id_,
                                  bool& has_or_not_) = 0;
36
    virtual Status get_group_file(const std::string& table_id_,
37
                                  const std::string& file_id_,
38 39
                                  TableFileSchema& group_file_info_) = 0;
    virtual Status update_group_file(TableFileSchema& group_file_) = 0;
40

41
    virtual Status get_group_files(const std::string& table_id_,
42
                                   const int date_delta_,
43
                                   TableFilesSchema& group_files_info_) = 0;
X
Xu Peng 已提交
44

45
    virtual Status update_files(TableFilesSchema& files) = 0;
46

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

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

X
Xu Peng 已提交
54 55
    virtual Status size(long& result) = 0;

X
Xu Peng 已提交
56 57
    virtual Status archive_files() = 0;

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

X
Xu Peng 已提交
60
    virtual Status cleanup() = 0;
X
Xu Peng 已提交
61
    virtual Status cleanup_ttl_files(uint16_t) = 0;
X
Xu Peng 已提交
62

X
Xu Peng 已提交
63 64
    virtual Status drop_all() = 0;

65
    virtual Status count(const std::string& table_id, long& result) = 0;
X
Xu Peng 已提交
66

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

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

73
} // namespace meta
X
Xu Peng 已提交
74 75 76
} // namespace engine
} // namespace vecwise
} // namespace zilliz