mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-30 15:35:33 +08:00
74 lines
1.9 KiB
C++
74 lines
1.9 KiB
C++
/*******************************************************************************
|
|
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
|
|
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
|
* Proprietary and confidential.
|
|
******************************************************************************/
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <memory>
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
namespace zilliz {
|
|
namespace milvus {
|
|
namespace engine {
|
|
|
|
class Env;
|
|
|
|
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;
|
|
|
|
static const char* ARCHIVE_CONF_DISK = "disk";
|
|
static const char* ARCHIVE_CONF_DAYS = "days";
|
|
|
|
struct ArchiveConf {
|
|
using CriteriaT = std::map<std::string, int>;
|
|
|
|
ArchiveConf(const std::string& type, const std::string& criterias = std::string());
|
|
|
|
const std::string& GetType() const { return type_; }
|
|
const CriteriaT GetCriterias() const { return criterias_; }
|
|
|
|
void SetCriterias(const ArchiveConf::CriteriaT& criterial);
|
|
|
|
private:
|
|
void ParseCritirias(const std::string& type);
|
|
void ParseType(const std::string& criterias);
|
|
|
|
std::string type_;
|
|
CriteriaT criterias_;
|
|
};
|
|
|
|
struct DBMetaOptions {
|
|
std::string path;
|
|
std::vector<std::string> slave_paths;
|
|
std::string backend_uri;
|
|
ArchiveConf archive_conf = ArchiveConf("delete");
|
|
}; // DBMetaOptions
|
|
|
|
struct Options {
|
|
|
|
typedef enum {
|
|
SINGLE,
|
|
CLUSTER,
|
|
READ_ONLY
|
|
} MODE;
|
|
|
|
Options();
|
|
uint16_t memory_sync_interval = 1; //unit: second
|
|
uint16_t merge_trigger_number = 2;
|
|
size_t index_trigger_size = ONE_GB; //unit: byte
|
|
DBMetaOptions meta;
|
|
int mode = MODE::SINGLE;
|
|
|
|
size_t insert_buffer_size = 4 * ONE_GB;
|
|
bool insert_cache_immediately_ = false;
|
|
}; // Options
|
|
|
|
|
|
} // namespace engine
|
|
} // namespace milvus
|
|
} // namespace zilliz
|