Options.h 1.3 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 <string>
9
#include <memory>
X
Xu Peng 已提交
10
#include <map>
X
Xu Peng 已提交
11

X
Xu Peng 已提交
12
namespace zilliz {
J
jinhai 已提交
13
namespace milvus {
X
Xu Peng 已提交
14
namespace engine {
X
Xu Peng 已提交
15

16
class Env;
17

X
Xu Peng 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
struct ArchiveConf {
    using CriteriaT = std::map<std::string, int>;

    ArchiveConf(const std::string& type, const std::string& criterias = "disk:512");

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

private:
    void ParseCritirias(const std::string& type);
    void ParseType(const std::string& criterias);

    std::string type_;
    CriteriaT criterias_;
};

X
Xu Peng 已提交
34 35
struct DBMetaOptions {
    std::string path;
X
Xu Peng 已提交
36
    std::string backend_uri;
X
Xu Peng 已提交
37
    ArchiveConf archive_conf = ArchiveConf("delete");
X
Xu Peng 已提交
38 39 40
}; // DBMetaOptions


X
Xu Peng 已提交
41
struct Options {
X
Xu Peng 已提交
42
    Options();
43 44
    uint16_t  memory_sync_interval = 1;
    uint16_t  merge_trigger_number = 2;
45
    size_t  index_trigger_size = 1024*1024*1024;
X
Xu Peng 已提交
46
    Env* env;
X
Xu Peng 已提交
47
    DBMetaOptions meta;
X
Xu Peng 已提交
48 49
}; // Options

X
Xu Peng 已提交
50

X
Xu Peng 已提交
51
} // namespace engine
J
jinhai 已提交
52
} // namespace milvus
X
Xu Peng 已提交
53
} // namespace zilliz