Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
cd80cdba
M
milvus
项目概览
milvus
/
milvus
12 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cd80cdba
编写于
11月 16, 2019
作者:
F
fishpenguin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sdk_simple return empty result
上级
0aa90ea9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
47 addition
and
34 deletion
+47
-34
CHANGELOG.md
CHANGELOG.md
+1
-0
core/src/grpc/gen-milvus/milvus.pb.h
core/src/grpc/gen-milvus/milvus.pb.h
+41
-16
core/src/sdk/grpc/ClientProxy.cpp
core/src/sdk/grpc/ClientProxy.cpp
+3
-13
core/src/server/grpc_impl/GrpcRequestTask.cpp
core/src/server/grpc_impl/GrpcRequestTask.cpp
+2
-5
未找到文件。
CHANGELOG.md
浏览文件 @
cd80cdba
...
...
@@ -10,6 +10,7 @@ Please mark all change in change log and use the ticket from JIRA.
-
\#
316 - Some files not merged after vectors added
-
\#
327 - Search does not use GPU when index type is FLAT
-
\#
340 - Test cases run failed on 0.6.0
-
\#
374 - sdk_simple return empty result
## Feature
-
\#
12 - Pure CPU version for Milvus
...
...
core/src/grpc/gen-milvus/milvus.pb.h
浏览文件 @
cd80cdba
...
...
@@ -1321,7 +1321,8 @@ class RowRecord :
void
clear_vector_data
();
float
vector_data
(
int
index
)
const
;
void
set_vector_data
(
int
index
,
float
value
);
void
add_vector_data
(
float
value
);
// void add_vector_data(float value);
void
add_vector_data
(
std
::
vector
<
float
>::
const_iterator
begin
,
std
::
vector
<
float
>::
const_iterator
end
);
const
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
float
>&
vector_data
()
const
;
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
float
>*
...
...
@@ -1473,7 +1474,9 @@ class InsertParam :
void
clear_row_id_array
();
::
PROTOBUF_NAMESPACE_ID
::
int64
row_id_array
(
int
index
)
const
;
void
set_row_id_array
(
int
index
,
::
PROTOBUF_NAMESPACE_ID
::
int64
value
);
void
add_row_id_array
(
::
PROTOBUF_NAMESPACE_ID
::
int64
value
);
// void add_row_id_array(::PROTOBUF_NAMESPACE_ID::int64 value);
void
add_row_id_array
(
std
::
vector
<::
PROTOBUF_NAMESPACE_ID
::
int64
>::
const_iterator
begin
,
std
::
vector
<::
PROTOBUF_NAMESPACE_ID
::
int64
>::
const_iterator
end
);
const
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
::
PROTOBUF_NAMESPACE_ID
::
int64
>&
row_id_array
()
const
;
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
::
PROTOBUF_NAMESPACE_ID
::
int64
>*
...
...
@@ -2136,7 +2139,9 @@ class TopKQueryResult :
void
clear_ids
();
::
PROTOBUF_NAMESPACE_ID
::
int64
ids
(
int
index
)
const
;
void
set_ids
(
int
index
,
::
PROTOBUF_NAMESPACE_ID
::
int64
value
);
void
add_ids
(
::
PROTOBUF_NAMESPACE_ID
::
int64
value
);
// void add_ids(::PROTOBUF_NAMESPACE_ID::int64 value);
void
add_ids
(
std
::
vector
<::
PROTOBUF_NAMESPACE_ID
::
int64
>::
const_iterator
begin
,
std
::
vector
<::
PROTOBUF_NAMESPACE_ID
::
int64
>::
const_iterator
end
);
const
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
::
PROTOBUF_NAMESPACE_ID
::
int64
>&
ids
()
const
;
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
::
PROTOBUF_NAMESPACE_ID
::
int64
>*
...
...
@@ -2147,7 +2152,8 @@ class TopKQueryResult :
void
clear_distances
();
float
distances
(
int
index
)
const
;
void
set_distances
(
int
index
,
float
value
);
void
add_distances
(
float
value
);
// void add_distances(float value);
void
add_distances
(
std
::
vector
<
float
>::
const_iterator
begin
,
std
::
vector
<
float
>::
const_iterator
end
);
const
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
float
>&
distances
()
const
;
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
float
>*
...
...
@@ -3922,9 +3928,14 @@ inline void RowRecord::set_vector_data(int index, float value) {
vector_data_
.
Set
(
index
,
value
);
// @@protoc_insertion_point(field_set:milvus.grpc.RowRecord.vector_data)
}
inline
void
RowRecord
::
add_vector_data
(
float
value
)
{
vector_data_
.
Add
(
value
);
// @@protoc_insertion_point(field_add:milvus.grpc.RowRecord.vector_data)
//inline void RowRecord::add_vector_data(float value) {
// vector_data_.Add(value);
// // @@protoc_insertion_point(field_add:milvus.grpc.RowRecord.vector_data)
//}
inline
void
RowRecord
::
add_vector_data
(
std
::
vector
<
float
>::
const_iterator
begin
,
std
::
vector
<
float
>::
const_iterator
end
)
{
vector_data_
.
Add
(
begin
,
end
);
// @@protoc_insertion_point(field_add:milvus.grpc.RowRecord.vector_data)
}
inline
const
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
float
>&
RowRecord
::
vector_data
()
const
{
...
...
@@ -4037,9 +4048,14 @@ inline void InsertParam::set_row_id_array(int index, ::PROTOBUF_NAMESPACE_ID::in
row_id_array_
.
Set
(
index
,
value
);
// @@protoc_insertion_point(field_set:milvus.grpc.InsertParam.row_id_array)
}
inline
void
InsertParam
::
add_row_id_array
(
::
PROTOBUF_NAMESPACE_ID
::
int64
value
)
{
row_id_array_
.
Add
(
value
);
// @@protoc_insertion_point(field_add:milvus.grpc.InsertParam.row_id_array)
//inline void InsertParam::add_row_id_array(::PROTOBUF_NAMESPACE_ID::int64 value) {
// row_id_array_.Add(value);
// // @@protoc_insertion_point(field_add:milvus.grpc.InsertParam.row_id_array)
//}
inline
void
InsertParam
::
add_row_id_array
(
std
::
vector
<::
PROTOBUF_NAMESPACE_ID
::
int64
>::
const_iterator
begin
,
std
::
vector
<::
PROTOBUF_NAMESPACE_ID
::
int64
>::
const_iterator
end
)
{
row_id_array_
.
Add
(
begin
,
end
);
// @@protoc_insertion_point(field_add:milvus.grpc.InsertParam.row_id_array)
}
inline
const
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
::
PROTOBUF_NAMESPACE_ID
::
int64
>&
InsertParam
::
row_id_array
()
const
{
...
...
@@ -4588,9 +4604,14 @@ inline void TopKQueryResult::set_ids(int index, ::PROTOBUF_NAMESPACE_ID::int64 v
ids_
.
Set
(
index
,
value
);
// @@protoc_insertion_point(field_set:milvus.grpc.TopKQueryResult.ids)
}
inline
void
TopKQueryResult
::
add_ids
(
::
PROTOBUF_NAMESPACE_ID
::
int64
value
)
{
ids_
.
Add
(
value
);
// @@protoc_insertion_point(field_add:milvus.grpc.TopKQueryResult.ids)
//inline void TopKQueryResult::add_ids(::PROTOBUF_NAMESPACE_ID::int64 value) {
// ids_.Add(value);
// // @@protoc_insertion_point(field_add:milvus.grpc.TopKQueryResult.ids)
//}
inline
void
TopKQueryResult
::
add_ids
(
std
::
vector
<::
PROTOBUF_NAMESPACE_ID
::
int64
>::
const_iterator
begin
,
std
::
vector
<::
PROTOBUF_NAMESPACE_ID
::
int64
>::
const_iterator
end
)
{
ids_
.
Add
(
begin
,
end
);
// @@protoc_insertion_point(field_add:milvus.grpc.TopKQueryResult.ids)
}
inline
const
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
::
PROTOBUF_NAMESPACE_ID
::
int64
>&
TopKQueryResult
::
ids
()
const
{
...
...
@@ -4618,9 +4639,13 @@ inline void TopKQueryResult::set_distances(int index, float value) {
distances_
.
Set
(
index
,
value
);
// @@protoc_insertion_point(field_set:milvus.grpc.TopKQueryResult.distances)
}
inline
void
TopKQueryResult
::
add_distances
(
float
value
)
{
distances_
.
Add
(
value
);
// @@protoc_insertion_point(field_add:milvus.grpc.TopKQueryResult.distances)
//inline void TopKQueryResult::add_distances(float value) {
// distances_.Add(value);
// // @@protoc_insertion_point(field_add:milvus.grpc.TopKQueryResult.distances)
//}
inline
void
TopKQueryResult
::
add_distances
(
std
::
vector
<
float
>::
const_iterator
begin
,
std
::
vector
<
float
>::
const_iterator
end
)
{
distances_
.
Add
(
begin
,
end
);
// @@protoc_insertion_point(field_add:milvus.grpc.TopKQueryResult.distances)
}
inline
const
::
PROTOBUF_NAMESPACE_ID
::
RepeatedField
<
float
>&
TopKQueryResult
::
distances
()
const
{
...
...
core/src/sdk/grpc/ClientProxy.cpp
浏览文件 @
cd80cdba
...
...
@@ -32,13 +32,6 @@ UriCheck(const std::string& uri) {
return
(
index
!=
std
::
string
::
npos
);
}
void
CopyRowRecord
(
::
milvus
::
grpc
::
RowRecord
*
target
,
const
RowRecord
&
src
)
{
auto
vector_data
=
target
->
mutable_vector_data
();
vector_data
->
Resize
(
static_cast
<
int
>
(
src
.
data
.
size
()),
0.0
);
memcpy
(
vector_data
->
mutable_data
(),
src
.
data
.
data
(),
src
.
data
.
size
()
*
sizeof
(
float
));
}
Status
ClientProxy
::
Connect
(
const
ConnectParam
&
param
)
{
std
::
string
uri
=
param
.
ip_address
+
":"
+
param
.
port
;
...
...
@@ -196,17 +189,14 @@ ClientProxy::Insert(const std::string& table_name, const std::string& partition_
for
(
auto
&
record
:
record_array
)
{
::
milvus
::
grpc
::
RowRecord
*
grpc_record
=
insert_param
.
add_row_record_array
();
CopyRowRecord
(
grpc_record
,
record
);
grpc_record
->
add_vector_data
(
record
.
data
.
begin
(),
record
.
data
.
end
()
);
}
// Single thread
::
milvus
::
grpc
::
VectorIds
vector_ids
;
if
(
!
id_array
.
empty
())
{
/* set user's ids */
auto
row_ids
=
insert_param
.
mutable_row_id_array
();
row_ids
->
Reserve
(
static_cast
<
int
>
(
id_array
.
size
()));
memcpy
(
row_ids
->
mutable_data
(),
id_array
.
data
(),
id_array
.
size
()
*
sizeof
(
int64_t
));
insert_param
.
add_row_id_array
(
id_array
.
begin
(),
id_array
.
end
());
client_ptr_
->
Insert
(
vector_ids
,
insert_param
,
status
);
}
else
{
client_ptr_
->
Insert
(
vector_ids
,
insert_param
,
status
);
...
...
@@ -236,7 +226,7 @@ ClientProxy::Search(const std::string& table_name, const std::vector<std::string
}
for
(
auto
&
record
:
query_record_array
)
{
::
milvus
::
grpc
::
RowRecord
*
row_record
=
search_param
.
add_query_record_array
();
CopyRowRecord
(
row_record
,
record
);
row_record
->
add_vector_data
(
record
.
data
.
begin
(),
record
.
data
.
end
()
);
}
// step 2: convert range array
...
...
core/src/server/grpc_impl/GrpcRequestTask.cpp
浏览文件 @
cd80cdba
...
...
@@ -682,11 +682,8 @@ SearchTask::OnExecute() {
// step 7: construct result array
topk_result_
->
set_row_num
(
record_count
);
topk_result_
->
mutable_ids
()
->
Resize
(
static_cast
<
int
>
(
result_ids
.
size
()),
0
);
memcpy
(
topk_result_
->
mutable_ids
()
->
mutable_data
(),
result_ids
.
data
(),
result_ids
.
size
()
*
sizeof
(
int64_t
));
topk_result_
->
mutable_distances
()
->
Resize
(
static_cast
<
int
>
(
result_distances
.
size
()),
0.0
);
memcpy
(
topk_result_
->
mutable_distances
()
->
mutable_data
(),
result_distances
.
data
(),
result_distances
.
size
()
*
sizeof
(
float
));
topk_result_
->
add_ids
(
result_ids
.
begin
(),
result_ids
.
end
());
topk_result_
->
add_distances
(
result_distances
.
begin
(),
result_distances
.
end
());
// step 8: print time cost percent
rc
.
RecordSection
(
"construct result and send"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录