Meta.h 2.1 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 HasTable(const std::string& table_id, bool& has_or_not) = 0;
28

X
Xu Peng 已提交
29
    virtual Status CreateTableFile(TableFileSchema& file_schema) = 0;
X
Xu Peng 已提交
30 31
    virtual Status DropPartitionsByDates(const std::string& table_id,
            const DatesT& dates) = 0;
X
Xu Peng 已提交
32

X
Xu Peng 已提交
33
    virtual Status GetTableFile(TableFileSchema& file_schema) = 0;
X
Xu Peng 已提交
34
    virtual Status UpdateTableFile(TableFileSchema& file_schema) = 0;
35

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

X
Xu Peng 已提交
38
    virtual Status FilesToSearch(const std::string& table_id,
X
Xu Peng 已提交
39
                                   const DatesT& partition,
40
                                   DatePartionedTableFilesSchema& files) = 0;
X
xj.lin 已提交
41

42
    virtual Status files_to_merge(const std::string& table_id,
43
            DatePartionedTableFilesSchema& files) = 0;
X
Xu Peng 已提交
44

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

X
Xu Peng 已提交
47 48
    virtual Status archive_files() = 0;

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

X
Xu Peng 已提交
51
    virtual Status cleanup() = 0;
X
Xu Peng 已提交
52
    virtual Status cleanup_ttl_files(uint16_t) = 0;
X
Xu Peng 已提交
53

X
Xu Peng 已提交
54 55
    virtual Status drop_all() = 0;

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

X
Xu Peng 已提交
58 59 60
    static DateT GetDate(const std::time_t& t, int day_delta = 0);
    static DateT GetDate();
    static DateT GetDateWithDelta(int day_delta);
61

X
Xu Peng 已提交
62 63
}; // MetaData

64
} // namespace meta
X
Xu Peng 已提交
65 66 67
} // namespace engine
} // namespace vecwise
} // namespace zilliz