提交 fba79974 编写于 作者: J jinhai

Merge branch 'branch-0.5.0' into 'branch-0.5.0'

refine code

See merge request megasearch/milvus!670

Former-commit-id: 157b2bede3114799229d330109879924784a5a51
...@@ -76,7 +76,7 @@ ConvertToDataset(std::vector<SPTAG::QueryResult> query_results) { ...@@ -76,7 +76,7 @@ ConvertToDataset(std::vector<SPTAG::QueryResult> query_results) {
auto p_id = (int64_t*)malloc(sizeof(int64_t) * elems); auto p_id = (int64_t*)malloc(sizeof(int64_t) * elems);
auto p_dist = (float*)malloc(sizeof(float) * elems); auto p_dist = (float*)malloc(sizeof(float) * elems);
// TODO: throw if malloc failed. // TODO: throw if malloc failed.
#pragma omp parallel for #pragma omp parallel for
for (auto i = 0; i < query_results.size(); ++i) { for (auto i = 0; i < query_results.size(); ++i) {
......
...@@ -296,8 +296,7 @@ DBImpl::CreateIndex(const std::string& table_id, const TableIndex& index) { ...@@ -296,8 +296,7 @@ DBImpl::CreateIndex(const std::string& table_id, const TableIndex& index) {
std::vector<int> file_types; std::vector<int> file_types;
if (index.engine_type_ == static_cast<int32_t>(EngineType::FAISS_IDMAP)) { if (index.engine_type_ == static_cast<int32_t>(EngineType::FAISS_IDMAP)) {
file_types = { file_types = {
static_cast<int32_t>(meta::TableFileSchema::NEW), static_cast<int32_t>(meta::TableFileSchema::NEW), static_cast<int32_t>(meta::TableFileSchema::NEW_MERGE),
static_cast<int32_t>(meta::TableFileSchema::NEW_MERGE),
}; };
} else { } else {
file_types = { file_types = {
......
...@@ -55,9 +55,9 @@ MemTableFile::CreateTableFile() { ...@@ -55,9 +55,9 @@ MemTableFile::CreateTableFile() {
Status Status
MemTableFile::Add(const VectorSourcePtr& source, IDNumbers& vector_ids) { MemTableFile::Add(const VectorSourcePtr& source, IDNumbers& vector_ids) {
if (table_file_schema_.dimension_ <= 0) { if (table_file_schema_.dimension_ <= 0) {
std::string err_msg = std::string err_msg = "MemTableFile::Add: table_file_schema dimension = " +
"MemTableFile::Add: table_file_schema dimension = " + std::to_string(table_file_schema_.dimension_) + std::to_string(table_file_schema_.dimension_) + ", table_id = " +
", table_id = " + table_file_schema_.table_id_; table_file_schema_.table_id_;
ENGINE_LOG_ERROR << err_msg; ENGINE_LOG_ERROR << err_msg;
return Status(DB_ERROR, "Not able to create table file"); return Status(DB_ERROR, "Not able to create table file");
} }
......
...@@ -148,17 +148,14 @@ static const MetaSchema TABLES_SCHEMA(META_TABLES, { ...@@ -148,17 +148,14 @@ static const MetaSchema TABLES_SCHEMA(META_TABLES, {
}); });
// TableFiles schema // TableFiles schema
static const MetaSchema TABLEFILES_SCHEMA(META_TABLEFILES, { static const MetaSchema TABLEFILES_SCHEMA(
MetaField("id", "BIGINT", "PRIMARY KEY AUTO_INCREMENT"), META_TABLEFILES,
MetaField("table_id", "VARCHAR(255)", "NOT NULL"), {
MetaField("engine_type", "INT", "DEFAULT 1 NOT NULL"), MetaField("id", "BIGINT", "PRIMARY KEY AUTO_INCREMENT"), MetaField("table_id", "VARCHAR(255)", "NOT NULL"),
MetaField("file_id", "VARCHAR(255)", "NOT NULL"), MetaField("engine_type", "INT", "DEFAULT 1 NOT NULL"), MetaField("file_id", "VARCHAR(255)", "NOT NULL"),
MetaField("file_type", "INT", "DEFAULT 0 NOT NULL"), MetaField("file_type", "INT", "DEFAULT 0 NOT NULL"), MetaField("file_size", "BIGINT", "DEFAULT 0 NOT NULL"),
MetaField("file_size", "BIGINT", "DEFAULT 0 NOT NULL"), MetaField("row_count", "BIGINT", "DEFAULT 0 NOT NULL"), MetaField("updated_time", "BIGINT", "NOT NULL"),
MetaField("row_count", "BIGINT", "DEFAULT 0 NOT NULL"), MetaField("created_on", "BIGINT", "NOT NULL"), MetaField("date", "INT", "DEFAULT -1 NOT NULL"),
MetaField("updated_time", "BIGINT", "NOT NULL"),
MetaField("created_on", "BIGINT", "NOT NULL"),
MetaField("date", "INT", "DEFAULT -1 NOT NULL"),
}); });
} // namespace } // namespace
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// specific language governing permissions and limitations // specific language governing permissions and limitations
// under the License. // under the License.
#include "cpp/src/scheduler/optimizer/HybridPass.h" #include "scheduler/optimizer/HybridPass.h"
#include "scheduler/task/SearchTask.h" #include "scheduler/task/SearchTask.h"
namespace milvus { namespace milvus {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// specific language governing permissions and limitations // specific language governing permissions and limitations
// under the License. // under the License.
#include "cpp/src/scheduler/optimizer/Optimizer.h" #include "scheduler/optimizer/Optimizer.h"
namespace milvus { namespace milvus {
namespace scheduler { namespace scheduler {
......
...@@ -157,8 +157,8 @@ XSearchTask::Load(LoadType type, uint8_t device_id) { ...@@ -157,8 +157,8 @@ XSearchTask::Load(LoadType type, uint8_t device_id) {
size_t file_size = index_engine_->PhysicalSize(); size_t file_size = index_engine_->PhysicalSize();
std::string info = "Load file id:" + std::to_string(file_->id_) + std::string info = "Load file id:" + std::to_string(file_->id_) + " file type:" +
" file type:" + std::to_string(file_->file_type_) + " size:" + std::to_string(file_size) + std::to_string(file_->file_type_) + " size:" + std::to_string(file_size) +
" bytes from location: " + file_->location_ + " totally cost"; " bytes from location: " + file_->location_ + " totally cost";
double span = rc.ElapseFromBegin(info); double span = rc.ElapseFromBegin(info);
// for (auto &context : search_contexts_) { // for (auto &context : search_contexts_) {
......
...@@ -511,8 +511,8 @@ InsertTask::OnExecute() { ...@@ -511,8 +511,8 @@ InsertTask::OnExecute() {
} }
// step 6: update table flag // step 6: update table flag
user_provide_ids ? table_info.flag_ |= engine::meta::FLAG_MASK_HAS_USERID user_provide_ids ? table_info.flag_ |= engine::meta::FLAG_MASK_HAS_USERID : table_info.flag_ |=
: table_info.flag_ |= engine::meta::FLAG_MASK_NO_USERID; engine::meta::FLAG_MASK_NO_USERID;
status = DBWrapper::DB()->UpdateTableFlag(insert_param_->table_name(), table_info.flag_); status = DBWrapper::DB()->UpdateTableFlag(insert_param_->table_name(), table_info.flag_);
#ifdef MILVUS_ENABLE_PROFILING #ifdef MILVUS_ENABLE_PROFILING
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册