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

G
refine  
groot 已提交
18 19 20 21
static constexpr uint64_t ONE_KB = 1024;
static constexpr uint64_t ONE_MB = ONE_KB*ONE_KB;
static constexpr uint64_t ONE_GB = ONE_KB*ONE_MB;

X
Xu Peng 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
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 已提交
38 39
struct DBMetaOptions {
    std::string path;
X
Xu Peng 已提交
40
    std::string backend_uri;
X
Xu Peng 已提交
41
    ArchiveConf archive_conf = ArchiveConf("delete");
X
Xu Peng 已提交
42 43 44
}; // DBMetaOptions


X
Xu Peng 已提交
45
struct Options {
X
Xu Peng 已提交
46
    Options();
G
groot 已提交
47
    uint16_t  memory_sync_interval = 1;             //unit: second
48
    uint16_t  merge_trigger_number = 2;
G
refine  
groot 已提交
49
    size_t  index_trigger_size = ONE_GB;            //unit: byte
X
Xu Peng 已提交
50
    DBMetaOptions meta;
X
Xu Peng 已提交
51 52
}; // Options

X
Xu Peng 已提交
53

X
Xu Peng 已提交
54
} // namespace engine
J
jinhai 已提交
55
} // namespace milvus
X
Xu Peng 已提交
56
} // namespace zilliz