Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
38155283
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,发现更多精彩内容 >>
提交
38155283
编写于
4月 24, 2019
作者:
G
groot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify thrift api
Former-commit-id: 9516c969a09e06c073e02b1186503776df2f370a
上级
d402dd9d
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
164 addition
and
71 deletion
+164
-71
cpp/src/server/VecServiceHandler.cpp
cpp/src/server/VecServiceHandler.cpp
+2
-0
cpp/src/server/VecServiceScheduler.cpp
cpp/src/server/VecServiceScheduler.cpp
+22
-0
cpp/src/server/VecServiceScheduler.h
cpp/src/server/VecServiceScheduler.h
+22
-0
cpp/src/thrift/VectorService.thrift
cpp/src/thrift/VectorService.thrift
+1
-0
cpp/src/thrift/gen-cpp/VectorService_types.cpp
cpp/src/thrift/gen-cpp/VectorService_types.cpp
+110
-70
cpp/src/thrift/gen-cpp/VectorService_types.h
cpp/src/thrift/gen-cpp/VectorService_types.h
+7
-1
未找到文件。
cpp/src/server/VecServiceHandler.cpp
浏览文件 @
38155283
...
...
@@ -172,6 +172,7 @@ VecServiceHandler::search_vector(VecSearchResult &_return,
std
::
string
nid
=
nid_prefix
+
std
::
to_string
(
id
);
IVecIdMapper
::
GetInstance
()
->
Get
(
nid
,
sid
);
_return
.
id_list
.
push_back
(
sid
);
_return
.
distance_list
.
push_back
(
0.0
);
//TODO: return distance
}
}
}
...
...
@@ -212,6 +213,7 @@ VecServiceHandler::search_vector_batch(VecSearchResultList &_return,
std
::
string
nid
=
nid_prefix
+
std
::
to_string
(
id
);
IVecIdMapper
::
GetInstance
()
->
Get
(
nid
,
sid
);
v_res
.
id_list
.
push_back
(
sid
);
v_res
.
distance_list
.
push_back
(
0.0
);
//TODO: return distance
}
_return
.
result_list
.
push_back
(
v_res
);
...
...
cpp/src/server/VecServiceScheduler.cpp
0 → 100644
浏览文件 @
38155283
/*******************************************************************************
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Proprietary and confidential.
******************************************************************************/
#include "VecServiceScheduler.h"
namespace
zilliz
{
namespace
vecwise
{
namespace
server
{
VecServiceScheduler
::
VecServiceScheduler
()
{
}
VecServiceScheduler
::~
VecServiceScheduler
()
{
}
}
}
}
cpp/src/server/VecServiceScheduler.h
0 → 100644
浏览文件 @
38155283
/*******************************************************************************
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Proprietary and confidential.
******************************************************************************/
#pragma once
namespace
zilliz
{
namespace
vecwise
{
namespace
server
{
class
VecServiceScheduler
{
public:
VecServiceScheduler
();
virtual
~
VecServiceScheduler
();
};
}
}
}
cpp/src/thrift/VectorService.thrift
浏览文件 @
38155283
...
...
@@ -35,6 +35,7 @@ struct VecTensorList {
struct VecSearchResult {
1: list<string> id_list;
2: list<double> distance_list;
}
struct VecSearchResultList {
...
...
cpp/src/thrift/gen-cpp/VectorService_types.cpp
浏览文件 @
38155283
...
...
@@ -550,6 +550,10 @@ VecSearchResult::~VecSearchResult() throw() {
void
VecSearchResult
::
__set_id_list
(
const
std
::
vector
<
std
::
string
>
&
val
)
{
this
->
id_list
=
val
;
}
void
VecSearchResult
::
__set_distance_list
(
const
std
::
vector
<
double
>
&
val
)
{
this
->
distance_list
=
val
;
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
VecSearchResult
&
obj
)
{
obj
.
printTo
(
out
);
...
...
@@ -598,6 +602,26 @@ uint32_t VecSearchResult::read(::apache::thrift::protocol::TProtocol* iprot) {
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
case
2
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
distance_list
.
clear
();
uint32_t
_size26
;
::
apache
::
thrift
::
protocol
::
TType
_etype29
;
xfer
+=
iprot
->
readListBegin
(
_etype29
,
_size26
);
this
->
distance_list
.
resize
(
_size26
);
uint32_t
_i30
;
for
(
_i30
=
0
;
_i30
<
_size26
;
++
_i30
)
{
xfer
+=
iprot
->
readDouble
(
this
->
distance_list
[
_i30
]);
}
xfer
+=
iprot
->
readListEnd
();
}
this
->
__isset
.
distance_list
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
default:
xfer
+=
iprot
->
skip
(
ftype
);
break
;
...
...
@@ -618,10 +642,22 @@ uint32_t VecSearchResult::write(::apache::thrift::protocol::TProtocol* oprot) co
xfer
+=
oprot
->
writeFieldBegin
(
"id_list"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
1
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRING
,
static_cast
<
uint32_t
>
(
this
->
id_list
.
size
()));
std
::
vector
<
std
::
string
>
::
const_iterator
_iter26
;
for
(
_iter26
=
this
->
id_list
.
begin
();
_iter26
!=
this
->
id_list
.
end
();
++
_iter26
)
std
::
vector
<
std
::
string
>
::
const_iterator
_iter31
;
for
(
_iter31
=
this
->
id_list
.
begin
();
_iter31
!=
this
->
id_list
.
end
();
++
_iter31
)
{
xfer
+=
oprot
->
writeString
((
*
_iter31
));
}
xfer
+=
oprot
->
writeListEnd
();
}
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldBegin
(
"distance_list"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
2
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_DOUBLE
,
static_cast
<
uint32_t
>
(
this
->
distance_list
.
size
()));
std
::
vector
<
double
>
::
const_iterator
_iter32
;
for
(
_iter32
=
this
->
distance_list
.
begin
();
_iter32
!=
this
->
distance_list
.
end
();
++
_iter32
)
{
xfer
+=
oprot
->
write
String
((
*
_iter26
));
xfer
+=
oprot
->
write
Double
((
*
_iter32
));
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -635,22 +671,26 @@ uint32_t VecSearchResult::write(::apache::thrift::protocol::TProtocol* oprot) co
void
swap
(
VecSearchResult
&
a
,
VecSearchResult
&
b
)
{
using
::
std
::
swap
;
swap
(
a
.
id_list
,
b
.
id_list
);
swap
(
a
.
distance_list
,
b
.
distance_list
);
swap
(
a
.
__isset
,
b
.
__isset
);
}
VecSearchResult
::
VecSearchResult
(
const
VecSearchResult
&
other27
)
{
id_list
=
other27
.
id_list
;
__isset
=
other27
.
__isset
;
VecSearchResult
::
VecSearchResult
(
const
VecSearchResult
&
other33
)
{
id_list
=
other33
.
id_list
;
distance_list
=
other33
.
distance_list
;
__isset
=
other33
.
__isset
;
}
VecSearchResult
&
VecSearchResult
::
operator
=
(
const
VecSearchResult
&
other28
)
{
id_list
=
other28
.
id_list
;
__isset
=
other28
.
__isset
;
VecSearchResult
&
VecSearchResult
::
operator
=
(
const
VecSearchResult
&
other34
)
{
id_list
=
other34
.
id_list
;
distance_list
=
other34
.
distance_list
;
__isset
=
other34
.
__isset
;
return
*
this
;
}
void
VecSearchResult
::
printTo
(
std
::
ostream
&
out
)
const
{
using
::
apache
::
thrift
::
to_string
;
out
<<
"VecSearchResult("
;
out
<<
"id_list="
<<
to_string
(
id_list
);
out
<<
", "
<<
"distance_list="
<<
to_string
(
distance_list
);
out
<<
")"
;
}
...
...
@@ -694,14 +734,14 @@ uint32_t VecSearchResultList::read(::apache::thrift::protocol::TProtocol* iprot)
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
result_list
.
clear
();
uint32_t
_size
29
;
::
apache
::
thrift
::
protocol
::
TType
_etype3
2
;
xfer
+=
iprot
->
readListBegin
(
_etype3
2
,
_size29
);
this
->
result_list
.
resize
(
_size
29
);
uint32_t
_i3
3
;
for
(
_i3
3
=
0
;
_i33
<
_size29
;
++
_i33
)
uint32_t
_size
35
;
::
apache
::
thrift
::
protocol
::
TType
_etype3
8
;
xfer
+=
iprot
->
readListBegin
(
_etype3
8
,
_size35
);
this
->
result_list
.
resize
(
_size
35
);
uint32_t
_i3
9
;
for
(
_i3
9
=
0
;
_i39
<
_size35
;
++
_i39
)
{
xfer
+=
this
->
result_list
[
_i3
3
].
read
(
iprot
);
xfer
+=
this
->
result_list
[
_i3
9
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -730,10 +770,10 @@ uint32_t VecSearchResultList::write(::apache::thrift::protocol::TProtocol* oprot
xfer
+=
oprot
->
writeFieldBegin
(
"result_list"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
1
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
result_list
.
size
()));
std
::
vector
<
VecSearchResult
>
::
const_iterator
_iter
34
;
for
(
_iter
34
=
this
->
result_list
.
begin
();
_iter34
!=
this
->
result_list
.
end
();
++
_iter34
)
std
::
vector
<
VecSearchResult
>
::
const_iterator
_iter
40
;
for
(
_iter
40
=
this
->
result_list
.
begin
();
_iter40
!=
this
->
result_list
.
end
();
++
_iter40
)
{
xfer
+=
(
*
_iter
34
).
write
(
oprot
);
xfer
+=
(
*
_iter
40
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -750,13 +790,13 @@ void swap(VecSearchResultList &a, VecSearchResultList &b) {
swap
(
a
.
__isset
,
b
.
__isset
);
}
VecSearchResultList
::
VecSearchResultList
(
const
VecSearchResultList
&
other
35
)
{
result_list
=
other
35
.
result_list
;
__isset
=
other
35
.
__isset
;
VecSearchResultList
::
VecSearchResultList
(
const
VecSearchResultList
&
other
41
)
{
result_list
=
other
41
.
result_list
;
__isset
=
other
41
.
__isset
;
}
VecSearchResultList
&
VecSearchResultList
::
operator
=
(
const
VecSearchResultList
&
other
36
)
{
result_list
=
other
36
.
result_list
;
__isset
=
other
36
.
__isset
;
VecSearchResultList
&
VecSearchResultList
::
operator
=
(
const
VecSearchResultList
&
other
42
)
{
result_list
=
other
42
.
result_list
;
__isset
=
other
42
.
__isset
;
return
*
this
;
}
void
VecSearchResultList
::
printTo
(
std
::
ostream
&
out
)
const
{
...
...
@@ -927,23 +967,23 @@ void swap(VecDateTime &a, VecDateTime &b) {
swap
(
a
.
__isset
,
b
.
__isset
);
}
VecDateTime
::
VecDateTime
(
const
VecDateTime
&
other
37
)
{
year
=
other
37
.
year
;
month
=
other
37
.
month
;
day
=
other
37
.
day
;
hour
=
other
37
.
hour
;
minute
=
other
37
.
minute
;
second
=
other
37
.
second
;
__isset
=
other
37
.
__isset
;
}
VecDateTime
&
VecDateTime
::
operator
=
(
const
VecDateTime
&
other
38
)
{
year
=
other
38
.
year
;
month
=
other
38
.
month
;
day
=
other
38
.
day
;
hour
=
other
38
.
hour
;
minute
=
other
38
.
minute
;
second
=
other
38
.
second
;
__isset
=
other
38
.
__isset
;
VecDateTime
::
VecDateTime
(
const
VecDateTime
&
other
43
)
{
year
=
other
43
.
year
;
month
=
other
43
.
month
;
day
=
other
43
.
day
;
hour
=
other
43
.
hour
;
minute
=
other
43
.
minute
;
second
=
other
43
.
second
;
__isset
=
other
43
.
__isset
;
}
VecDateTime
&
VecDateTime
::
operator
=
(
const
VecDateTime
&
other
44
)
{
year
=
other
44
.
year
;
month
=
other
44
.
month
;
day
=
other
44
.
day
;
hour
=
other
44
.
hour
;
minute
=
other
44
.
minute
;
second
=
other
44
.
second
;
__isset
=
other
44
.
__isset
;
return
*
this
;
}
void
VecDateTime
::
printTo
(
std
::
ostream
&
out
)
const
{
...
...
@@ -1085,19 +1125,19 @@ void swap(VecTimeRange &a, VecTimeRange &b) {
swap
(
a
.
__isset
,
b
.
__isset
);
}
VecTimeRange
::
VecTimeRange
(
const
VecTimeRange
&
other
39
)
{
time_begin
=
other
39
.
time_begin
;
begine_closed
=
other
39
.
begine_closed
;
time_end
=
other
39
.
time_end
;
end_closed
=
other
39
.
end_closed
;
__isset
=
other
39
.
__isset
;
VecTimeRange
::
VecTimeRange
(
const
VecTimeRange
&
other
45
)
{
time_begin
=
other
45
.
time_begin
;
begine_closed
=
other
45
.
begine_closed
;
time_end
=
other
45
.
time_end
;
end_closed
=
other
45
.
end_closed
;
__isset
=
other
45
.
__isset
;
}
VecTimeRange
&
VecTimeRange
::
operator
=
(
const
VecTimeRange
&
other4
0
)
{
time_begin
=
other4
0
.
time_begin
;
begine_closed
=
other4
0
.
begine_closed
;
time_end
=
other4
0
.
time_end
;
end_closed
=
other4
0
.
end_closed
;
__isset
=
other4
0
.
__isset
;
VecTimeRange
&
VecTimeRange
::
operator
=
(
const
VecTimeRange
&
other4
6
)
{
time_begin
=
other4
6
.
time_begin
;
begine_closed
=
other4
6
.
begine_closed
;
time_end
=
other4
6
.
time_end
;
end_closed
=
other4
6
.
end_closed
;
__isset
=
other4
6
.
__isset
;
return
*
this
;
}
void
VecTimeRange
::
printTo
(
std
::
ostream
&
out
)
const
{
...
...
@@ -1150,14 +1190,14 @@ uint32_t VecTimeRangeList::read(::apache::thrift::protocol::TProtocol* iprot) {
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
range_list
.
clear
();
uint32_t
_size4
1
;
::
apache
::
thrift
::
protocol
::
TType
_etype
44
;
xfer
+=
iprot
->
readListBegin
(
_etype
44
,
_size41
);
this
->
range_list
.
resize
(
_size4
1
);
uint32_t
_i
45
;
for
(
_i
45
=
0
;
_i45
<
_size41
;
++
_i45
)
uint32_t
_size4
7
;
::
apache
::
thrift
::
protocol
::
TType
_etype
50
;
xfer
+=
iprot
->
readListBegin
(
_etype
50
,
_size47
);
this
->
range_list
.
resize
(
_size4
7
);
uint32_t
_i
51
;
for
(
_i
51
=
0
;
_i51
<
_size47
;
++
_i51
)
{
xfer
+=
this
->
range_list
[
_i
45
].
read
(
iprot
);
xfer
+=
this
->
range_list
[
_i
51
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -1186,10 +1226,10 @@ uint32_t VecTimeRangeList::write(::apache::thrift::protocol::TProtocol* oprot) c
xfer
+=
oprot
->
writeFieldBegin
(
"range_list"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
1
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
range_list
.
size
()));
std
::
vector
<
VecTimeRange
>
::
const_iterator
_iter
46
;
for
(
_iter
46
=
this
->
range_list
.
begin
();
_iter46
!=
this
->
range_list
.
end
();
++
_iter46
)
std
::
vector
<
VecTimeRange
>
::
const_iterator
_iter
52
;
for
(
_iter
52
=
this
->
range_list
.
begin
();
_iter52
!=
this
->
range_list
.
end
();
++
_iter52
)
{
xfer
+=
(
*
_iter
46
).
write
(
oprot
);
xfer
+=
(
*
_iter
52
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1206,13 +1246,13 @@ void swap(VecTimeRangeList &a, VecTimeRangeList &b) {
swap
(
a
.
__isset
,
b
.
__isset
);
}
VecTimeRangeList
::
VecTimeRangeList
(
const
VecTimeRangeList
&
other
47
)
{
range_list
=
other
47
.
range_list
;
__isset
=
other
47
.
__isset
;
VecTimeRangeList
::
VecTimeRangeList
(
const
VecTimeRangeList
&
other
53
)
{
range_list
=
other
53
.
range_list
;
__isset
=
other
53
.
__isset
;
}
VecTimeRangeList
&
VecTimeRangeList
::
operator
=
(
const
VecTimeRangeList
&
other
48
)
{
range_list
=
other
48
.
range_list
;
__isset
=
other
48
.
__isset
;
VecTimeRangeList
&
VecTimeRangeList
::
operator
=
(
const
VecTimeRangeList
&
other
54
)
{
range_list
=
other
54
.
range_list
;
__isset
=
other
54
.
__isset
;
return
*
this
;
}
void
VecTimeRangeList
::
printTo
(
std
::
ostream
&
out
)
const
{
...
...
cpp/src/thrift/gen-cpp/VectorService_types.h
浏览文件 @
38155283
...
...
@@ -248,8 +248,9 @@ void swap(VecTensorList &a, VecTensorList &b);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
VecTensorList
&
obj
);
typedef
struct
_VecSearchResult__isset
{
_VecSearchResult__isset
()
:
id_list
(
false
)
{}
_VecSearchResult__isset
()
:
id_list
(
false
)
,
distance_list
(
false
)
{}
bool
id_list
:
1
;
bool
distance_list
:
1
;
}
_VecSearchResult__isset
;
class
VecSearchResult
:
public
virtual
::
apache
::
thrift
::
TBase
{
...
...
@@ -262,15 +263,20 @@ class VecSearchResult : public virtual ::apache::thrift::TBase {
virtual
~
VecSearchResult
()
throw
();
std
::
vector
<
std
::
string
>
id_list
;
std
::
vector
<
double
>
distance_list
;
_VecSearchResult__isset
__isset
;
void
__set_id_list
(
const
std
::
vector
<
std
::
string
>
&
val
);
void
__set_distance_list
(
const
std
::
vector
<
double
>
&
val
);
bool
operator
==
(
const
VecSearchResult
&
rhs
)
const
{
if
(
!
(
id_list
==
rhs
.
id_list
))
return
false
;
if
(
!
(
distance_list
==
rhs
.
distance_list
))
return
false
;
return
true
;
}
bool
operator
!=
(
const
VecSearchResult
&
rhs
)
const
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录