mirror of https://github.com/milvus-io/milvus.git
parent
97296aca7a
commit
bc182c8cc3
|
@ -13,6 +13,7 @@
|
|||
#include "scheduler/context/SearchContext.h"
|
||||
#include "scheduler/context/DeleteContext.h"
|
||||
#include "utils/TimeRecorder.h"
|
||||
#include "MetaConsts.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <chrono>
|
||||
|
@ -595,7 +596,12 @@ void DBImpl::BackgroundCompaction(std::set<std::string> table_ids) {
|
|||
}
|
||||
|
||||
meta_ptr_->Archive();
|
||||
meta_ptr_->CleanUpFilesWithTTL(1);
|
||||
|
||||
int ttl = 1;
|
||||
if (options_.mode == "cluster") {
|
||||
ttl = meta::D_SEC;
|
||||
}
|
||||
meta_ptr_->CleanUpFilesWithTTL(ttl);
|
||||
}
|
||||
|
||||
void DBImpl::StartBuildIndexTask() {
|
||||
|
|
|
@ -81,9 +81,11 @@ std::shared_ptr<meta::Meta> DBMetaImplFactory::Build(const DBMetaOptions& metaOp
|
|||
std::string dialect = pieces_match[1].str();
|
||||
std::transform(dialect.begin(), dialect.end(), dialect.begin(), ::tolower);
|
||||
if (dialect.find("mysql") != std::string::npos) {
|
||||
ENGINE_LOG_DEBUG << "Using MySQL";
|
||||
return std::make_shared<meta::MySQLMetaImpl>(meta::MySQLMetaImpl(metaOptions));
|
||||
}
|
||||
else if (dialect.find("sqlite") != std::string::npos) {
|
||||
ENGINE_LOG_DEBUG << "Using SQLite";
|
||||
return std::make_shared<meta::DBMetaImpl>(meta::DBMetaImpl(metaOptions));
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -47,6 +47,7 @@ struct Options {
|
|||
uint16_t merge_trigger_number = 2;
|
||||
size_t index_trigger_size = ONE_GB; //unit: byte
|
||||
DBMetaOptions meta;
|
||||
std::string mode;
|
||||
}; // Options
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ DBWrapper::DBWrapper() {
|
|||
if(index_size > 0) {//ensure larger than zero, unit is MB
|
||||
opt.index_trigger_size = (size_t)index_size * engine::ONE_MB;
|
||||
}
|
||||
opt.mode = config.GetValue(CONFIG_CLUSTER_MODE, "single");
|
||||
|
||||
CommonUtil::CreateDirectory(opt.meta.path);
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ static const std::string CONFIG_SERVER_ADDRESS = "address";
|
|||
static const std::string CONFIG_SERVER_PORT = "port";
|
||||
static const std::string CONFIG_SERVER_PROTOCOL = "transfer_protocol";
|
||||
static const std::string CONFIG_SERVER_MODE = "server_mode";
|
||||
static const std::string CONFIG_CLUSTER_MODE = "mode";
|
||||
|
||||
static const std::string CONFIG_DB = "db_config";
|
||||
static const std::string CONFIG_DB_URL = "db_backend_url";
|
||||
|
|
Loading…
Reference in New Issue