Options.h 1.7 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

S
starlord 已提交
8 9
#include "Constants.h"

X
Xu Peng 已提交
10
#include <string>
11
#include <memory>
X
Xu Peng 已提交
12
#include <map>
S
starlord 已提交
13
#include <vector>
X
Xu Peng 已提交
14

X
Xu Peng 已提交
15
namespace zilliz {
J
jinhai 已提交
16
namespace milvus {
X
Xu Peng 已提交
17
namespace engine {
X
Xu Peng 已提交
18

19
class Env;
20

J
jinhai 已提交
21 22
static const char* ARCHIVE_CONF_DISK = "disk";
static const char* ARCHIVE_CONF_DAYS = "days";
G
groot 已提交
23

X
Xu Peng 已提交
24 25 26
struct ArchiveConf {
    using CriteriaT = std::map<std::string, int>;

J
jinhai 已提交
27
    ArchiveConf(const std::string& type, const std::string& criterias = std::string());
X
Xu Peng 已提交
28 29 30 31

    const std::string& GetType() const { return type_; }
    const CriteriaT GetCriterias() const { return criterias_; }

G
groot 已提交
32 33
    void SetCriterias(const ArchiveConf::CriteriaT& criterial);

X
Xu Peng 已提交
34 35 36 37 38 39 40 41
private:
    void ParseCritirias(const std::string& type);
    void ParseType(const std::string& criterias);

    std::string type_;
    CriteriaT criterias_;
};

X
Xu Peng 已提交
42 43
struct DBMetaOptions {
    std::string path;
S
starlord 已提交
44
    std::vector<std::string> slave_paths;
X
Xu Peng 已提交
45
    std::string backend_uri;
X
Xu Peng 已提交
46
    ArchiveConf archive_conf = ArchiveConf("delete");
X
Xu Peng 已提交
47 48
}; // DBMetaOptions

X
Xu Peng 已提交
49
struct Options {
Z
update  
zhiru 已提交
50 51 52 53 54 55 56

    typedef enum {
        SINGLE,
        CLUSTER,
        READ_ONLY
    } MODE;

X
Xu Peng 已提交
57
    Options();
S
starlord 已提交
58

59
    uint16_t  merge_trigger_number = 2;
X
Xu Peng 已提交
60
    DBMetaOptions meta;
Z
update  
zhiru 已提交
61
    int mode = MODE::SINGLE;
S
starlord 已提交
62

63
    size_t insert_buffer_size = 4 * ONE_GB;
S
starlord 已提交
64
    bool insert_cache_immediately_ = false;
X
Xu Peng 已提交
65 66
}; // Options

X
Xu Peng 已提交
67

X
Xu Peng 已提交
68
} // namespace engine
J
jinhai 已提交
69
} // namespace milvus
X
Xu Peng 已提交
70
} // namespace zilliz