refactor(db): refactor options

Former-commit-id: 2631c7298346b6dcfbde0d43bc58f36e36eef807
pull/191/head
Xu Peng 2019-04-16 18:05:04 +08:00
parent a5f318d33e
commit 062e370bee
4 changed files with 19 additions and 19 deletions

View File

@ -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);
} }

View File

@ -45,7 +45,7 @@ private:
Status initialize(); Status initialize();
const DBMetaOptions& _options; const DBMetaOptions _options;
}; // DBMetaImpl }; // DBMetaImpl

View File

@ -1,5 +1,6 @@
#include "Options.h" #include "Options.h"
#include "Env.h" #include "Env.h"
#include "DBMetaImpl.h"
namespace zilliz { namespace zilliz {
namespace vecwise { namespace vecwise {

View File

@ -7,25 +7,8 @@ namespace zilliz {
namespace vecwise { namespace vecwise {
namespace engine { namespace engine {
class MetaOptions;
class Env; class Env;
struct Options {
Options();
uint16_t memory_sync_interval = 10;
uint16_t raw_file_merge_trigger_number = 100;
size_t raw_to_index_trigger_size = 100000;
std::shared_ptr<MetaOptions> pMetaOptions;
Env* env;
}; // Options
struct GroupOptions {
size_t dimension;
bool has_id = false;
}; // GroupOptions
struct MetaOptions { struct MetaOptions {
}; // MetaOptions }; // MetaOptions
@ -36,6 +19,22 @@ struct DBMetaOptions : public MetaOptions {
}; // DBMetaOptions }; // DBMetaOptions
struct Options {
Options();
uint16_t memory_sync_interval = 10;
uint16_t raw_file_merge_trigger_number = 100;
size_t raw_to_index_trigger_size = 100000;
Env* env;
DBMetaOptions meta;
}; // Options
struct GroupOptions {
size_t dimension;
bool has_id = false;
}; // GroupOptions
} // namespace engine } // namespace engine
} // namespace vecwise } // namespace vecwise
} // namespace zilliz } // namespace zilliz