Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
5253ee01
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5253ee01
编写于
10月 09, 2019
作者:
S
starlord
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine code
Former-commit-id: 92557f67f9034c38da747cb75ad4c1fb8278e645
上级
0dc4f2fc
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
18 deletion
+22
-18
cpp/src/core/knowhere/knowhere/adapter/SptagAdapter.cpp
cpp/src/core/knowhere/knowhere/adapter/SptagAdapter.cpp
+1
-1
cpp/src/db/DBImpl.cpp
cpp/src/db/DBImpl.cpp
+2
-1
cpp/src/db/insert/MemTableFile.cpp
cpp/src/db/insert/MemTableFile.cpp
+3
-3
cpp/src/db/meta/MySQLMetaImpl.cpp
cpp/src/db/meta/MySQLMetaImpl.cpp
+12
-9
cpp/src/scheduler/task/SearchTask.cpp
cpp/src/scheduler/task/SearchTask.cpp
+2
-2
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
+2
-2
未找到文件。
cpp/src/core/knowhere/knowhere/adapter/SptagAdapter.cpp
浏览文件 @
5253ee01
...
@@ -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
)
{
...
...
cpp/src/db/DBImpl.cpp
浏览文件 @
5253ee01
...
@@ -296,7 +296,8 @@ DBImpl::CreateIndex(const std::string& table_id, const TableIndex& index) {
...
@@ -296,7 +296,8 @@ 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_MERGE
),
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW
),
static_cast
<
int32_t
>
(
meta
::
TableFileSchema
::
NEW_MERGE
),
};
};
}
else
{
}
else
{
file_types
=
{
file_types
=
{
...
...
cpp/src/db/insert/MemTableFile.cpp
浏览文件 @
5253ee01
...
@@ -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
=
"MemTableFile::Add: table_file_schema dimension = "
+
std
::
string
err_msg
=
std
::
to_string
(
table_file_schema_
.
dimension_
)
+
", table_id = "
+
"MemTableFile::Add: table_file_schema dimension = "
+
std
::
to_string
(
table_file_schema_
.
dimension_
)
+
table_file_schema_
.
table_id_
;
", 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"
);
}
}
...
...
cpp/src/db/meta/MySQLMetaImpl.cpp
浏览文件 @
5253ee01
...
@@ -148,15 +148,18 @@ static const MetaSchema TABLES_SCHEMA(META_TABLES, {
...
@@ -148,15 +148,18 @@ static const MetaSchema TABLES_SCHEMA(META_TABLES, {
});
});
// TableFiles schema
// TableFiles schema
static
const
MetaSchema
TABLEFILES_SCHEMA
(
static
const
MetaSchema
TABLEFILES_SCHEMA
(
META_TABLEFILES
,
{
META_TABLEFILES
,
MetaField
(
"id"
,
"BIGINT"
,
"PRIMARY KEY AUTO_INCREMENT"
),
{
MetaField
(
"table_id"
,
"VARCHAR(255)"
,
"NOT NULL"
),
MetaField
(
"id"
,
"BIGINT"
,
"PRIMARY KEY AUTO_INCREMENT"
),
MetaField
(
"table_id"
,
"VARCHAR(255)"
,
"NOT NULL"
),
MetaField
(
"engine_type"
,
"INT"
,
"DEFAULT 1 NOT NULL"
),
MetaField
(
"engine_type"
,
"INT"
,
"DEFAULT 1 NOT NULL"
),
MetaField
(
"file_id"
,
"VARCHAR(255)"
,
"NOT NULL"
),
MetaField
(
"file_id"
,
"VARCHAR(255)"
,
"NOT NULL"
),
MetaField
(
"file_type"
,
"INT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"file_size"
,
"BIGINT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"file_type"
,
"INT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"row_count"
,
"BIGINT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"updated_time"
,
"BIGINT"
,
"NOT NULL"
),
MetaField
(
"file_size"
,
"BIGINT"
,
"DEFAULT 0 NOT NULL"
),
MetaField
(
"created_on"
,
"BIGINT"
,
"NOT NULL"
),
MetaField
(
"date"
,
"INT"
,
"DEFAULT -1 NOT NULL"
),
MetaField
(
"row_count"
,
"BIGINT"
,
"DEFAULT 0 NOT NULL"
),
});
MetaField
(
"updated_time"
,
"BIGINT"
,
"NOT NULL"
),
MetaField
(
"created_on"
,
"BIGINT"
,
"NOT NULL"
),
MetaField
(
"date"
,
"INT"
,
"DEFAULT -1 NOT NULL"
),
});
}
// namespace
}
// namespace
...
...
cpp/src/scheduler/task/SearchTask.cpp
浏览文件 @
5253ee01
...
@@ -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_
)
+
" file type:"
+
std
::
string
info
=
"Load file id:"
+
std
::
to_string
(
file_
->
id_
)
+
std
::
to_string
(
file_
->
file_type_
)
+
" size:"
+
std
::
to_string
(
file_size
)
+
" file type:"
+
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_) {
...
...
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
浏览文件 @
5253ee01
...
@@ -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
:
table_info
.
flag_
|=
user_provide_ids
?
table_info
.
flag_
|=
engine
::
meta
::
FLAG_MASK_HAS_USERID
engine
::
meta
::
FLAG_MASK_NO_USERID
;
:
table_info
.
flag_
|=
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录