Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
476d2192
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,发现更多精彩内容 >>
提交
476d2192
编写于
7月 17, 2019
作者:
S
starlord
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MS-245 Improve search result transfer performance
Former-commit-id: 77ce402c5ab2c851afa11cb2d637acb69d9ad737
上级
8e5e50e4
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
1283 addition
and
199 deletion
+1283
-199
cpp/CHANGELOG.md
cpp/CHANGELOG.md
+2
-1
cpp/src/sdk/src/client/ClientProxy.cpp
cpp/src/sdk/src/client/ClientProxy.cpp
+13
-5
cpp/src/server/RequestHandler.cpp
cpp/src/server/RequestHandler.cpp
+13
-2
cpp/src/server/RequestHandler.h
cpp/src/server/RequestHandler.h
+23
-0
cpp/src/server/RequestTask.cpp
cpp/src/server/RequestTask.cpp
+101
-33
cpp/src/server/RequestTask.h
cpp/src/server/RequestTask.h
+52
-12
cpp/src/thrift/gen-cpp/MilvusService.cpp
cpp/src/thrift/gen-cpp/MilvusService.cpp
+701
-146
cpp/src/thrift/gen-cpp/MilvusService.h
cpp/src/thrift/gen-cpp/MilvusService.h
+173
-0
cpp/src/thrift/gen-cpp/MilvusService_server.skeleton.cpp
cpp/src/thrift/gen-cpp/MilvusService_server.skeleton.cpp
+22
-0
cpp/src/thrift/gen-cpp/milvus_types.cpp
cpp/src/thrift/gen-cpp/milvus_types.cpp
+115
-0
cpp/src/thrift/gen-cpp/milvus_types.h
cpp/src/thrift/gen-cpp/milvus_types.h
+43
-0
cpp/src/thrift/milvus.thrift
cpp/src/thrift/milvus.thrift
+25
-0
未找到文件。
cpp/CHANGELOG.md
浏览文件 @
476d2192
...
...
@@ -29,7 +29,8 @@ Please mark all change in change log and use the ticket from JIRA.
-
MS-208 - Add buildinde interface for C++ SDK
-
MS-212 - Support Inner product metric type
-
MS-241 - Build Faiss with MKL if using Intel CPU; else build with OpenBlas
-
MS-242 - clean up cmake and change MAKE_BUILD_ARGS to be user defined variable
-
MS-242 - Clean up cmake and change MAKE_BUILD_ARGS to be user defined variable
-
MS-245 - Improve search result transfer performance
## New Feature
-
MS-180 - Add new mem manager
...
...
cpp/src/sdk/src/client/ClientProxy.cpp
浏览文件 @
476d2192
...
...
@@ -209,17 +209,25 @@ ClientProxy::SearchVector(const std::string &table_name,
}
//step 3: search vectors
std
::
vector
<
thrift
::
TopKQueryResult
>
result_array
;
ClientPtr
()
->
interface
()
->
SearchVector
(
result_array
,
table_name
,
thrift_records
,
thrift_ranges
,
topk
);
std
::
vector
<
thrift
::
TopKQuery
Bin
Result
>
result_array
;
ClientPtr
()
->
interface
()
->
SearchVector
2
(
result_array
,
table_name
,
thrift_records
,
thrift_ranges
,
topk
);
//step 4: convert result array
for
(
auto
&
thrift_topk_result
:
result_array
)
{
TopKQueryResult
result
;
for
(
auto
&
thrift_query_result
:
thrift_topk_result
.
query_result_arrays
)
{
size_t
id_count
=
thrift_topk_result
.
id_array
.
size
()
/
sizeof
(
int64_t
);
size_t
dist_count
=
thrift_topk_result
.
distance_array
.
size
()
/
sizeof
(
double
);
if
(
id_count
!=
dist_count
)
{
return
Status
(
StatusCode
::
UnknownError
,
"illegal result"
);
}
int64_t
*
id_ptr
=
(
int64_t
*
)
thrift_topk_result
.
id_array
.
data
();
double
*
dist_ptr
=
(
double
*
)
thrift_topk_result
.
distance_array
.
data
();
for
(
size_t
i
=
0
;
i
<
id_count
;
i
++
)
{
QueryResult
query_result
;
query_result
.
id
=
thrift_query_result
.
id
;
query_result
.
distance
=
thrift_query_result
.
distance
;
query_result
.
id
=
id_ptr
[
i
]
;
query_result
.
distance
=
dist_ptr
[
i
]
;
result
.
query_result_arrays
.
emplace_back
(
query_result
);
}
...
...
cpp/src/server/RequestHandler.cpp
浏览文件 @
476d2192
...
...
@@ -60,11 +60,22 @@ RequestHandler::SearchVector(std::vector<thrift::TopKQueryResult> &_return,
const
std
::
vector
<
thrift
::
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
// SERVER_LOG_DEBUG << "Entering RequestHandler::SearchVector";
BaseTaskPtr
task_ptr
=
SearchVectorTask
::
Create
(
table_name
,
std
::
vector
<
std
::
string
>
(),
query_record_array
,
BaseTaskPtr
task_ptr
=
SearchVectorTask
1
::
Create
(
table_name
,
std
::
vector
<
std
::
string
>
(),
query_record_array
,
query_range_array
,
topk
,
_return
);
RequestScheduler
::
ExecTask
(
task_ptr
);
}
void
RequestHandler
::
SearchVector2
(
std
::
vector
<
thrift
::
TopKQueryBinResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
thrift
::
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
BaseTaskPtr
task_ptr
=
SearchVectorTask2
::
Create
(
table_name
,
std
::
vector
<
std
::
string
>
(),
query_record_array
,
query_range_array
,
topk
,
_return
);
RequestScheduler
::
ExecTask
(
task_ptr
);
}
void
RequestHandler
::
SearchVectorInFiles
(
std
::
vector
<::
milvus
::
thrift
::
TopKQueryResult
>
&
_return
,
const
std
::
string
&
table_name
,
...
...
@@ -73,7 +84,7 @@ RequestHandler::SearchVectorInFiles(std::vector<::milvus::thrift::TopKQueryResul
const
std
::
vector
<::
milvus
::
thrift
::
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
// SERVER_LOG_DEBUG << "Entering RequestHandler::SearchVectorInFiles. file_id_array size = " << std::to_string(file_id_array.size());
BaseTaskPtr
task_ptr
=
SearchVectorTask
::
Create
(
table_name
,
file_id_array
,
query_record_array
,
BaseTaskPtr
task_ptr
=
SearchVectorTask
1
::
Create
(
table_name
,
file_id_array
,
query_record_array
,
query_range_array
,
topk
,
_return
);
RequestScheduler
::
ExecTask
(
task_ptr
);
}
...
...
cpp/src/server/RequestHandler.h
浏览文件 @
476d2192
...
...
@@ -106,6 +106,29 @@ public:
const
std
::
vector
<::
milvus
::
thrift
::
Range
>
&
query_range_array
,
const
int64_t
topk
);
/**
* @brief Query vector
*
* This method is used to query vector in table.
*
* @param table_name, table_name is queried.
* @param query_record_array, all vector are going to be queried.
* @param query_range_array, optional ranges for conditional search. If not specified, search whole table
* @param topk, how many similarity vectors will be searched.
*
* @return query binary result array.
*
* @param table_name
* @param query_record_array
* @param query_range_array
* @param topk
*/
void
SearchVector2
(
std
::
vector
<::
milvus
::
thrift
::
TopKQueryBinResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<::
milvus
::
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<::
milvus
::
thrift
::
Range
>
&
query_range_array
,
const
int64_t
topk
);
/**
* @brief Internal use query interface
*
...
...
cpp/src/server/RequestTask.cpp
浏览文件 @
476d2192
...
...
@@ -466,33 +466,21 @@ ServerError AddVectorTask::OnExecute() {
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SearchVectorTask
::
SearchVectorTask
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
,
std
::
vector
<
thrift
::
TopKQueryResult
>
&
result_array
)
SearchVectorTaskBase
::
SearchVectorTaskBase
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
)
:
BaseTask
(
DQL_TASK_GROUP
),
table_name_
(
table_name
),
file_id_array_
(
file_id_array
),
record_array_
(
query_record_array
),
range_array_
(
query_range_array
),
top_k_
(
top_k
),
result_array_
(
result_array
)
{
}
top_k_
(
top_k
)
{
BaseTaskPtr
SearchVectorTask
::
Create
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
,
std
::
vector
<
thrift
::
TopKQueryResult
>&
result_array
)
{
return
std
::
shared_ptr
<
BaseTask
>
(
new
SearchVectorTask
(
table_name
,
file_id_array
,
query_record_array
,
query_range_array
,
top_k
,
result_array
));
}
ServerError
SearchVectorTask
::
OnExecute
()
{
ServerError
SearchVectorTask
Base
::
OnExecute
()
{
try
{
TimeRecorder
rc
(
"SearchVectorTask"
);
...
...
@@ -570,26 +558,106 @@ ServerError SearchVectorTask::OnExecute() {
rc
.
Record
(
"do search"
);
//step 5: construct result array
for
(
uint64_t
i
=
0
;
i
<
record_count
;
i
++
)
{
auto
&
result
=
results
[
i
]
;
const
auto
&
record
=
record_array_
[
i
]
;
ConstructResult
(
results
);
rc
.
Record
(
"construct result"
)
;
rc
.
Elapse
(
"total cost"
)
;
thrift
::
TopKQueryResult
thrift_topk_result
;
for
(
auto
&
pair
:
result
)
{
thrift
::
QueryResult
thrift_result
;
thrift_result
.
__set_id
(
pair
.
first
);
thrift_result
.
__set_distance
(
pair
.
second
);
}
catch
(
std
::
exception
&
ex
)
{
return
SetError
(
SERVER_UNEXPECTED_ERROR
,
ex
.
what
());
}
thrift_topk_result
.
query_result_arrays
.
emplace_back
(
thrift_result
);
}
return
SERVER_SUCCESS
;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SearchVectorTask1
::
SearchVectorTask1
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
,
std
::
vector
<
thrift
::
TopKQueryResult
>
&
result_array
)
:
SearchVectorTaskBase
(
table_name
,
file_id_array
,
query_record_array
,
query_range_array
,
top_k
),
result_array_
(
result_array
)
{
}
BaseTaskPtr
SearchVectorTask1
::
Create
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
,
std
::
vector
<
thrift
::
TopKQueryResult
>&
result_array
)
{
return
std
::
shared_ptr
<
BaseTask
>
(
new
SearchVectorTask1
(
table_name
,
file_id_array
,
query_record_array
,
query_range_array
,
top_k
,
result_array
));
}
ServerError
SearchVectorTask1
::
ConstructResult
(
engine
::
QueryResults
&
results
)
{
for
(
uint64_t
i
=
0
;
i
<
results
.
size
();
i
++
)
{
auto
&
result
=
results
[
i
];
const
auto
&
record
=
record_array_
[
i
];
thrift
::
TopKQueryResult
thrift_topk_result
;
for
(
auto
&
pair
:
result
)
{
thrift
::
QueryResult
thrift_result
;
thrift_result
.
__set_id
(
pair
.
first
);
thrift_result
.
__set_distance
(
pair
.
second
);
thrift_topk_result
.
query_result_arrays
.
emplace_back
(
thrift_result
);
}
result_array_
.
emplace_back
(
thrift_topk_result
);
}
return
SERVER_SUCCESS
;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SearchVectorTask2
::
SearchVectorTask2
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
,
std
::
vector
<
thrift
::
TopKQueryBinResult
>
&
result_array
)
:
SearchVectorTaskBase
(
table_name
,
file_id_array
,
query_record_array
,
query_range_array
,
top_k
),
result_array_
(
result_array
)
{
}
BaseTaskPtr
SearchVectorTask2
::
Create
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
,
std
::
vector
<
thrift
::
TopKQueryBinResult
>&
result_array
)
{
return
std
::
shared_ptr
<
BaseTask
>
(
new
SearchVectorTask2
(
table_name
,
file_id_array
,
query_record_array
,
query_range_array
,
top_k
,
result_array
));
}
ServerError
SearchVectorTask2
::
ConstructResult
(
engine
::
QueryResults
&
results
)
{
for
(
size_t
i
=
0
;
i
<
results
.
size
();
i
++
)
{
auto
&
result
=
results
[
i
];
thrift
::
TopKQueryBinResult
thrift_topk_result
;
if
(
result
.
empty
())
{
result_array_
.
emplace_back
(
thrift_topk_result
);
continue
;
}
rc
.
Record
(
"construct result"
);
rc
.
Elapse
(
"total cost"
);
}
catch
(
std
::
exception
&
ex
)
{
return
SetError
(
SERVER_UNEXPECTED_ERROR
,
ex
.
what
());
std
::
string
str_ids
,
str_distances
;
str_ids
.
resize
(
sizeof
(
engine
::
IDNumber
)
*
result
.
size
());
str_distances
.
resize
(
sizeof
(
double
)
*
result
.
size
());
engine
::
IDNumber
*
ids_ptr
=
(
engine
::
IDNumber
*
)
str_ids
.
data
();
double
*
distance_ptr
=
(
double
*
)
str_distances
.
data
();
for
(
size_t
k
=
0
;
k
<
results
.
size
();
k
++
)
{
auto
&
pair
=
result
[
k
];
ids_ptr
[
k
]
=
pair
.
first
;
distance_ptr
[
k
]
=
pair
.
second
;
}
thrift_topk_result
.
__set_id_array
(
str_ids
);
thrift_topk_result
.
__set_distance_array
(
str_distances
);
result_array_
.
emplace_back
(
thrift_topk_result
);
}
return
SERVER_SUCCESS
;
...
...
cpp/src/server/RequestTask.h
浏览文件 @
476d2192
...
...
@@ -129,7 +129,28 @@ private:
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class
SearchVectorTask
:
public
BaseTask
{
class
SearchVectorTaskBase
:
public
BaseTask
{
protected:
SearchVectorTaskBase
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<::
milvus
::
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<::
milvus
::
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
);
ServerError
OnExecute
()
override
;
virtual
ServerError
ConstructResult
(
engine
::
QueryResults
&
results
)
=
0
;
protected:
std
::
string
table_name_
;
std
::
vector
<
std
::
string
>
file_id_array_
;
int64_t
top_k_
;
const
std
::
vector
<::
milvus
::
thrift
::
RowRecord
>&
record_array_
;
const
std
::
vector
<::
milvus
::
thrift
::
Range
>&
range_array_
;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class
SearchVectorTask1
:
public
SearchVectorTaskBase
{
public:
static
BaseTaskPtr
Create
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
...
...
@@ -139,24 +160,43 @@ public:
std
::
vector
<::
milvus
::
thrift
::
TopKQueryResult
>&
result_array
);
protected:
SearchVectorTask
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<::
milvus
::
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<::
milvus
::
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
,
SearchVectorTask
1
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<::
milvus
::
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<::
milvus
::
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
,
std
::
vector
<::
milvus
::
thrift
::
TopKQueryResult
>&
result_array
);
ServerError
OnExecute
(
)
override
;
ServerError
ConstructResult
(
engine
::
QueryResults
&
results
)
override
;
private:
std
::
string
table_name_
;
std
::
vector
<
std
::
string
>
file_id_array_
;
int64_t
top_k_
;
const
std
::
vector
<::
milvus
::
thrift
::
RowRecord
>&
record_array_
;
const
std
::
vector
<::
milvus
::
thrift
::
Range
>&
range_array_
;
std
::
vector
<::
milvus
::
thrift
::
TopKQueryResult
>&
result_array_
;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class
SearchVectorTask2
:
public
SearchVectorTaskBase
{
public:
static
BaseTaskPtr
Create
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<::
milvus
::
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<::
milvus
::
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
,
std
::
vector
<::
milvus
::
thrift
::
TopKQueryBinResult
>&
result_array
);
protected:
SearchVectorTask2
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>&
file_id_array
,
const
std
::
vector
<::
milvus
::
thrift
::
RowRecord
>
&
query_record_array
,
const
std
::
vector
<::
milvus
::
thrift
::
Range
>
&
query_range_array
,
const
int64_t
top_k
,
std
::
vector
<::
milvus
::
thrift
::
TopKQueryBinResult
>&
result_array
);
ServerError
ConstructResult
(
engine
::
QueryResults
&
results
)
override
;
private:
std
::
vector
<::
milvus
::
thrift
::
TopKQueryBinResult
>&
result_array_
;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class
GetTableRowCountTask
:
public
BaseTask
{
public:
...
...
cpp/src/thrift/gen-cpp/MilvusService.cpp
浏览文件 @
476d2192
...
...
@@ -814,14 +814,14 @@ uint32_t MilvusService_AddVector_args::read(::apache::thrift::protocol::TProtoco
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
record_array
.
clear
();
uint32_t
_size
19
;
::
apache
::
thrift
::
protocol
::
TType
_etype2
2
;
xfer
+=
iprot
->
readListBegin
(
_etype2
2
,
_size19
);
this
->
record_array
.
resize
(
_size
19
);
uint32_t
_i2
3
;
for
(
_i2
3
=
0
;
_i23
<
_size19
;
++
_i23
)
uint32_t
_size
21
;
::
apache
::
thrift
::
protocol
::
TType
_etype2
4
;
xfer
+=
iprot
->
readListBegin
(
_etype2
4
,
_size21
);
this
->
record_array
.
resize
(
_size
21
);
uint32_t
_i2
5
;
for
(
_i2
5
=
0
;
_i25
<
_size21
;
++
_i25
)
{
xfer
+=
this
->
record_array
[
_i2
3
].
read
(
iprot
);
xfer
+=
this
->
record_array
[
_i2
5
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -854,10 +854,10 @@ uint32_t MilvusService_AddVector_args::write(::apache::thrift::protocol::TProtoc
xfer
+=
oprot
->
writeFieldBegin
(
"record_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
3
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
record_array
.
size
()));
std
::
vector
<
RowRecord
>
::
const_iterator
_iter2
4
;
for
(
_iter2
4
=
this
->
record_array
.
begin
();
_iter24
!=
this
->
record_array
.
end
();
++
_iter24
)
std
::
vector
<
RowRecord
>
::
const_iterator
_iter2
6
;
for
(
_iter2
6
=
this
->
record_array
.
begin
();
_iter26
!=
this
->
record_array
.
end
();
++
_iter26
)
{
xfer
+=
(
*
_iter2
4
).
write
(
oprot
);
xfer
+=
(
*
_iter2
6
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -885,10 +885,10 @@ uint32_t MilvusService_AddVector_pargs::write(::apache::thrift::protocol::TProto
xfer
+=
oprot
->
writeFieldBegin
(
"record_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
3
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
((
*
(
this
->
record_array
)).
size
()));
std
::
vector
<
RowRecord
>
::
const_iterator
_iter2
5
;
for
(
_iter2
5
=
(
*
(
this
->
record_array
)).
begin
();
_iter25
!=
(
*
(
this
->
record_array
)).
end
();
++
_iter25
)
std
::
vector
<
RowRecord
>
::
const_iterator
_iter2
7
;
for
(
_iter2
7
=
(
*
(
this
->
record_array
)).
begin
();
_iter27
!=
(
*
(
this
->
record_array
)).
end
();
++
_iter27
)
{
xfer
+=
(
*
_iter2
5
).
write
(
oprot
);
xfer
+=
(
*
_iter2
7
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -929,14 +929,14 @@ uint32_t MilvusService_AddVector_result::read(::apache::thrift::protocol::TProto
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
success
.
clear
();
uint32_t
_size2
6
;
::
apache
::
thrift
::
protocol
::
TType
_etype
29
;
xfer
+=
iprot
->
readListBegin
(
_etype
29
,
_size26
);
this
->
success
.
resize
(
_size2
6
);
uint32_t
_i3
0
;
for
(
_i3
0
=
0
;
_i30
<
_size26
;
++
_i30
)
uint32_t
_size2
8
;
::
apache
::
thrift
::
protocol
::
TType
_etype
31
;
xfer
+=
iprot
->
readListBegin
(
_etype
31
,
_size28
);
this
->
success
.
resize
(
_size2
8
);
uint32_t
_i3
2
;
for
(
_i3
2
=
0
;
_i32
<
_size28
;
++
_i32
)
{
xfer
+=
iprot
->
readI64
(
this
->
success
[
_i3
0
]);
xfer
+=
iprot
->
readI64
(
this
->
success
[
_i3
2
]);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -975,10 +975,10 @@ uint32_t MilvusService_AddVector_result::write(::apache::thrift::protocol::TProt
xfer
+=
oprot
->
writeFieldBegin
(
"success"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
0
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_I64
,
static_cast
<
uint32_t
>
(
this
->
success
.
size
()));
std
::
vector
<
int64_t
>
::
const_iterator
_iter3
1
;
for
(
_iter3
1
=
this
->
success
.
begin
();
_iter31
!=
this
->
success
.
end
();
++
_iter31
)
std
::
vector
<
int64_t
>
::
const_iterator
_iter3
3
;
for
(
_iter3
3
=
this
->
success
.
begin
();
_iter33
!=
this
->
success
.
end
();
++
_iter33
)
{
xfer
+=
oprot
->
writeI64
((
*
_iter3
1
));
xfer
+=
oprot
->
writeI64
((
*
_iter3
3
));
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1023,14 +1023,14 @@ uint32_t MilvusService_AddVector_presult::read(::apache::thrift::protocol::TProt
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
(
*
(
this
->
success
)).
clear
();
uint32_t
_size3
2
;
::
apache
::
thrift
::
protocol
::
TType
_etype3
5
;
xfer
+=
iprot
->
readListBegin
(
_etype3
5
,
_size32
);
(
*
(
this
->
success
)).
resize
(
_size3
2
);
uint32_t
_i3
6
;
for
(
_i3
6
=
0
;
_i36
<
_size32
;
++
_i36
)
uint32_t
_size3
4
;
::
apache
::
thrift
::
protocol
::
TType
_etype3
7
;
xfer
+=
iprot
->
readListBegin
(
_etype3
7
,
_size34
);
(
*
(
this
->
success
)).
resize
(
_size3
4
);
uint32_t
_i3
8
;
for
(
_i3
8
=
0
;
_i38
<
_size34
;
++
_i38
)
{
xfer
+=
iprot
->
readI64
((
*
(
this
->
success
))[
_i3
6
]);
xfer
+=
iprot
->
readI64
((
*
(
this
->
success
))[
_i3
8
]);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -1097,14 +1097,14 @@ uint32_t MilvusService_SearchVector_args::read(::apache::thrift::protocol::TProt
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
query_record_array
.
clear
();
uint32_t
_size3
7
;
::
apache
::
thrift
::
protocol
::
TType
_etype4
0
;
xfer
+=
iprot
->
readListBegin
(
_etype4
0
,
_size37
);
this
->
query_record_array
.
resize
(
_size3
7
);
uint32_t
_i4
1
;
for
(
_i4
1
=
0
;
_i41
<
_size37
;
++
_i41
)
uint32_t
_size3
9
;
::
apache
::
thrift
::
protocol
::
TType
_etype4
2
;
xfer
+=
iprot
->
readListBegin
(
_etype4
2
,
_size39
);
this
->
query_record_array
.
resize
(
_size3
9
);
uint32_t
_i4
3
;
for
(
_i4
3
=
0
;
_i43
<
_size39
;
++
_i43
)
{
xfer
+=
this
->
query_record_array
[
_i4
1
].
read
(
iprot
);
xfer
+=
this
->
query_record_array
[
_i4
3
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -1117,14 +1117,14 @@ uint32_t MilvusService_SearchVector_args::read(::apache::thrift::protocol::TProt
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
query_range_array
.
clear
();
uint32_t
_size4
2
;
::
apache
::
thrift
::
protocol
::
TType
_etype4
5
;
xfer
+=
iprot
->
readListBegin
(
_etype4
5
,
_size42
);
this
->
query_range_array
.
resize
(
_size4
2
);
uint32_t
_i4
6
;
for
(
_i4
6
=
0
;
_i46
<
_size42
;
++
_i46
)
uint32_t
_size4
4
;
::
apache
::
thrift
::
protocol
::
TType
_etype4
7
;
xfer
+=
iprot
->
readListBegin
(
_etype4
7
,
_size44
);
this
->
query_range_array
.
resize
(
_size4
4
);
uint32_t
_i4
8
;
for
(
_i4
8
=
0
;
_i48
<
_size44
;
++
_i48
)
{
xfer
+=
this
->
query_range_array
[
_i4
6
].
read
(
iprot
);
xfer
+=
this
->
query_range_array
[
_i4
8
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -1165,10 +1165,10 @@ uint32_t MilvusService_SearchVector_args::write(::apache::thrift::protocol::TPro
xfer
+=
oprot
->
writeFieldBegin
(
"query_record_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
3
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
query_record_array
.
size
()));
std
::
vector
<
RowRecord
>
::
const_iterator
_iter4
7
;
for
(
_iter4
7
=
this
->
query_record_array
.
begin
();
_iter47
!=
this
->
query_record_array
.
end
();
++
_iter47
)
std
::
vector
<
RowRecord
>
::
const_iterator
_iter4
9
;
for
(
_iter4
9
=
this
->
query_record_array
.
begin
();
_iter49
!=
this
->
query_record_array
.
end
();
++
_iter49
)
{
xfer
+=
(
*
_iter4
7
).
write
(
oprot
);
xfer
+=
(
*
_iter4
9
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1177,10 +1177,10 @@ uint32_t MilvusService_SearchVector_args::write(::apache::thrift::protocol::TPro
xfer
+=
oprot
->
writeFieldBegin
(
"query_range_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
4
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
query_range_array
.
size
()));
std
::
vector
<
Range
>
::
const_iterator
_iter
48
;
for
(
_iter
48
=
this
->
query_range_array
.
begin
();
_iter48
!=
this
->
query_range_array
.
end
();
++
_iter48
)
std
::
vector
<
Range
>
::
const_iterator
_iter
50
;
for
(
_iter
50
=
this
->
query_range_array
.
begin
();
_iter50
!=
this
->
query_range_array
.
end
();
++
_iter50
)
{
xfer
+=
(
*
_iter
48
).
write
(
oprot
);
xfer
+=
(
*
_iter
50
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1212,10 +1212,10 @@ uint32_t MilvusService_SearchVector_pargs::write(::apache::thrift::protocol::TPr
xfer
+=
oprot
->
writeFieldBegin
(
"query_record_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
3
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
((
*
(
this
->
query_record_array
)).
size
()));
std
::
vector
<
RowRecord
>
::
const_iterator
_iter
49
;
for
(
_iter
49
=
(
*
(
this
->
query_record_array
)).
begin
();
_iter49
!=
(
*
(
this
->
query_record_array
)).
end
();
++
_iter49
)
std
::
vector
<
RowRecord
>
::
const_iterator
_iter
51
;
for
(
_iter
51
=
(
*
(
this
->
query_record_array
)).
begin
();
_iter51
!=
(
*
(
this
->
query_record_array
)).
end
();
++
_iter51
)
{
xfer
+=
(
*
_iter
49
).
write
(
oprot
);
xfer
+=
(
*
_iter
51
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1224,10 +1224,10 @@ uint32_t MilvusService_SearchVector_pargs::write(::apache::thrift::protocol::TPr
xfer
+=
oprot
->
writeFieldBegin
(
"query_range_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
4
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
((
*
(
this
->
query_range_array
)).
size
()));
std
::
vector
<
Range
>
::
const_iterator
_iter5
0
;
for
(
_iter5
0
=
(
*
(
this
->
query_range_array
)).
begin
();
_iter50
!=
(
*
(
this
->
query_range_array
)).
end
();
++
_iter50
)
std
::
vector
<
Range
>
::
const_iterator
_iter5
2
;
for
(
_iter5
2
=
(
*
(
this
->
query_range_array
)).
begin
();
_iter52
!=
(
*
(
this
->
query_range_array
)).
end
();
++
_iter52
)
{
xfer
+=
(
*
_iter5
0
).
write
(
oprot
);
xfer
+=
(
*
_iter5
2
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1272,14 +1272,14 @@ uint32_t MilvusService_SearchVector_result::read(::apache::thrift::protocol::TPr
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
success
.
clear
();
uint32_t
_size5
1
;
::
apache
::
thrift
::
protocol
::
TType
_etype5
4
;
xfer
+=
iprot
->
readListBegin
(
_etype5
4
,
_size51
);
this
->
success
.
resize
(
_size5
1
);
uint32_t
_i5
5
;
for
(
_i5
5
=
0
;
_i55
<
_size51
;
++
_i55
)
uint32_t
_size5
3
;
::
apache
::
thrift
::
protocol
::
TType
_etype5
6
;
xfer
+=
iprot
->
readListBegin
(
_etype5
6
,
_size53
);
this
->
success
.
resize
(
_size5
3
);
uint32_t
_i5
7
;
for
(
_i5
7
=
0
;
_i57
<
_size53
;
++
_i57
)
{
xfer
+=
this
->
success
[
_i5
5
].
read
(
iprot
);
xfer
+=
this
->
success
[
_i5
7
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -1318,10 +1318,10 @@ uint32_t MilvusService_SearchVector_result::write(::apache::thrift::protocol::TP
xfer
+=
oprot
->
writeFieldBegin
(
"success"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
0
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
success
.
size
()));
std
::
vector
<
TopKQueryResult
>
::
const_iterator
_iter5
6
;
for
(
_iter5
6
=
this
->
success
.
begin
();
_iter56
!=
this
->
success
.
end
();
++
_iter56
)
std
::
vector
<
TopKQueryResult
>
::
const_iterator
_iter5
8
;
for
(
_iter5
8
=
this
->
success
.
begin
();
_iter58
!=
this
->
success
.
end
();
++
_iter58
)
{
xfer
+=
(
*
_iter5
6
).
write
(
oprot
);
xfer
+=
(
*
_iter5
8
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1366,14 +1366,357 @@ uint32_t MilvusService_SearchVector_presult::read(::apache::thrift::protocol::TP
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
(
*
(
this
->
success
)).
clear
();
uint32_t
_size57
;
::
apache
::
thrift
::
protocol
::
TType
_etype60
;
xfer
+=
iprot
->
readListBegin
(
_etype60
,
_size57
);
(
*
(
this
->
success
)).
resize
(
_size57
);
uint32_t
_i61
;
for
(
_i61
=
0
;
_i61
<
_size57
;
++
_i61
)
uint32_t
_size59
;
::
apache
::
thrift
::
protocol
::
TType
_etype62
;
xfer
+=
iprot
->
readListBegin
(
_etype62
,
_size59
);
(
*
(
this
->
success
)).
resize
(
_size59
);
uint32_t
_i63
;
for
(
_i63
=
0
;
_i63
<
_size59
;
++
_i63
)
{
xfer
+=
(
*
(
this
->
success
))[
_i63
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
this
->
__isset
.
success
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
case
1
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_STRUCT
)
{
xfer
+=
this
->
e
.
read
(
iprot
);
this
->
__isset
.
e
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
default:
xfer
+=
iprot
->
skip
(
ftype
);
break
;
}
xfer
+=
iprot
->
readFieldEnd
();
}
xfer
+=
iprot
->
readStructEnd
();
return
xfer
;
}
MilvusService_SearchVector2_args
::~
MilvusService_SearchVector2_args
()
throw
()
{
}
uint32_t
MilvusService_SearchVector2_args
::
read
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
)
{
::
apache
::
thrift
::
protocol
::
TInputRecursionTracker
tracker
(
*
iprot
);
uint32_t
xfer
=
0
;
std
::
string
fname
;
::
apache
::
thrift
::
protocol
::
TType
ftype
;
int16_t
fid
;
xfer
+=
iprot
->
readStructBegin
(
fname
);
using
::
apache
::
thrift
::
protocol
::
TProtocolException
;
while
(
true
)
{
xfer
+=
iprot
->
readFieldBegin
(
fname
,
ftype
,
fid
);
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_STOP
)
{
break
;
}
switch
(
fid
)
{
case
2
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_STRING
)
{
xfer
+=
iprot
->
readString
(
this
->
table_name
);
this
->
__isset
.
table_name
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
case
3
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
query_record_array
.
clear
();
uint32_t
_size64
;
::
apache
::
thrift
::
protocol
::
TType
_etype67
;
xfer
+=
iprot
->
readListBegin
(
_etype67
,
_size64
);
this
->
query_record_array
.
resize
(
_size64
);
uint32_t
_i68
;
for
(
_i68
=
0
;
_i68
<
_size64
;
++
_i68
)
{
xfer
+=
this
->
query_record_array
[
_i68
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
this
->
__isset
.
query_record_array
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
case
4
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
query_range_array
.
clear
();
uint32_t
_size69
;
::
apache
::
thrift
::
protocol
::
TType
_etype72
;
xfer
+=
iprot
->
readListBegin
(
_etype72
,
_size69
);
this
->
query_range_array
.
resize
(
_size69
);
uint32_t
_i73
;
for
(
_i73
=
0
;
_i73
<
_size69
;
++
_i73
)
{
xfer
+=
this
->
query_range_array
[
_i73
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
this
->
__isset
.
query_range_array
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
case
5
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_I64
)
{
xfer
+=
iprot
->
readI64
(
this
->
topk
);
this
->
__isset
.
topk
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
default:
xfer
+=
iprot
->
skip
(
ftype
);
break
;
}
xfer
+=
iprot
->
readFieldEnd
();
}
xfer
+=
iprot
->
readStructEnd
();
return
xfer
;
}
uint32_t
MilvusService_SearchVector2_args
::
write
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
)
const
{
uint32_t
xfer
=
0
;
::
apache
::
thrift
::
protocol
::
TOutputRecursionTracker
tracker
(
*
oprot
);
xfer
+=
oprot
->
writeStructBegin
(
"MilvusService_SearchVector2_args"
);
xfer
+=
oprot
->
writeFieldBegin
(
"table_name"
,
::
apache
::
thrift
::
protocol
::
T_STRING
,
2
);
xfer
+=
oprot
->
writeString
(
this
->
table_name
);
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldBegin
(
"query_record_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
3
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
query_record_array
.
size
()));
std
::
vector
<
RowRecord
>
::
const_iterator
_iter74
;
for
(
_iter74
=
this
->
query_record_array
.
begin
();
_iter74
!=
this
->
query_record_array
.
end
();
++
_iter74
)
{
xfer
+=
(
*
_iter74
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldBegin
(
"query_range_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
4
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
query_range_array
.
size
()));
std
::
vector
<
Range
>
::
const_iterator
_iter75
;
for
(
_iter75
=
this
->
query_range_array
.
begin
();
_iter75
!=
this
->
query_range_array
.
end
();
++
_iter75
)
{
xfer
+=
(
*
_iter75
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldBegin
(
"topk"
,
::
apache
::
thrift
::
protocol
::
T_I64
,
5
);
xfer
+=
oprot
->
writeI64
(
this
->
topk
);
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldStop
();
xfer
+=
oprot
->
writeStructEnd
();
return
xfer
;
}
MilvusService_SearchVector2_pargs
::~
MilvusService_SearchVector2_pargs
()
throw
()
{
}
uint32_t
MilvusService_SearchVector2_pargs
::
write
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
)
const
{
uint32_t
xfer
=
0
;
::
apache
::
thrift
::
protocol
::
TOutputRecursionTracker
tracker
(
*
oprot
);
xfer
+=
oprot
->
writeStructBegin
(
"MilvusService_SearchVector2_pargs"
);
xfer
+=
oprot
->
writeFieldBegin
(
"table_name"
,
::
apache
::
thrift
::
protocol
::
T_STRING
,
2
);
xfer
+=
oprot
->
writeString
((
*
(
this
->
table_name
)));
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldBegin
(
"query_record_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
3
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
((
*
(
this
->
query_record_array
)).
size
()));
std
::
vector
<
RowRecord
>
::
const_iterator
_iter76
;
for
(
_iter76
=
(
*
(
this
->
query_record_array
)).
begin
();
_iter76
!=
(
*
(
this
->
query_record_array
)).
end
();
++
_iter76
)
{
xfer
+=
(
*
_iter76
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldBegin
(
"query_range_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
4
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
((
*
(
this
->
query_range_array
)).
size
()));
std
::
vector
<
Range
>
::
const_iterator
_iter77
;
for
(
_iter77
=
(
*
(
this
->
query_range_array
)).
begin
();
_iter77
!=
(
*
(
this
->
query_range_array
)).
end
();
++
_iter77
)
{
xfer
+=
(
*
_iter77
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldBegin
(
"topk"
,
::
apache
::
thrift
::
protocol
::
T_I64
,
5
);
xfer
+=
oprot
->
writeI64
((
*
(
this
->
topk
)));
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldStop
();
xfer
+=
oprot
->
writeStructEnd
();
return
xfer
;
}
MilvusService_SearchVector2_result
::~
MilvusService_SearchVector2_result
()
throw
()
{
}
uint32_t
MilvusService_SearchVector2_result
::
read
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
)
{
::
apache
::
thrift
::
protocol
::
TInputRecursionTracker
tracker
(
*
iprot
);
uint32_t
xfer
=
0
;
std
::
string
fname
;
::
apache
::
thrift
::
protocol
::
TType
ftype
;
int16_t
fid
;
xfer
+=
iprot
->
readStructBegin
(
fname
);
using
::
apache
::
thrift
::
protocol
::
TProtocolException
;
while
(
true
)
{
xfer
+=
iprot
->
readFieldBegin
(
fname
,
ftype
,
fid
);
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_STOP
)
{
break
;
}
switch
(
fid
)
{
case
0
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
success
.
clear
();
uint32_t
_size78
;
::
apache
::
thrift
::
protocol
::
TType
_etype81
;
xfer
+=
iprot
->
readListBegin
(
_etype81
,
_size78
);
this
->
success
.
resize
(
_size78
);
uint32_t
_i82
;
for
(
_i82
=
0
;
_i82
<
_size78
;
++
_i82
)
{
xfer
+=
this
->
success
[
_i82
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
this
->
__isset
.
success
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
case
1
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_STRUCT
)
{
xfer
+=
this
->
e
.
read
(
iprot
);
this
->
__isset
.
e
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
default:
xfer
+=
iprot
->
skip
(
ftype
);
break
;
}
xfer
+=
iprot
->
readFieldEnd
();
}
xfer
+=
iprot
->
readStructEnd
();
return
xfer
;
}
uint32_t
MilvusService_SearchVector2_result
::
write
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
)
const
{
uint32_t
xfer
=
0
;
xfer
+=
oprot
->
writeStructBegin
(
"MilvusService_SearchVector2_result"
);
if
(
this
->
__isset
.
success
)
{
xfer
+=
oprot
->
writeFieldBegin
(
"success"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
0
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
success
.
size
()));
std
::
vector
<
TopKQueryBinResult
>
::
const_iterator
_iter83
;
for
(
_iter83
=
this
->
success
.
begin
();
_iter83
!=
this
->
success
.
end
();
++
_iter83
)
{
xfer
+=
(
*
_iter83
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
xfer
+=
oprot
->
writeFieldEnd
();
}
else
if
(
this
->
__isset
.
e
)
{
xfer
+=
oprot
->
writeFieldBegin
(
"e"
,
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
1
);
xfer
+=
this
->
e
.
write
(
oprot
);
xfer
+=
oprot
->
writeFieldEnd
();
}
xfer
+=
oprot
->
writeFieldStop
();
xfer
+=
oprot
->
writeStructEnd
();
return
xfer
;
}
MilvusService_SearchVector2_presult
::~
MilvusService_SearchVector2_presult
()
throw
()
{
}
uint32_t
MilvusService_SearchVector2_presult
::
read
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
)
{
::
apache
::
thrift
::
protocol
::
TInputRecursionTracker
tracker
(
*
iprot
);
uint32_t
xfer
=
0
;
std
::
string
fname
;
::
apache
::
thrift
::
protocol
::
TType
ftype
;
int16_t
fid
;
xfer
+=
iprot
->
readStructBegin
(
fname
);
using
::
apache
::
thrift
::
protocol
::
TProtocolException
;
while
(
true
)
{
xfer
+=
iprot
->
readFieldBegin
(
fname
,
ftype
,
fid
);
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_STOP
)
{
break
;
}
switch
(
fid
)
{
case
0
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
(
*
(
this
->
success
)).
clear
();
uint32_t
_size84
;
::
apache
::
thrift
::
protocol
::
TType
_etype87
;
xfer
+=
iprot
->
readListBegin
(
_etype87
,
_size84
);
(
*
(
this
->
success
)).
resize
(
_size84
);
uint32_t
_i88
;
for
(
_i88
=
0
;
_i88
<
_size84
;
++
_i88
)
{
xfer
+=
(
*
(
this
->
success
))[
_i
61
].
read
(
iprot
);
xfer
+=
(
*
(
this
->
success
))[
_i
88
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -1440,14 +1783,14 @@ uint32_t MilvusService_SearchVectorInFiles_args::read(::apache::thrift::protocol
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
file_id_array
.
clear
();
uint32_t
_size
62
;
::
apache
::
thrift
::
protocol
::
TType
_etype
65
;
xfer
+=
iprot
->
readListBegin
(
_etype
65
,
_size62
);
this
->
file_id_array
.
resize
(
_size
62
);
uint32_t
_i
66
;
for
(
_i
66
=
0
;
_i66
<
_size62
;
++
_i66
)
uint32_t
_size
89
;
::
apache
::
thrift
::
protocol
::
TType
_etype
92
;
xfer
+=
iprot
->
readListBegin
(
_etype
92
,
_size89
);
this
->
file_id_array
.
resize
(
_size
89
);
uint32_t
_i
93
;
for
(
_i
93
=
0
;
_i93
<
_size89
;
++
_i93
)
{
xfer
+=
iprot
->
readString
(
this
->
file_id_array
[
_i
66
]);
xfer
+=
iprot
->
readString
(
this
->
file_id_array
[
_i
93
]);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -1460,14 +1803,14 @@ uint32_t MilvusService_SearchVectorInFiles_args::read(::apache::thrift::protocol
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
query_record_array
.
clear
();
uint32_t
_size
67
;
::
apache
::
thrift
::
protocol
::
TType
_etype
70
;
xfer
+=
iprot
->
readListBegin
(
_etype
70
,
_size67
);
this
->
query_record_array
.
resize
(
_size
67
);
uint32_t
_i
71
;
for
(
_i
71
=
0
;
_i71
<
_size67
;
++
_i71
)
uint32_t
_size
94
;
::
apache
::
thrift
::
protocol
::
TType
_etype
97
;
xfer
+=
iprot
->
readListBegin
(
_etype
97
,
_size94
);
this
->
query_record_array
.
resize
(
_size
94
);
uint32_t
_i
98
;
for
(
_i
98
=
0
;
_i98
<
_size94
;
++
_i98
)
{
xfer
+=
this
->
query_record_array
[
_i
71
].
read
(
iprot
);
xfer
+=
this
->
query_record_array
[
_i
98
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -1480,14 +1823,14 @@ uint32_t MilvusService_SearchVectorInFiles_args::read(::apache::thrift::protocol
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
query_range_array
.
clear
();
uint32_t
_size
72
;
::
apache
::
thrift
::
protocol
::
TType
_etype
75
;
xfer
+=
iprot
->
readListBegin
(
_etype
75
,
_size72
);
this
->
query_range_array
.
resize
(
_size
72
);
uint32_t
_i
76
;
for
(
_i
76
=
0
;
_i76
<
_size72
;
++
_i76
)
uint32_t
_size
99
;
::
apache
::
thrift
::
protocol
::
TType
_etype
102
;
xfer
+=
iprot
->
readListBegin
(
_etype
102
,
_size99
);
this
->
query_range_array
.
resize
(
_size
99
);
uint32_t
_i
103
;
for
(
_i
103
=
0
;
_i103
<
_size99
;
++
_i103
)
{
xfer
+=
this
->
query_range_array
[
_i
76
].
read
(
iprot
);
xfer
+=
this
->
query_range_array
[
_i
103
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -1528,10 +1871,10 @@ uint32_t MilvusService_SearchVectorInFiles_args::write(::apache::thrift::protoco
xfer
+=
oprot
->
writeFieldBegin
(
"file_id_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
3
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRING
,
static_cast
<
uint32_t
>
(
this
->
file_id_array
.
size
()));
std
::
vector
<
std
::
string
>
::
const_iterator
_iter
77
;
for
(
_iter
77
=
this
->
file_id_array
.
begin
();
_iter77
!=
this
->
file_id_array
.
end
();
++
_iter77
)
std
::
vector
<
std
::
string
>
::
const_iterator
_iter
104
;
for
(
_iter
104
=
this
->
file_id_array
.
begin
();
_iter104
!=
this
->
file_id_array
.
end
();
++
_iter104
)
{
xfer
+=
oprot
->
writeString
((
*
_iter
77
));
xfer
+=
oprot
->
writeString
((
*
_iter
104
));
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1540,10 +1883,10 @@ uint32_t MilvusService_SearchVectorInFiles_args::write(::apache::thrift::protoco
xfer
+=
oprot
->
writeFieldBegin
(
"query_record_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
4
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
query_record_array
.
size
()));
std
::
vector
<
RowRecord
>
::
const_iterator
_iter
78
;
for
(
_iter
78
=
this
->
query_record_array
.
begin
();
_iter78
!=
this
->
query_record_array
.
end
();
++
_iter78
)
std
::
vector
<
RowRecord
>
::
const_iterator
_iter
105
;
for
(
_iter
105
=
this
->
query_record_array
.
begin
();
_iter105
!=
this
->
query_record_array
.
end
();
++
_iter105
)
{
xfer
+=
(
*
_iter
78
).
write
(
oprot
);
xfer
+=
(
*
_iter
105
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1552,10 +1895,10 @@ uint32_t MilvusService_SearchVectorInFiles_args::write(::apache::thrift::protoco
xfer
+=
oprot
->
writeFieldBegin
(
"query_range_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
5
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
query_range_array
.
size
()));
std
::
vector
<
Range
>
::
const_iterator
_iter
79
;
for
(
_iter
79
=
this
->
query_range_array
.
begin
();
_iter79
!=
this
->
query_range_array
.
end
();
++
_iter79
)
std
::
vector
<
Range
>
::
const_iterator
_iter
106
;
for
(
_iter
106
=
this
->
query_range_array
.
begin
();
_iter106
!=
this
->
query_range_array
.
end
();
++
_iter106
)
{
xfer
+=
(
*
_iter
79
).
write
(
oprot
);
xfer
+=
(
*
_iter
106
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1587,10 +1930,10 @@ uint32_t MilvusService_SearchVectorInFiles_pargs::write(::apache::thrift::protoc
xfer
+=
oprot
->
writeFieldBegin
(
"file_id_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
3
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRING
,
static_cast
<
uint32_t
>
((
*
(
this
->
file_id_array
)).
size
()));
std
::
vector
<
std
::
string
>
::
const_iterator
_iter
80
;
for
(
_iter
80
=
(
*
(
this
->
file_id_array
)).
begin
();
_iter80
!=
(
*
(
this
->
file_id_array
)).
end
();
++
_iter80
)
std
::
vector
<
std
::
string
>
::
const_iterator
_iter
107
;
for
(
_iter
107
=
(
*
(
this
->
file_id_array
)).
begin
();
_iter107
!=
(
*
(
this
->
file_id_array
)).
end
();
++
_iter107
)
{
xfer
+=
oprot
->
writeString
((
*
_iter
80
));
xfer
+=
oprot
->
writeString
((
*
_iter
107
));
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1599,10 +1942,10 @@ uint32_t MilvusService_SearchVectorInFiles_pargs::write(::apache::thrift::protoc
xfer
+=
oprot
->
writeFieldBegin
(
"query_record_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
4
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
((
*
(
this
->
query_record_array
)).
size
()));
std
::
vector
<
RowRecord
>
::
const_iterator
_iter
81
;
for
(
_iter
81
=
(
*
(
this
->
query_record_array
)).
begin
();
_iter81
!=
(
*
(
this
->
query_record_array
)).
end
();
++
_iter81
)
std
::
vector
<
RowRecord
>
::
const_iterator
_iter
108
;
for
(
_iter
108
=
(
*
(
this
->
query_record_array
)).
begin
();
_iter108
!=
(
*
(
this
->
query_record_array
)).
end
();
++
_iter108
)
{
xfer
+=
(
*
_iter
81
).
write
(
oprot
);
xfer
+=
(
*
_iter
108
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1611,10 +1954,10 @@ uint32_t MilvusService_SearchVectorInFiles_pargs::write(::apache::thrift::protoc
xfer
+=
oprot
->
writeFieldBegin
(
"query_range_array"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
5
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
((
*
(
this
->
query_range_array
)).
size
()));
std
::
vector
<
Range
>
::
const_iterator
_iter
82
;
for
(
_iter
82
=
(
*
(
this
->
query_range_array
)).
begin
();
_iter82
!=
(
*
(
this
->
query_range_array
)).
end
();
++
_iter82
)
std
::
vector
<
Range
>
::
const_iterator
_iter
109
;
for
(
_iter
109
=
(
*
(
this
->
query_range_array
)).
begin
();
_iter109
!=
(
*
(
this
->
query_range_array
)).
end
();
++
_iter109
)
{
xfer
+=
(
*
_iter
82
).
write
(
oprot
);
xfer
+=
(
*
_iter
109
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1659,14 +2002,14 @@ uint32_t MilvusService_SearchVectorInFiles_result::read(::apache::thrift::protoc
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
success
.
clear
();
uint32_t
_size
83
;
::
apache
::
thrift
::
protocol
::
TType
_etype
86
;
xfer
+=
iprot
->
readListBegin
(
_etype
86
,
_size83
);
this
->
success
.
resize
(
_size
83
);
uint32_t
_i
87
;
for
(
_i
87
=
0
;
_i87
<
_size83
;
++
_i87
)
uint32_t
_size
110
;
::
apache
::
thrift
::
protocol
::
TType
_etype
113
;
xfer
+=
iprot
->
readListBegin
(
_etype
113
,
_size110
);
this
->
success
.
resize
(
_size
110
);
uint32_t
_i
114
;
for
(
_i
114
=
0
;
_i114
<
_size110
;
++
_i114
)
{
xfer
+=
this
->
success
[
_i
87
].
read
(
iprot
);
xfer
+=
this
->
success
[
_i
114
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -1705,10 +2048,10 @@ uint32_t MilvusService_SearchVectorInFiles_result::write(::apache::thrift::proto
xfer
+=
oprot
->
writeFieldBegin
(
"success"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
0
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
,
static_cast
<
uint32_t
>
(
this
->
success
.
size
()));
std
::
vector
<
TopKQueryResult
>
::
const_iterator
_iter
88
;
for
(
_iter
88
=
this
->
success
.
begin
();
_iter88
!=
this
->
success
.
end
();
++
_iter88
)
std
::
vector
<
TopKQueryResult
>
::
const_iterator
_iter
115
;
for
(
_iter
115
=
this
->
success
.
begin
();
_iter115
!=
this
->
success
.
end
();
++
_iter115
)
{
xfer
+=
(
*
_iter
88
).
write
(
oprot
);
xfer
+=
(
*
_iter
115
).
write
(
oprot
);
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -1753,14 +2096,14 @@ uint32_t MilvusService_SearchVectorInFiles_presult::read(::apache::thrift::proto
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
(
*
(
this
->
success
)).
clear
();
uint32_t
_size
89
;
::
apache
::
thrift
::
protocol
::
TType
_etype
92
;
xfer
+=
iprot
->
readListBegin
(
_etype
92
,
_size89
);
(
*
(
this
->
success
)).
resize
(
_size
89
);
uint32_t
_i
93
;
for
(
_i
93
=
0
;
_i93
<
_size89
;
++
_i93
)
uint32_t
_size
116
;
::
apache
::
thrift
::
protocol
::
TType
_etype
119
;
xfer
+=
iprot
->
readListBegin
(
_etype
119
,
_size116
);
(
*
(
this
->
success
)).
resize
(
_size
116
);
uint32_t
_i
120
;
for
(
_i
120
=
0
;
_i120
<
_size116
;
++
_i120
)
{
xfer
+=
(
*
(
this
->
success
))[
_i
93
].
read
(
iprot
);
xfer
+=
(
*
(
this
->
success
))[
_i
120
].
read
(
iprot
);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -2291,14 +2634,14 @@ uint32_t MilvusService_ShowTables_result::read(::apache::thrift::protocol::TProt
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
this
->
success
.
clear
();
uint32_t
_size
94
;
::
apache
::
thrift
::
protocol
::
TType
_etype
97
;
xfer
+=
iprot
->
readListBegin
(
_etype
97
,
_size94
);
this
->
success
.
resize
(
_size
94
);
uint32_t
_i
98
;
for
(
_i
98
=
0
;
_i98
<
_size94
;
++
_i98
)
uint32_t
_size
121
;
::
apache
::
thrift
::
protocol
::
TType
_etype
124
;
xfer
+=
iprot
->
readListBegin
(
_etype
124
,
_size121
);
this
->
success
.
resize
(
_size
121
);
uint32_t
_i
125
;
for
(
_i
125
=
0
;
_i125
<
_size121
;
++
_i125
)
{
xfer
+=
iprot
->
readString
(
this
->
success
[
_i
98
]);
xfer
+=
iprot
->
readString
(
this
->
success
[
_i
125
]);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -2337,10 +2680,10 @@ uint32_t MilvusService_ShowTables_result::write(::apache::thrift::protocol::TPro
xfer
+=
oprot
->
writeFieldBegin
(
"success"
,
::
apache
::
thrift
::
protocol
::
T_LIST
,
0
);
{
xfer
+=
oprot
->
writeListBegin
(
::
apache
::
thrift
::
protocol
::
T_STRING
,
static_cast
<
uint32_t
>
(
this
->
success
.
size
()));
std
::
vector
<
std
::
string
>
::
const_iterator
_iter
99
;
for
(
_iter
99
=
this
->
success
.
begin
();
_iter99
!=
this
->
success
.
end
();
++
_iter99
)
std
::
vector
<
std
::
string
>
::
const_iterator
_iter
126
;
for
(
_iter
126
=
this
->
success
.
begin
();
_iter126
!=
this
->
success
.
end
();
++
_iter126
)
{
xfer
+=
oprot
->
writeString
((
*
_iter
99
));
xfer
+=
oprot
->
writeString
((
*
_iter
126
));
}
xfer
+=
oprot
->
writeListEnd
();
}
...
...
@@ -2385,14 +2728,14 @@ uint32_t MilvusService_ShowTables_presult::read(::apache::thrift::protocol::TPro
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_LIST
)
{
{
(
*
(
this
->
success
)).
clear
();
uint32_t
_size1
00
;
::
apache
::
thrift
::
protocol
::
TType
_etype1
03
;
xfer
+=
iprot
->
readListBegin
(
_etype1
03
,
_size100
);
(
*
(
this
->
success
)).
resize
(
_size1
00
);
uint32_t
_i1
04
;
for
(
_i1
04
=
0
;
_i104
<
_size100
;
++
_i104
)
uint32_t
_size1
27
;
::
apache
::
thrift
::
protocol
::
TType
_etype1
30
;
xfer
+=
iprot
->
readListBegin
(
_etype1
30
,
_size127
);
(
*
(
this
->
success
)).
resize
(
_size1
27
);
uint32_t
_i1
31
;
for
(
_i1
31
=
0
;
_i131
<
_size127
;
++
_i131
)
{
xfer
+=
iprot
->
readString
((
*
(
this
->
success
))[
_i1
04
]);
xfer
+=
iprot
->
readString
((
*
(
this
->
success
))[
_i1
31
]);
}
xfer
+=
iprot
->
readListEnd
();
}
...
...
@@ -2983,6 +3326,70 @@ void MilvusServiceClient::recv_SearchVector(std::vector<TopKQueryResult> & _retu
throw
::
apache
::
thrift
::
TApplicationException
(
::
apache
::
thrift
::
TApplicationException
::
MISSING_RESULT
,
"SearchVector failed: unknown result"
);
}
void
MilvusServiceClient
::
SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
send_SearchVector2
(
table_name
,
query_record_array
,
query_range_array
,
topk
);
recv_SearchVector2
(
_return
);
}
void
MilvusServiceClient
::
send_SearchVector2
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
int32_t
cseqid
=
0
;
oprot_
->
writeMessageBegin
(
"SearchVector2"
,
::
apache
::
thrift
::
protocol
::
T_CALL
,
cseqid
);
MilvusService_SearchVector2_pargs
args
;
args
.
table_name
=
&
table_name
;
args
.
query_record_array
=
&
query_record_array
;
args
.
query_range_array
=
&
query_range_array
;
args
.
topk
=
&
topk
;
args
.
write
(
oprot_
);
oprot_
->
writeMessageEnd
();
oprot_
->
getTransport
()
->
writeEnd
();
oprot_
->
getTransport
()
->
flush
();
}
void
MilvusServiceClient
::
recv_SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
)
{
int32_t
rseqid
=
0
;
std
::
string
fname
;
::
apache
::
thrift
::
protocol
::
TMessageType
mtype
;
iprot_
->
readMessageBegin
(
fname
,
mtype
,
rseqid
);
if
(
mtype
==
::
apache
::
thrift
::
protocol
::
T_EXCEPTION
)
{
::
apache
::
thrift
::
TApplicationException
x
;
x
.
read
(
iprot_
);
iprot_
->
readMessageEnd
();
iprot_
->
getTransport
()
->
readEnd
();
throw
x
;
}
if
(
mtype
!=
::
apache
::
thrift
::
protocol
::
T_REPLY
)
{
iprot_
->
skip
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
);
iprot_
->
readMessageEnd
();
iprot_
->
getTransport
()
->
readEnd
();
}
if
(
fname
.
compare
(
"SearchVector2"
)
!=
0
)
{
iprot_
->
skip
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
);
iprot_
->
readMessageEnd
();
iprot_
->
getTransport
()
->
readEnd
();
}
MilvusService_SearchVector2_presult
result
;
result
.
success
=
&
_return
;
result
.
read
(
iprot_
);
iprot_
->
readMessageEnd
();
iprot_
->
getTransport
()
->
readEnd
();
if
(
result
.
__isset
.
success
)
{
// _return pointer has now been filled
return
;
}
if
(
result
.
__isset
.
e
)
{
throw
result
.
e
;
}
throw
::
apache
::
thrift
::
TApplicationException
(
::
apache
::
thrift
::
TApplicationException
::
MISSING_RESULT
,
"SearchVector2 failed: unknown result"
);
}
void
MilvusServiceClient
::
SearchVectorInFiles
(
std
::
vector
<
TopKQueryResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>
&
file_id_array
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
send_SearchVectorInFiles
(
table_name
,
file_id_array
,
query_record_array
,
query_range_array
,
topk
);
...
...
@@ -3649,6 +4056,63 @@ void MilvusServiceProcessor::process_SearchVector(int32_t seqid, ::apache::thrif
}
}
void
MilvusServiceProcessor
::
process_SearchVector2
(
int32_t
seqid
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
,
void
*
callContext
)
{
void
*
ctx
=
NULL
;
if
(
this
->
eventHandler_
.
get
()
!=
NULL
)
{
ctx
=
this
->
eventHandler_
->
getContext
(
"MilvusService.SearchVector2"
,
callContext
);
}
::
apache
::
thrift
::
TProcessorContextFreer
freer
(
this
->
eventHandler_
.
get
(),
ctx
,
"MilvusService.SearchVector2"
);
if
(
this
->
eventHandler_
.
get
()
!=
NULL
)
{
this
->
eventHandler_
->
preRead
(
ctx
,
"MilvusService.SearchVector2"
);
}
MilvusService_SearchVector2_args
args
;
args
.
read
(
iprot
);
iprot
->
readMessageEnd
();
uint32_t
bytes
=
iprot
->
getTransport
()
->
readEnd
();
if
(
this
->
eventHandler_
.
get
()
!=
NULL
)
{
this
->
eventHandler_
->
postRead
(
ctx
,
"MilvusService.SearchVector2"
,
bytes
);
}
MilvusService_SearchVector2_result
result
;
try
{
iface_
->
SearchVector2
(
result
.
success
,
args
.
table_name
,
args
.
query_record_array
,
args
.
query_range_array
,
args
.
topk
);
result
.
__isset
.
success
=
true
;
}
catch
(
Exception
&
e
)
{
result
.
e
=
e
;
result
.
__isset
.
e
=
true
;
}
catch
(
const
std
::
exception
&
e
)
{
if
(
this
->
eventHandler_
.
get
()
!=
NULL
)
{
this
->
eventHandler_
->
handlerError
(
ctx
,
"MilvusService.SearchVector2"
);
}
::
apache
::
thrift
::
TApplicationException
x
(
e
.
what
());
oprot
->
writeMessageBegin
(
"SearchVector2"
,
::
apache
::
thrift
::
protocol
::
T_EXCEPTION
,
seqid
);
x
.
write
(
oprot
);
oprot
->
writeMessageEnd
();
oprot
->
getTransport
()
->
writeEnd
();
oprot
->
getTransport
()
->
flush
();
return
;
}
if
(
this
->
eventHandler_
.
get
()
!=
NULL
)
{
this
->
eventHandler_
->
preWrite
(
ctx
,
"MilvusService.SearchVector2"
);
}
oprot
->
writeMessageBegin
(
"SearchVector2"
,
::
apache
::
thrift
::
protocol
::
T_REPLY
,
seqid
);
result
.
write
(
oprot
);
oprot
->
writeMessageEnd
();
bytes
=
oprot
->
getTransport
()
->
writeEnd
();
oprot
->
getTransport
()
->
flush
();
if
(
this
->
eventHandler_
.
get
()
!=
NULL
)
{
this
->
eventHandler_
->
postWrite
(
ctx
,
"MilvusService.SearchVector2"
,
bytes
);
}
}
void
MilvusServiceProcessor
::
process_SearchVectorInFiles
(
int32_t
seqid
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
,
void
*
callContext
)
{
void
*
ctx
=
NULL
;
...
...
@@ -4455,6 +4919,97 @@ void MilvusServiceConcurrentClient::recv_SearchVector(std::vector<TopKQueryResul
}
// end while(true)
}
void
MilvusServiceConcurrentClient
::
SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
int32_t
seqid
=
send_SearchVector2
(
table_name
,
query_record_array
,
query_range_array
,
topk
);
recv_SearchVector2
(
_return
,
seqid
);
}
int32_t
MilvusServiceConcurrentClient
::
send_SearchVector2
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
int32_t
cseqid
=
this
->
sync_
.
generateSeqId
();
::
apache
::
thrift
::
async
::
TConcurrentSendSentry
sentry
(
&
this
->
sync_
);
oprot_
->
writeMessageBegin
(
"SearchVector2"
,
::
apache
::
thrift
::
protocol
::
T_CALL
,
cseqid
);
MilvusService_SearchVector2_pargs
args
;
args
.
table_name
=
&
table_name
;
args
.
query_record_array
=
&
query_record_array
;
args
.
query_range_array
=
&
query_range_array
;
args
.
topk
=
&
topk
;
args
.
write
(
oprot_
);
oprot_
->
writeMessageEnd
();
oprot_
->
getTransport
()
->
writeEnd
();
oprot_
->
getTransport
()
->
flush
();
sentry
.
commit
();
return
cseqid
;
}
void
MilvusServiceConcurrentClient
::
recv_SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
,
const
int32_t
seqid
)
{
int32_t
rseqid
=
0
;
std
::
string
fname
;
::
apache
::
thrift
::
protocol
::
TMessageType
mtype
;
// the read mutex gets dropped and reacquired as part of waitForWork()
// The destructor of this sentry wakes up other clients
::
apache
::
thrift
::
async
::
TConcurrentRecvSentry
sentry
(
&
this
->
sync_
,
seqid
);
while
(
true
)
{
if
(
!
this
->
sync_
.
getPending
(
fname
,
mtype
,
rseqid
))
{
iprot_
->
readMessageBegin
(
fname
,
mtype
,
rseqid
);
}
if
(
seqid
==
rseqid
)
{
if
(
mtype
==
::
apache
::
thrift
::
protocol
::
T_EXCEPTION
)
{
::
apache
::
thrift
::
TApplicationException
x
;
x
.
read
(
iprot_
);
iprot_
->
readMessageEnd
();
iprot_
->
getTransport
()
->
readEnd
();
sentry
.
commit
();
throw
x
;
}
if
(
mtype
!=
::
apache
::
thrift
::
protocol
::
T_REPLY
)
{
iprot_
->
skip
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
);
iprot_
->
readMessageEnd
();
iprot_
->
getTransport
()
->
readEnd
();
}
if
(
fname
.
compare
(
"SearchVector2"
)
!=
0
)
{
iprot_
->
skip
(
::
apache
::
thrift
::
protocol
::
T_STRUCT
);
iprot_
->
readMessageEnd
();
iprot_
->
getTransport
()
->
readEnd
();
// in a bad state, don't commit
using
::
apache
::
thrift
::
protocol
::
TProtocolException
;
throw
TProtocolException
(
TProtocolException
::
INVALID_DATA
);
}
MilvusService_SearchVector2_presult
result
;
result
.
success
=
&
_return
;
result
.
read
(
iprot_
);
iprot_
->
readMessageEnd
();
iprot_
->
getTransport
()
->
readEnd
();
if
(
result
.
__isset
.
success
)
{
// _return pointer has now been filled
sentry
.
commit
();
return
;
}
if
(
result
.
__isset
.
e
)
{
sentry
.
commit
();
throw
result
.
e
;
}
// in a bad state, don't commit
throw
::
apache
::
thrift
::
TApplicationException
(
::
apache
::
thrift
::
TApplicationException
::
MISSING_RESULT
,
"SearchVector2 failed: unknown result"
);
}
// seqid != rseqid
this
->
sync_
.
updatePending
(
fname
,
mtype
,
rseqid
);
// this will temporarily unlock the readMutex, and let other clients get work done
this
->
sync_
.
waitForWork
(
seqid
);
}
// end while(true)
}
void
MilvusServiceConcurrentClient
::
SearchVectorInFiles
(
std
::
vector
<
TopKQueryResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>
&
file_id_array
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
int32_t
seqid
=
send_SearchVectorInFiles
(
table_name
,
file_id_array
,
query_record_array
,
query_range_array
,
topk
);
...
...
cpp/src/thrift/gen-cpp/MilvusService.h
浏览文件 @
476d2192
...
...
@@ -104,6 +104,25 @@ class MilvusServiceIf {
*/
virtual
void
SearchVector
(
std
::
vector
<
TopKQueryResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
=
0
;
/**
* @brief Query vector
*
* This method is used to query vector in table.
*
* @param table_name, table_name is queried.
* @param query_record_array, all vector are going to be queried.
* @param query_range_array, optional ranges for conditional search. If not specified, search whole table
* @param topk, how many similarity vectors will be searched.
*
* @return query binary result array.
*
* @param table_name
* @param query_record_array
* @param query_range_array
* @param topk
*/
virtual
void
SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
=
0
;
/**
* @brief Internal use query interface
*
...
...
@@ -218,6 +237,9 @@ class MilvusServiceNull : virtual public MilvusServiceIf {
void
SearchVector
(
std
::
vector
<
TopKQueryResult
>
&
/* _return */
,
const
std
::
string
&
/* table_name */
,
const
std
::
vector
<
RowRecord
>
&
/* query_record_array */
,
const
std
::
vector
<
Range
>
&
/* query_range_array */
,
const
int64_t
/* topk */
)
{
return
;
}
void
SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
/* _return */
,
const
std
::
string
&
/* table_name */
,
const
std
::
vector
<
RowRecord
>
&
/* query_record_array */
,
const
std
::
vector
<
Range
>
&
/* query_range_array */
,
const
int64_t
/* topk */
)
{
return
;
}
void
SearchVectorInFiles
(
std
::
vector
<
TopKQueryResult
>
&
/* _return */
,
const
std
::
string
&
/* table_name */
,
const
std
::
vector
<
std
::
string
>
&
/* file_id_array */
,
const
std
::
vector
<
RowRecord
>
&
/* query_record_array */
,
const
std
::
vector
<
Range
>
&
/* query_range_array */
,
const
int64_t
/* topk */
)
{
return
;
}
...
...
@@ -912,6 +934,139 @@ class MilvusService_SearchVector_presult {
};
typedef
struct
_MilvusService_SearchVector2_args__isset
{
_MilvusService_SearchVector2_args__isset
()
:
table_name
(
false
),
query_record_array
(
false
),
query_range_array
(
false
),
topk
(
false
)
{}
bool
table_name
:
1
;
bool
query_record_array
:
1
;
bool
query_range_array
:
1
;
bool
topk
:
1
;
}
_MilvusService_SearchVector2_args__isset
;
class
MilvusService_SearchVector2_args
{
public:
MilvusService_SearchVector2_args
(
const
MilvusService_SearchVector2_args
&
);
MilvusService_SearchVector2_args
&
operator
=
(
const
MilvusService_SearchVector2_args
&
);
MilvusService_SearchVector2_args
()
:
table_name
(),
topk
(
0
)
{
}
virtual
~
MilvusService_SearchVector2_args
()
throw
();
std
::
string
table_name
;
std
::
vector
<
RowRecord
>
query_record_array
;
std
::
vector
<
Range
>
query_range_array
;
int64_t
topk
;
_MilvusService_SearchVector2_args__isset
__isset
;
void
__set_table_name
(
const
std
::
string
&
val
);
void
__set_query_record_array
(
const
std
::
vector
<
RowRecord
>
&
val
);
void
__set_query_range_array
(
const
std
::
vector
<
Range
>
&
val
);
void
__set_topk
(
const
int64_t
val
);
bool
operator
==
(
const
MilvusService_SearchVector2_args
&
rhs
)
const
{
if
(
!
(
table_name
==
rhs
.
table_name
))
return
false
;
if
(
!
(
query_record_array
==
rhs
.
query_record_array
))
return
false
;
if
(
!
(
query_range_array
==
rhs
.
query_range_array
))
return
false
;
if
(
!
(
topk
==
rhs
.
topk
))
return
false
;
return
true
;
}
bool
operator
!=
(
const
MilvusService_SearchVector2_args
&
rhs
)
const
{
return
!
(
*
this
==
rhs
);
}
bool
operator
<
(
const
MilvusService_SearchVector2_args
&
)
const
;
uint32_t
read
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
);
uint32_t
write
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
)
const
;
};
class
MilvusService_SearchVector2_pargs
{
public:
virtual
~
MilvusService_SearchVector2_pargs
()
throw
();
const
std
::
string
*
table_name
;
const
std
::
vector
<
RowRecord
>
*
query_record_array
;
const
std
::
vector
<
Range
>
*
query_range_array
;
const
int64_t
*
topk
;
uint32_t
write
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
)
const
;
};
typedef
struct
_MilvusService_SearchVector2_result__isset
{
_MilvusService_SearchVector2_result__isset
()
:
success
(
false
),
e
(
false
)
{}
bool
success
:
1
;
bool
e
:
1
;
}
_MilvusService_SearchVector2_result__isset
;
class
MilvusService_SearchVector2_result
{
public:
MilvusService_SearchVector2_result
(
const
MilvusService_SearchVector2_result
&
);
MilvusService_SearchVector2_result
&
operator
=
(
const
MilvusService_SearchVector2_result
&
);
MilvusService_SearchVector2_result
()
{
}
virtual
~
MilvusService_SearchVector2_result
()
throw
();
std
::
vector
<
TopKQueryBinResult
>
success
;
Exception
e
;
_MilvusService_SearchVector2_result__isset
__isset
;
void
__set_success
(
const
std
::
vector
<
TopKQueryBinResult
>
&
val
);
void
__set_e
(
const
Exception
&
val
);
bool
operator
==
(
const
MilvusService_SearchVector2_result
&
rhs
)
const
{
if
(
!
(
success
==
rhs
.
success
))
return
false
;
if
(
!
(
e
==
rhs
.
e
))
return
false
;
return
true
;
}
bool
operator
!=
(
const
MilvusService_SearchVector2_result
&
rhs
)
const
{
return
!
(
*
this
==
rhs
);
}
bool
operator
<
(
const
MilvusService_SearchVector2_result
&
)
const
;
uint32_t
read
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
);
uint32_t
write
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
)
const
;
};
typedef
struct
_MilvusService_SearchVector2_presult__isset
{
_MilvusService_SearchVector2_presult__isset
()
:
success
(
false
),
e
(
false
)
{}
bool
success
:
1
;
bool
e
:
1
;
}
_MilvusService_SearchVector2_presult__isset
;
class
MilvusService_SearchVector2_presult
{
public:
virtual
~
MilvusService_SearchVector2_presult
()
throw
();
std
::
vector
<
TopKQueryBinResult
>
*
success
;
Exception
e
;
_MilvusService_SearchVector2_presult__isset
__isset
;
uint32_t
read
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
);
};
typedef
struct
_MilvusService_SearchVectorInFiles_args__isset
{
_MilvusService_SearchVectorInFiles_args__isset
()
:
table_name
(
false
),
file_id_array
(
false
),
query_record_array
(
false
),
query_range_array
(
false
),
topk
(
false
)
{}
bool
table_name
:
1
;
...
...
@@ -1531,6 +1686,9 @@ class MilvusServiceClient : virtual public MilvusServiceIf {
void
SearchVector
(
std
::
vector
<
TopKQueryResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
void
send_SearchVector
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
void
recv_SearchVector
(
std
::
vector
<
TopKQueryResult
>
&
_return
);
void
SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
void
send_SearchVector2
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
void
recv_SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
);
void
SearchVectorInFiles
(
std
::
vector
<
TopKQueryResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>
&
file_id_array
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
void
send_SearchVectorInFiles
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>
&
file_id_array
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
void
recv_SearchVectorInFiles
(
std
::
vector
<
TopKQueryResult
>
&
_return
);
...
...
@@ -1567,6 +1725,7 @@ class MilvusServiceProcessor : public ::apache::thrift::TDispatchProcessor {
void
process_BuildIndex
(
int32_t
seqid
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
,
void
*
callContext
);
void
process_AddVector
(
int32_t
seqid
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
,
void
*
callContext
);
void
process_SearchVector
(
int32_t
seqid
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
,
void
*
callContext
);
void
process_SearchVector2
(
int32_t
seqid
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
,
void
*
callContext
);
void
process_SearchVectorInFiles
(
int32_t
seqid
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
,
void
*
callContext
);
void
process_DescribeTable
(
int32_t
seqid
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
,
void
*
callContext
);
void
process_GetTableRowCount
(
int32_t
seqid
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
,
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
,
void
*
callContext
);
...
...
@@ -1581,6 +1740,7 @@ class MilvusServiceProcessor : public ::apache::thrift::TDispatchProcessor {
processMap_
[
"BuildIndex"
]
=
&
MilvusServiceProcessor
::
process_BuildIndex
;
processMap_
[
"AddVector"
]
=
&
MilvusServiceProcessor
::
process_AddVector
;
processMap_
[
"SearchVector"
]
=
&
MilvusServiceProcessor
::
process_SearchVector
;
processMap_
[
"SearchVector2"
]
=
&
MilvusServiceProcessor
::
process_SearchVector2
;
processMap_
[
"SearchVectorInFiles"
]
=
&
MilvusServiceProcessor
::
process_SearchVectorInFiles
;
processMap_
[
"DescribeTable"
]
=
&
MilvusServiceProcessor
::
process_DescribeTable
;
processMap_
[
"GetTableRowCount"
]
=
&
MilvusServiceProcessor
::
process_GetTableRowCount
;
...
...
@@ -1670,6 +1830,16 @@ class MilvusServiceMultiface : virtual public MilvusServiceIf {
return
;
}
void
SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
size_t
sz
=
ifaces_
.
size
();
size_t
i
=
0
;
for
(;
i
<
(
sz
-
1
);
++
i
)
{
ifaces_
[
i
]
->
SearchVector2
(
_return
,
table_name
,
query_record_array
,
query_range_array
,
topk
);
}
ifaces_
[
i
]
->
SearchVector2
(
_return
,
table_name
,
query_record_array
,
query_range_array
,
topk
);
return
;
}
void
SearchVectorInFiles
(
std
::
vector
<
TopKQueryResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>
&
file_id_array
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
size_t
sz
=
ifaces_
.
size
();
size_t
i
=
0
;
...
...
@@ -1767,6 +1937,9 @@ class MilvusServiceConcurrentClient : virtual public MilvusServiceIf {
void
SearchVector
(
std
::
vector
<
TopKQueryResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
int32_t
send_SearchVector
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
void
recv_SearchVector
(
std
::
vector
<
TopKQueryResult
>
&
_return
,
const
int32_t
seqid
);
void
SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
int32_t
send_SearchVector2
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
void
recv_SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
,
const
int32_t
seqid
);
void
SearchVectorInFiles
(
std
::
vector
<
TopKQueryResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>
&
file_id_array
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
int32_t
send_SearchVectorInFiles
(
const
std
::
string
&
table_name
,
const
std
::
vector
<
std
::
string
>
&
file_id_array
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
);
void
recv_SearchVectorInFiles
(
std
::
vector
<
TopKQueryResult
>
&
_return
,
const
int32_t
seqid
);
...
...
cpp/src/thrift/gen-cpp/MilvusService_server.skeleton.cpp
浏览文件 @
476d2192
...
...
@@ -120,6 +120,28 @@ class MilvusServiceHandler : virtual public MilvusServiceIf {
printf
(
"SearchVector
\n
"
);
}
/**
* @brief Query vector
*
* This method is used to query vector in table.
*
* @param table_name, table_name is queried.
* @param query_record_array, all vector are going to be queried.
* @param query_range_array, optional ranges for conditional search. If not specified, search whole table
* @param topk, how many similarity vectors will be searched.
*
* @return query binary result array.
*
* @param table_name
* @param query_record_array
* @param query_range_array
* @param topk
*/
void
SearchVector2
(
std
::
vector
<
TopKQueryBinResult
>
&
_return
,
const
std
::
string
&
table_name
,
const
std
::
vector
<
RowRecord
>
&
query_record_array
,
const
std
::
vector
<
Range
>
&
query_range_array
,
const
int64_t
topk
)
{
// Your implementation goes here
printf
(
"SearchVector2
\n
"
);
}
/**
* @brief Internal use query interface
*
...
...
cpp/src/thrift/gen-cpp/milvus_types.cpp
浏览文件 @
476d2192
...
...
@@ -781,4 +781,119 @@ void TopKQueryResult::printTo(std::ostream& out) const {
out
<<
")"
;
}
TopKQueryBinResult
::~
TopKQueryBinResult
()
throw
()
{
}
void
TopKQueryBinResult
::
__set_id_array
(
const
std
::
string
&
val
)
{
this
->
id_array
=
val
;
}
void
TopKQueryBinResult
::
__set_distance_array
(
const
std
::
string
&
val
)
{
this
->
distance_array
=
val
;
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
TopKQueryBinResult
&
obj
)
{
obj
.
printTo
(
out
);
return
out
;
}
uint32_t
TopKQueryBinResult
::
read
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
)
{
::
apache
::
thrift
::
protocol
::
TInputRecursionTracker
tracker
(
*
iprot
);
uint32_t
xfer
=
0
;
std
::
string
fname
;
::
apache
::
thrift
::
protocol
::
TType
ftype
;
int16_t
fid
;
xfer
+=
iprot
->
readStructBegin
(
fname
);
using
::
apache
::
thrift
::
protocol
::
TProtocolException
;
bool
isset_id_array
=
false
;
bool
isset_distance_array
=
false
;
while
(
true
)
{
xfer
+=
iprot
->
readFieldBegin
(
fname
,
ftype
,
fid
);
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_STOP
)
{
break
;
}
switch
(
fid
)
{
case
1
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_STRING
)
{
xfer
+=
iprot
->
readBinary
(
this
->
id_array
);
isset_id_array
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
case
2
:
if
(
ftype
==
::
apache
::
thrift
::
protocol
::
T_STRING
)
{
xfer
+=
iprot
->
readBinary
(
this
->
distance_array
);
isset_distance_array
=
true
;
}
else
{
xfer
+=
iprot
->
skip
(
ftype
);
}
break
;
default:
xfer
+=
iprot
->
skip
(
ftype
);
break
;
}
xfer
+=
iprot
->
readFieldEnd
();
}
xfer
+=
iprot
->
readStructEnd
();
if
(
!
isset_id_array
)
throw
TProtocolException
(
TProtocolException
::
INVALID_DATA
);
if
(
!
isset_distance_array
)
throw
TProtocolException
(
TProtocolException
::
INVALID_DATA
);
return
xfer
;
}
uint32_t
TopKQueryBinResult
::
write
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
)
const
{
uint32_t
xfer
=
0
;
::
apache
::
thrift
::
protocol
::
TOutputRecursionTracker
tracker
(
*
oprot
);
xfer
+=
oprot
->
writeStructBegin
(
"TopKQueryBinResult"
);
xfer
+=
oprot
->
writeFieldBegin
(
"id_array"
,
::
apache
::
thrift
::
protocol
::
T_STRING
,
1
);
xfer
+=
oprot
->
writeBinary
(
this
->
id_array
);
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldBegin
(
"distance_array"
,
::
apache
::
thrift
::
protocol
::
T_STRING
,
2
);
xfer
+=
oprot
->
writeBinary
(
this
->
distance_array
);
xfer
+=
oprot
->
writeFieldEnd
();
xfer
+=
oprot
->
writeFieldStop
();
xfer
+=
oprot
->
writeStructEnd
();
return
xfer
;
}
void
swap
(
TopKQueryBinResult
&
a
,
TopKQueryBinResult
&
b
)
{
using
::
std
::
swap
;
swap
(
a
.
id_array
,
b
.
id_array
);
swap
(
a
.
distance_array
,
b
.
distance_array
);
}
TopKQueryBinResult
::
TopKQueryBinResult
(
const
TopKQueryBinResult
&
other19
)
{
id_array
=
other19
.
id_array
;
distance_array
=
other19
.
distance_array
;
}
TopKQueryBinResult
&
TopKQueryBinResult
::
operator
=
(
const
TopKQueryBinResult
&
other20
)
{
id_array
=
other20
.
id_array
;
distance_array
=
other20
.
distance_array
;
return
*
this
;
}
void
TopKQueryBinResult
::
printTo
(
std
::
ostream
&
out
)
const
{
using
::
apache
::
thrift
::
to_string
;
out
<<
"TopKQueryBinResult("
;
out
<<
"id_array="
<<
to_string
(
id_array
);
out
<<
", "
<<
"distance_array="
<<
to_string
(
distance_array
);
out
<<
")"
;
}
}}
// namespace
cpp/src/thrift/gen-cpp/milvus_types.h
浏览文件 @
476d2192
...
...
@@ -63,6 +63,8 @@ class QueryResult;
class
TopKQueryResult
;
class
TopKQueryBinResult
;
typedef
struct
_Exception__isset
{
_Exception__isset
()
:
code
(
false
),
reason
(
false
)
{}
bool
code
:
1
;
...
...
@@ -346,6 +348,47 @@ void swap(TopKQueryResult &a, TopKQueryResult &b);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
TopKQueryResult
&
obj
);
class
TopKQueryBinResult
:
public
virtual
::
apache
::
thrift
::
TBase
{
public:
TopKQueryBinResult
(
const
TopKQueryBinResult
&
);
TopKQueryBinResult
&
operator
=
(
const
TopKQueryBinResult
&
);
TopKQueryBinResult
()
:
id_array
(),
distance_array
()
{
}
virtual
~
TopKQueryBinResult
()
throw
();
std
::
string
id_array
;
std
::
string
distance_array
;
void
__set_id_array
(
const
std
::
string
&
val
);
void
__set_distance_array
(
const
std
::
string
&
val
);
bool
operator
==
(
const
TopKQueryBinResult
&
rhs
)
const
{
if
(
!
(
id_array
==
rhs
.
id_array
))
return
false
;
if
(
!
(
distance_array
==
rhs
.
distance_array
))
return
false
;
return
true
;
}
bool
operator
!=
(
const
TopKQueryBinResult
&
rhs
)
const
{
return
!
(
*
this
==
rhs
);
}
bool
operator
<
(
const
TopKQueryBinResult
&
)
const
;
uint32_t
read
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
iprot
);
uint32_t
write
(
::
apache
::
thrift
::
protocol
::
TProtocol
*
oprot
)
const
;
virtual
void
printTo
(
std
::
ostream
&
out
)
const
;
};
void
swap
(
TopKQueryBinResult
&
a
,
TopKQueryBinResult
&
b
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
TopKQueryBinResult
&
obj
);
}}
// namespace
#endif
cpp/src/thrift/milvus.thrift
浏览文件 @
476d2192
...
...
@@ -84,6 +84,14 @@ struct TopKQueryResult {
1: list<QueryResult> query_result_arrays; ///< TopK query result
}
/**
* @brief TopK query binary result
*/
struct TopKQueryBinResult {
1: required binary id_array; ///< id array, interger array
2: required binary distance_array; ///< distance array, double array
}
service MilvusService {
/**
* @brief Create table method
...
...
@@ -158,6 +166,23 @@ service MilvusService {
4: list<Range> query_range_array,
5: i64 topk) throws(1: Exception e);
/**
* @brief Query vector
*
* This method is used to query vector in table.
*
* @param table_name, table_name is queried.
* @param query_record_array, all vector are going to be queried.
* @param query_range_array, optional ranges for conditional search. If not specified, search whole table
* @param topk, how many similarity vectors will be searched.
*
* @return query binary result array.
*/
list<TopKQueryBinResult> SearchVector2(2: string table_name,
3: list<RowRecord> query_record_array,
4: list<Range> query_range_array,
5: i64 topk) throws(1: Exception e);
/**
* @brief Internal use query interface
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录