提交 c2cfc98b 编写于 作者: X Xu Peng 提交者: xj.lin

refactor(db): refactor options


Former-commit-id: 53812504248a4a81f2f65ee07e81ad2d5e31eb38
上级 53270e4b
...@@ -19,7 +19,7 @@ DBImpl::DBImpl(const Options& options_, const std::string& name_) ...@@ -19,7 +19,7 @@ DBImpl::DBImpl(const Options& options_, const std::string& name_)
_options(options_), _options(options_),
_bg_compaction_scheduled(false), _bg_compaction_scheduled(false),
_shutting_down(false), _shutting_down(false),
_pMeta(new meta::DBMetaImpl(*(_options.pMetaOptions))), _pMeta(new meta::DBMetaImpl(_options.meta)),
_pMemMgr(new MemManager(_pMeta)) { _pMemMgr(new MemManager(_pMeta)) {
start_timer_task(options_.memory_sync_interval); start_timer_task(options_.memory_sync_interval);
} }
......
...@@ -45,7 +45,7 @@ private: ...@@ -45,7 +45,7 @@ private:
Status initialize(); Status initialize();
const DBMetaOptions& _options; const DBMetaOptions _options;
}; // DBMetaImpl }; // DBMetaImpl
......
#include "Options.h" #include "Options.h"
#include "Env.h" #include "Env.h"
#include "DBMetaImpl.h"
namespace zilliz { namespace zilliz {
namespace vecwise { namespace vecwise {
......
...@@ -7,16 +7,25 @@ namespace zilliz { ...@@ -7,16 +7,25 @@ namespace zilliz {
namespace vecwise { namespace vecwise {
namespace engine { namespace engine {
class MetaOptions;
class Env; class Env;
struct MetaOptions {
}; // MetaOptions
struct DBMetaOptions : public MetaOptions {
std::string backend_uri;
std::string dbname;
}; // DBMetaOptions
struct Options { struct Options {
Options(); Options();
uint16_t memory_sync_interval = 10; uint16_t memory_sync_interval = 10;
uint16_t raw_file_merge_trigger_number = 100; uint16_t raw_file_merge_trigger_number = 100;
size_t raw_to_index_trigger_size = 100000; size_t raw_to_index_trigger_size = 100000;
std::shared_ptr<MetaOptions> pMetaOptions;
Env* env; Env* env;
DBMetaOptions meta;
}; // Options }; // Options
...@@ -26,16 +35,6 @@ struct GroupOptions { ...@@ -26,16 +35,6 @@ struct GroupOptions {
}; // GroupOptions }; // GroupOptions
struct MetaOptions {
}; // MetaOptions
struct DBMetaOptions : public MetaOptions {
std::string backend_uri;
std::string dbname;
}; // DBMetaOptions
} // namespace engine } // namespace engine
} // namespace vecwise } // namespace vecwise
} // namespace zilliz } // namespace zilliz
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册