diff --git a/CHANGELOG.md b/CHANGELOG.md index cb07803e74..327b1f9b3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,6 @@ # Changelog Please mark all change in change log and use the ticket from JIRA. - # Milvus 0.6.0 (TODO) ## Bug @@ -22,8 +21,23 @@ Please mark all change in change log and use the ticket from JIRA. ## Task +# Milvus 0.5.3 (2019-11-13) -# Milvus 0.5.2 (TODO) +## Bug +- \#258 - Bytes type in proto cause big-endian/little-endian problem + +## Feature + +## Improvement +- \#204 - improve grpc performance in search +- \#207 - Add more unittest for config set/get +- \#208 - optimize unittest to support run single test more easily +- \#284 - Change C++ SDK to shared library +- \#260 - C++ SDK README + +## Task + +# Milvus 0.5.2 (2019-11-07) ## Bug - \#194 - Search faild: message="Table file doesn't exist" @@ -31,7 +45,7 @@ Please mark all change in change log and use the ticket from JIRA. ## Feature ## Improvement -- \#190 - Update default config:use_blas_threshold to 1100 and server version printout to 0.52 +- \#190 - Update default config:use_blas_threshold to 1100 and server version printout to 0.5.2 ## Task diff --git a/core/.gitignore b/core/.gitignore index c8563a1f1e..74e41dba6b 100644 --- a/core/.gitignore +++ b/core/.gitignore @@ -2,7 +2,7 @@ milvus/ conf/server_config.yaml conf/log_config.conf src/config.h -version.h +src/version.h lcov_out/ base.info output.info diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 2e6fdfc46e..45a2bc5fe6 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -67,7 +67,7 @@ if (MILVUS_VERSION_MAJOR STREQUAL "" OR MILVUS_VERSION_PATCH STREQUAL "") message(WARNING "Failed to determine Milvus version from git branch name") set(MILVUS_VERSION "0.6.0") -endif () +endif() message(STATUS "Build version = ${MILVUS_VERSION}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h @ONLY) diff --git a/core/src/grpc/README.md b/core/src/grpc/README.md new file mode 100644 index 0000000000..44c4e90841 --- /dev/null +++ b/core/src/grpc/README.md @@ -0,0 +1,6 @@ +We manually change two APIs in "milvus.pd.h": + add_vector_data() + add_row_id_array() + add_ids() + add_distances() +If proto files need be generated again, remember to re-change above APIs. \ No newline at end of file diff --git a/core/src/grpc/cpp_gen.sh b/core/src/grpc/cpp_gen.sh old mode 100644 new mode 100755 diff --git a/core/src/grpc/gen-milvus/milvus.grpc.pb.cc b/core/src/grpc/gen-milvus/milvus.grpc.pb.cc index 9cb5e70d3d..2bf8e321f8 100644 --- a/core/src/grpc/gen-milvus/milvus.grpc.pb.cc +++ b/core/src/grpc/gen-milvus/milvus.grpc.pb.cc @@ -431,60 +431,60 @@ void MilvusService::Stub::experimental_async::Insert(::grpc::ClientContext* cont return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::VectorIds>::Create(channel_.get(), cq, rpcmethod_Insert_, context, request, false); } -::grpc::Status MilvusService::Stub::Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::milvus::grpc::TopKQueryResultList* response) { +::grpc::Status MilvusService::Stub::Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::milvus::grpc::TopKQueryResult* response) { return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Search_, context, request, response); } -void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResultList* response, std::function f) { +void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResult* response, std::function f) { ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Search_, context, request, response, std::move(f)); } -void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, std::function f) { +void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, std::function f) { ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Search_, context, request, response, std::move(f)); } -void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) { ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Search_, context, request, response, reactor); } -void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) { ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Search_, context, request, response, reactor); } -::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>* MilvusService::Stub::AsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TopKQueryResultList>::Create(channel_.get(), cq, rpcmethod_Search_, context, request, true); +::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>* MilvusService::Stub::AsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(channel_.get(), cq, rpcmethod_Search_, context, request, true); } -::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>* MilvusService::Stub::PrepareAsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TopKQueryResultList>::Create(channel_.get(), cq, rpcmethod_Search_, context, request, false); +::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>* MilvusService::Stub::PrepareAsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(channel_.get(), cq, rpcmethod_Search_, context, request, false); } -::grpc::Status MilvusService::Stub::SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::milvus::grpc::TopKQueryResultList* response) { +::grpc::Status MilvusService::Stub::SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::milvus::grpc::TopKQueryResult* response) { return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_SearchInFiles_, context, request, response); } -void MilvusService::Stub::experimental_async::SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResultList* response, std::function f) { +void MilvusService::Stub::experimental_async::SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResult* response, std::function f) { ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_SearchInFiles_, context, request, response, std::move(f)); } -void MilvusService::Stub::experimental_async::SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, std::function f) { +void MilvusService::Stub::experimental_async::SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, std::function f) { ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_SearchInFiles_, context, request, response, std::move(f)); } -void MilvusService::Stub::experimental_async::SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void MilvusService::Stub::experimental_async::SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) { ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_SearchInFiles_, context, request, response, reactor); } -void MilvusService::Stub::experimental_async::SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) { +void MilvusService::Stub::experimental_async::SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) { ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_SearchInFiles_, context, request, response, reactor); } -::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>* MilvusService::Stub::AsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TopKQueryResultList>::Create(channel_.get(), cq, rpcmethod_SearchInFiles_, context, request, true); +::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>* MilvusService::Stub::AsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(channel_.get(), cq, rpcmethod_SearchInFiles_, context, request, true); } -::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>* MilvusService::Stub::PrepareAsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TopKQueryResultList>::Create(channel_.get(), cq, rpcmethod_SearchInFiles_, context, request, false); +::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>* MilvusService::Stub::PrepareAsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(channel_.get(), cq, rpcmethod_SearchInFiles_, context, request, false); } ::grpc::Status MilvusService::Stub::Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::StringReply* response) { @@ -640,12 +640,12 @@ MilvusService::Service::Service() { AddMethod(new ::grpc::internal::RpcServiceMethod( MilvusService_method_names[13], ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::SearchParam, ::milvus::grpc::TopKQueryResultList>( + new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::SearchParam, ::milvus::grpc::TopKQueryResult>( std::mem_fn(&MilvusService::Service::Search), this))); AddMethod(new ::grpc::internal::RpcServiceMethod( MilvusService_method_names[14], ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::SearchInFilesParam, ::milvus::grpc::TopKQueryResultList>( + new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::SearchInFilesParam, ::milvus::grpc::TopKQueryResult>( std::mem_fn(&MilvusService::Service::SearchInFiles), this))); AddMethod(new ::grpc::internal::RpcServiceMethod( MilvusService_method_names[15], @@ -758,14 +758,14 @@ MilvusService::Service::~Service() { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } -::grpc::Status MilvusService::Service::Search(::grpc::ServerContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResultList* response) { +::grpc::Status MilvusService::Service::Search(::grpc::ServerContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResult* response) { (void) context; (void) request; (void) response; return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } -::grpc::Status MilvusService::Service::SearchInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResultList* response) { +::grpc::Status MilvusService::Service::SearchInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResult* response) { (void) context; (void) request; (void) response; diff --git a/core/src/grpc/gen-milvus/milvus.grpc.pb.h b/core/src/grpc/gen-milvus/milvus.grpc.pb.h index 439984f543..e19d90f832 100644 --- a/core/src/grpc/gen-milvus/milvus.grpc.pb.h +++ b/core/src/grpc/gen-milvus/milvus.grpc.pb.h @@ -221,26 +221,26 @@ class MilvusService final { // // @param SearchParam, search parameters. // - // @return TopKQueryResultList - virtual ::grpc::Status Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::milvus::grpc::TopKQueryResultList* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>> AsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>>(AsyncSearchRaw(context, request, cq)); + // @return TopKQueryResult + virtual ::grpc::Status Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::milvus::grpc::TopKQueryResult* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>> AsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>>(AsyncSearchRaw(context, request, cq)); } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>> PrepareAsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>>(PrepareAsyncSearchRaw(context, request, cq)); + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>> PrepareAsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>>(PrepareAsyncSearchRaw(context, request, cq)); } // * // @brief This method is used to query vector in specified files. // // @param SearchInFilesParam, search in files paremeters. // - // @return TopKQueryResultList - virtual ::grpc::Status SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::milvus::grpc::TopKQueryResultList* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>> AsyncSearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>>(AsyncSearchInFilesRaw(context, request, cq)); + // @return TopKQueryResult + virtual ::grpc::Status SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::milvus::grpc::TopKQueryResult* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>> AsyncSearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>>(AsyncSearchInFilesRaw(context, request, cq)); } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>> PrepareAsyncSearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>>(PrepareAsyncSearchInFilesRaw(context, request, cq)); + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>> PrepareAsyncSearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>>(PrepareAsyncSearchInFilesRaw(context, request, cq)); } // * // @brief This method is used to give the server status. @@ -419,21 +419,21 @@ class MilvusService final { // // @param SearchParam, search parameters. // - // @return TopKQueryResultList - virtual void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResultList* response, std::function) = 0; - virtual void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, std::function) = 0; - virtual void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; + // @return TopKQueryResult + virtual void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResult* response, std::function) = 0; + virtual void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, std::function) = 0; + virtual void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; + virtual void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; // * // @brief This method is used to query vector in specified files. // // @param SearchInFilesParam, search in files paremeters. // - // @return TopKQueryResultList - virtual void SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResultList* response, std::function) = 0; - virtual void SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, std::function) = 0; - virtual void SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; + // @return TopKQueryResult + virtual void SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResult* response, std::function) = 0; + virtual void SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, std::function) = 0; + virtual void SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; + virtual void SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; // * // @brief This method is used to give the server status. // @@ -493,10 +493,10 @@ class MilvusService final { virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncDropPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::VectorIds>* AsyncInsertRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::VectorIds>* PrepareAsyncInsertRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>* AsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>* PrepareAsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>* AsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResultList>* PrepareAsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>* AsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>* PrepareAsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>* AsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TopKQueryResult>* PrepareAsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::StringReply>* AsyncCmdRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::StringReply>* PrepareAsyncCmdRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncDeleteByDateRaw(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByDateParam& request, ::grpc::CompletionQueue* cq) = 0; @@ -598,19 +598,19 @@ class MilvusService final { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>> PrepareAsyncInsert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>>(PrepareAsyncInsertRaw(context, request, cq)); } - ::grpc::Status Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::milvus::grpc::TopKQueryResultList* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>> AsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>>(AsyncSearchRaw(context, request, cq)); + ::grpc::Status Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::milvus::grpc::TopKQueryResult* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>> AsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>>(AsyncSearchRaw(context, request, cq)); } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>> PrepareAsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>>(PrepareAsyncSearchRaw(context, request, cq)); + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>> PrepareAsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>>(PrepareAsyncSearchRaw(context, request, cq)); } - ::grpc::Status SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::milvus::grpc::TopKQueryResultList* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>> AsyncSearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>>(AsyncSearchInFilesRaw(context, request, cq)); + ::grpc::Status SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::milvus::grpc::TopKQueryResult* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>> AsyncSearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>>(AsyncSearchInFilesRaw(context, request, cq)); } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>> PrepareAsyncSearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>>(PrepareAsyncSearchInFilesRaw(context, request, cq)); + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>> PrepareAsyncSearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>>(PrepareAsyncSearchInFilesRaw(context, request, cq)); } ::grpc::Status Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::StringReply* response) override; std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>> AsyncCmd(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { @@ -688,14 +688,14 @@ class MilvusService final { void Insert(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::VectorIds* response, std::function) override; void Insert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam* request, ::milvus::grpc::VectorIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; void Insert(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::VectorIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResultList* response, std::function) override; - void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, std::function) override; - void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResultList* response, std::function) override; - void SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, std::function) override; - void SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResultList* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; + void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResult* response, std::function) override; + void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, std::function) override; + void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; + void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; + void SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResult* response, std::function) override; + void SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, std::function) override; + void SearchInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; + void SearchInFiles(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; void Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::StringReply* response, std::function) override; void Cmd(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::StringReply* response, std::function) override; void Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::StringReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; @@ -745,10 +745,10 @@ class MilvusService final { ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncDropPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>* AsyncInsertRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>* PrepareAsyncInsertRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>* AsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>* PrepareAsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>* AsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResultList>* PrepareAsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>* AsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>* PrepareAsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>* AsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TopKQueryResult>* PrepareAsyncSearchInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInFilesParam& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>* AsyncCmdRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>* PrepareAsyncCmdRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncDeleteByDateRaw(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByDateParam& request, ::grpc::CompletionQueue* cq) override; @@ -876,15 +876,15 @@ class MilvusService final { // // @param SearchParam, search parameters. // - // @return TopKQueryResultList - virtual ::grpc::Status Search(::grpc::ServerContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResultList* response); + // @return TopKQueryResult + virtual ::grpc::Status Search(::grpc::ServerContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::TopKQueryResult* response); // * // @brief This method is used to query vector in specified files. // // @param SearchInFilesParam, search in files paremeters. // - // @return TopKQueryResultList - virtual ::grpc::Status SearchInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResultList* response); + // @return TopKQueryResult + virtual ::grpc::Status SearchInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchInFilesParam* request, ::milvus::grpc::TopKQueryResult* response); // * // @brief This method is used to give the server status. // @@ -1179,11 +1179,11 @@ class MilvusService final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - void RequestSearch(::grpc::ServerContext* context, ::milvus::grpc::SearchParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::TopKQueryResultList>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + void RequestSearch(::grpc::ServerContext* context, ::milvus::grpc::SearchParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::TopKQueryResult>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncUnary(13, context, request, response, new_call_cq, notification_cq, tag); } }; @@ -1199,11 +1199,11 @@ class MilvusService final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - void RequestSearchInFiles(::grpc::ServerContext* context, ::milvus::grpc::SearchInFilesParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::TopKQueryResultList>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + void RequestSearchInFiles(::grpc::ServerContext* context, ::milvus::grpc::SearchInFilesParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::TopKQueryResult>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncUnary(14, context, request, response, new_call_cq, notification_cq, tag); } }; @@ -1678,17 +1678,17 @@ class MilvusService final { public: ExperimentalWithCallbackMethod_Search() { ::grpc::Service::experimental().MarkMethodCallback(13, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchParam, ::milvus::grpc::TopKQueryResultList>( + new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchParam, ::milvus::grpc::TopKQueryResult>( [this](::grpc::ServerContext* context, const ::milvus::grpc::SearchParam* request, - ::milvus::grpc::TopKQueryResultList* response, + ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ServerCallbackRpcController* controller) { return this->Search(context, request, response, controller); })); } void SetMessageAllocatorFor_Search( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::SearchParam, ::milvus::grpc::TopKQueryResultList>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchParam, ::milvus::grpc::TopKQueryResultList>*>( + ::grpc::experimental::MessageAllocator< ::milvus::grpc::SearchParam, ::milvus::grpc::TopKQueryResult>* allocator) { + static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchParam, ::milvus::grpc::TopKQueryResult>*>( ::grpc::Service::experimental().GetHandler(13)) ->SetMessageAllocator(allocator); } @@ -1696,11 +1696,11 @@ class MilvusService final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - virtual void Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + virtual void Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } }; template class ExperimentalWithCallbackMethod_SearchInFiles : public BaseClass { @@ -1709,17 +1709,17 @@ class MilvusService final { public: ExperimentalWithCallbackMethod_SearchInFiles() { ::grpc::Service::experimental().MarkMethodCallback(14, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchInFilesParam, ::milvus::grpc::TopKQueryResultList>( + new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchInFilesParam, ::milvus::grpc::TopKQueryResult>( [this](::grpc::ServerContext* context, const ::milvus::grpc::SearchInFilesParam* request, - ::milvus::grpc::TopKQueryResultList* response, + ::milvus::grpc::TopKQueryResult* response, ::grpc::experimental::ServerCallbackRpcController* controller) { return this->SearchInFiles(context, request, response, controller); })); } void SetMessageAllocatorFor_SearchInFiles( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::SearchInFilesParam, ::milvus::grpc::TopKQueryResultList>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchInFilesParam, ::milvus::grpc::TopKQueryResultList>*>( + ::grpc::experimental::MessageAllocator< ::milvus::grpc::SearchInFilesParam, ::milvus::grpc::TopKQueryResult>* allocator) { + static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchInFilesParam, ::milvus::grpc::TopKQueryResult>*>( ::grpc::Service::experimental().GetHandler(14)) ->SetMessageAllocator(allocator); } @@ -1727,11 +1727,11 @@ class MilvusService final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - virtual void SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + virtual void SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } }; template class ExperimentalWithCallbackMethod_Cmd : public BaseClass { @@ -2060,7 +2060,7 @@ class MilvusService final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } @@ -2077,7 +2077,7 @@ class MilvusService final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } @@ -2405,7 +2405,7 @@ class MilvusService final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } @@ -2425,7 +2425,7 @@ class MilvusService final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } @@ -2837,7 +2837,7 @@ class MilvusService final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } @@ -2862,7 +2862,7 @@ class MilvusService final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } @@ -3210,18 +3210,18 @@ class MilvusService final { public: WithStreamedUnaryMethod_Search() { ::grpc::Service::MarkMethodStreamed(13, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::SearchParam, ::milvus::grpc::TopKQueryResultList>(std::bind(&WithStreamedUnaryMethod_Search::StreamedSearch, this, std::placeholders::_1, std::placeholders::_2))); + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::SearchParam, ::milvus::grpc::TopKQueryResult>(std::bind(&WithStreamedUnaryMethod_Search::StreamedSearch, this, std::placeholders::_1, std::placeholders::_2))); } ~WithStreamedUnaryMethod_Search() override { BaseClassMustBeDerivedFromService(this); } // disable regular version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } // replace default version of method with streamed unary - virtual ::grpc::Status StreamedSearch(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::SearchParam,::milvus::grpc::TopKQueryResultList>* server_unary_streamer) = 0; + virtual ::grpc::Status StreamedSearch(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::SearchParam,::milvus::grpc::TopKQueryResult>* server_unary_streamer) = 0; }; template class WithStreamedUnaryMethod_SearchInFiles : public BaseClass { @@ -3230,18 +3230,18 @@ class MilvusService final { public: WithStreamedUnaryMethod_SearchInFiles() { ::grpc::Service::MarkMethodStreamed(14, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::SearchInFilesParam, ::milvus::grpc::TopKQueryResultList>(std::bind(&WithStreamedUnaryMethod_SearchInFiles::StreamedSearchInFiles, this, std::placeholders::_1, std::placeholders::_2))); + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::SearchInFilesParam, ::milvus::grpc::TopKQueryResult>(std::bind(&WithStreamedUnaryMethod_SearchInFiles::StreamedSearchInFiles, this, std::placeholders::_1, std::placeholders::_2))); } ~WithStreamedUnaryMethod_SearchInFiles() override { BaseClassMustBeDerivedFromService(this); } // disable regular version of this method - ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResultList* /*response*/) override { + ::grpc::Status SearchInFiles(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInFilesParam* /*request*/, ::milvus::grpc::TopKQueryResult* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } // replace default version of method with streamed unary - virtual ::grpc::Status StreamedSearchInFiles(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::SearchInFilesParam,::milvus::grpc::TopKQueryResultList>* server_unary_streamer) = 0; + virtual ::grpc::Status StreamedSearchInFiles(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::SearchInFilesParam,::milvus::grpc::TopKQueryResult>* server_unary_streamer) = 0; }; template class WithStreamedUnaryMethod_Cmd : public BaseClass { diff --git a/core/src/grpc/gen-milvus/milvus.pb.cc b/core/src/grpc/gen-milvus/milvus.pb.cc index c381c4f4db..cbc1b1118f 100644 --- a/core/src/grpc/gen-milvus/milvus.pb.cc +++ b/core/src/grpc/gen-milvus/milvus.pb.cc @@ -17,12 +17,10 @@ #include extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Index_milvus_2eproto; extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PartitionParam_milvus_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_QueryResult_milvus_2eproto; extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Range_milvus_2eproto; extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RowRecord_milvus_2eproto; extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_SearchParam_milvus_2eproto; extern PROTOBUF_INTERNAL_EXPORT_status_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Status_status_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TopKQueryResult_milvus_2eproto; namespace milvus { namespace grpc { class TableNameDefaultTypeInternal { @@ -73,18 +71,10 @@ class SearchInFilesParamDefaultTypeInternal { public: ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; } _SearchInFilesParam_default_instance_; -class QueryResultDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _QueryResult_default_instance_; class TopKQueryResultDefaultTypeInternal { public: ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; } _TopKQueryResult_default_instance_; -class TopKQueryResultListDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _TopKQueryResultList_default_instance_; class StringReplyDefaultTypeInternal { public: ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; @@ -248,20 +238,6 @@ static void InitDefaultsscc_info_PartitionParam_milvus_2eproto() { ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PartitionParam_milvus_2eproto = {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_PartitionParam_milvus_2eproto}, {}}; -static void InitDefaultsscc_info_QueryResult_milvus_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_QueryResult_default_instance_; - new (ptr) ::milvus::grpc::QueryResult(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::QueryResult::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_QueryResult_milvus_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_QueryResult_milvus_2eproto}, {}}; - static void InitDefaultsscc_info_Range_milvus_2eproto() { GOOGLE_PROTOBUF_VERIFY_VERSION; @@ -408,23 +384,7 @@ static void InitDefaultsscc_info_TopKQueryResult_milvus_2eproto() { ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TopKQueryResult_milvus_2eproto = {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_TopKQueryResult_milvus_2eproto}, { - &scc_info_QueryResult_milvus_2eproto.base,}}; - -static void InitDefaultsscc_info_TopKQueryResultList_milvus_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_TopKQueryResultList_default_instance_; - new (ptr) ::milvus::grpc::TopKQueryResultList(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::TopKQueryResultList::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_TopKQueryResultList_milvus_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_TopKQueryResultList_milvus_2eproto}, { - &scc_info_Status_status_2eproto.base, - &scc_info_TopKQueryResult_milvus_2eproto.base,}}; + &scc_info_Status_status_2eproto.base,}}; static void InitDefaultsscc_info_VectorIds_milvus_2eproto() { GOOGLE_PROTOBUF_VERIFY_VERSION; @@ -441,7 +401,7 @@ static void InitDefaultsscc_info_VectorIds_milvus_2eproto() { {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_VectorIds_milvus_2eproto}, { &scc_info_Status_status_2eproto.base,}}; -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_milvus_2eproto[22]; +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_milvus_2eproto[20]; static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_milvus_2eproto = nullptr; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_milvus_2eproto = nullptr; @@ -538,25 +498,14 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_milvus_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchInFilesParam, file_id_array_), PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchInFilesParam, search_param_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, id_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, distance_), - ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::milvus::grpc::TopKQueryResult, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TopKQueryResult, query_result_arrays_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TopKQueryResultList, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TopKQueryResultList, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TopKQueryResultList, topk_query_result_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TopKQueryResult, status_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TopKQueryResult, row_num_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TopKQueryResult, ids_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TopKQueryResult, distances_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::milvus::grpc::StringReply, _internal_metadata_), ~0u, // no _extensions_ @@ -620,16 +569,14 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB { 66, -1, sizeof(::milvus::grpc::VectorIds)}, { 73, -1, sizeof(::milvus::grpc::SearchParam)}, { 84, -1, sizeof(::milvus::grpc::SearchInFilesParam)}, - { 91, -1, sizeof(::milvus::grpc::QueryResult)}, - { 98, -1, sizeof(::milvus::grpc::TopKQueryResult)}, - { 104, -1, sizeof(::milvus::grpc::TopKQueryResultList)}, - { 111, -1, sizeof(::milvus::grpc::StringReply)}, - { 118, -1, sizeof(::milvus::grpc::BoolReply)}, - { 125, -1, sizeof(::milvus::grpc::TableRowCount)}, - { 132, -1, sizeof(::milvus::grpc::Command)}, - { 138, -1, sizeof(::milvus::grpc::Index)}, - { 145, -1, sizeof(::milvus::grpc::IndexParam)}, - { 153, -1, sizeof(::milvus::grpc::DeleteByDateParam)}, + { 91, -1, sizeof(::milvus::grpc::TopKQueryResult)}, + { 100, -1, sizeof(::milvus::grpc::StringReply)}, + { 107, -1, sizeof(::milvus::grpc::BoolReply)}, + { 114, -1, sizeof(::milvus::grpc::TableRowCount)}, + { 121, -1, sizeof(::milvus::grpc::Command)}, + { 127, -1, sizeof(::milvus::grpc::Index)}, + { 134, -1, sizeof(::milvus::grpc::IndexParam)}, + { 142, -1, sizeof(::milvus::grpc::DeleteByDateParam)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -645,9 +592,7 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = reinterpret_cast(&::milvus::grpc::_VectorIds_default_instance_), reinterpret_cast(&::milvus::grpc::_SearchParam_default_instance_), reinterpret_cast(&::milvus::grpc::_SearchInFilesParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_QueryResult_default_instance_), reinterpret_cast(&::milvus::grpc::_TopKQueryResult_default_instance_), - reinterpret_cast(&::milvus::grpc::_TopKQueryResultList_default_instance_), reinterpret_cast(&::milvus::grpc::_StringReply_default_instance_), reinterpret_cast(&::milvus::grpc::_BoolReply_default_instance_), reinterpret_cast(&::milvus::grpc::_TableRowCount_default_instance_), @@ -685,60 +630,57 @@ const char descriptor_table_protodef_milvus_2eproto[] PROTOBUF_SECTION_VARIABLE( "\005 \001(\003\022\033\n\023partition_tag_array\030\006 \003(\t\"[\n\022Se" "archInFilesParam\022\025\n\rfile_id_array\030\001 \003(\t\022" ".\n\014search_param\030\002 \001(\0132\030.milvus.grpc.Sear" - "chParam\"+\n\013QueryResult\022\n\n\002id\030\001 \001(\003\022\020\n\010di" - "stance\030\002 \001(\001\"H\n\017TopKQueryResult\0225\n\023query" - "_result_arrays\030\001 \003(\0132\030.milvus.grpc.Query" - "Result\"s\n\023TopKQueryResultList\022#\n\006status\030" - "\001 \001(\0132\023.milvus.grpc.Status\0227\n\021topk_query" - "_result\030\002 \003(\0132\034.milvus.grpc.TopKQueryRes" - "ult\"H\n\013StringReply\022#\n\006status\030\001 \001(\0132\023.mil" - "vus.grpc.Status\022\024\n\014string_reply\030\002 \001(\t\"D\n" - "\tBoolReply\022#\n\006status\030\001 \001(\0132\023.milvus.grpc" - ".Status\022\022\n\nbool_reply\030\002 \001(\010\"M\n\rTableRowC" - "ount\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.Statu" - "s\022\027\n\017table_row_count\030\002 \001(\003\"\026\n\007Command\022\013\n" - "\003cmd\030\001 \001(\t\"*\n\005Index\022\022\n\nindex_type\030\001 \001(\005\022" - "\r\n\005nlist\030\002 \001(\005\"h\n\nIndexParam\022#\n\006status\030\001" - " \001(\0132\023.milvus.grpc.Status\022\022\n\ntable_name\030" - "\002 \001(\t\022!\n\005index\030\003 \001(\0132\022.milvus.grpc.Index" - "\"J\n\021DeleteByDateParam\022!\n\005range\030\001 \001(\0132\022.m" - "ilvus.grpc.Range\022\022\n\ntable_name\030\002 \001(\t2\302\t\n" - "\rMilvusService\022>\n\013CreateTable\022\030.milvus.g" - "rpc.TableSchema\032\023.milvus.grpc.Status\"\000\022<" - "\n\010HasTable\022\026.milvus.grpc.TableName\032\026.mil" - "vus.grpc.BoolReply\"\000\022C\n\rDescribeTable\022\026." - "milvus.grpc.TableName\032\030.milvus.grpc.Tabl" - "eSchema\"\000\022B\n\nCountTable\022\026.milvus.grpc.Ta" - "bleName\032\032.milvus.grpc.TableRowCount\"\000\022@\n" - "\nShowTables\022\024.milvus.grpc.Command\032\032.milv" - "us.grpc.TableNameList\"\000\022:\n\tDropTable\022\026.m" - "ilvus.grpc.TableName\032\023.milvus.grpc.Statu" - "s\"\000\022=\n\013CreateIndex\022\027.milvus.grpc.IndexPa" - "ram\032\023.milvus.grpc.Status\"\000\022B\n\rDescribeIn" - "dex\022\026.milvus.grpc.TableName\032\027.milvus.grp" - "c.IndexParam\"\000\022:\n\tDropIndex\022\026.milvus.grp" - "c.TableName\032\023.milvus.grpc.Status\"\000\022E\n\017Cr" - "eatePartition\022\033.milvus.grpc.PartitionPar" - "am\032\023.milvus.grpc.Status\"\000\022F\n\016ShowPartiti" - "ons\022\026.milvus.grpc.TableName\032\032.milvus.grp" - "c.PartitionList\"\000\022C\n\rDropPartition\022\033.mil" - "vus.grpc.PartitionParam\032\023.milvus.grpc.St" - "atus\"\000\022<\n\006Insert\022\030.milvus.grpc.InsertPar" - "am\032\026.milvus.grpc.VectorIds\"\000\022F\n\006Search\022\030" - ".milvus.grpc.SearchParam\032 .milvus.grpc.T" - "opKQueryResultList\"\000\022T\n\rSearchInFiles\022\037." - "milvus.grpc.SearchInFilesParam\032 .milvus." - "grpc.TopKQueryResultList\"\000\0227\n\003Cmd\022\024.milv" - "us.grpc.Command\032\030.milvus.grpc.StringRepl" - "y\"\000\022E\n\014DeleteByDate\022\036.milvus.grpc.Delete" - "ByDateParam\032\023.milvus.grpc.Status\"\000\022=\n\014Pr" - "eloadTable\022\026.milvus.grpc.TableName\032\023.mil" - "vus.grpc.Status\"\000b\006proto3" + "chParam\"g\n\017TopKQueryResult\022#\n\006status\030\001 \001" + "(\0132\023.milvus.grpc.Status\022\017\n\007row_num\030\002 \001(\003" + "\022\013\n\003ids\030\003 \003(\003\022\021\n\tdistances\030\004 \003(\002\"H\n\013Stri" + "ngReply\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.St" + "atus\022\024\n\014string_reply\030\002 \001(\t\"D\n\tBoolReply\022" + "#\n\006status\030\001 \001(\0132\023.milvus.grpc.Status\022\022\n\n" + "bool_reply\030\002 \001(\010\"M\n\rTableRowCount\022#\n\006sta" + "tus\030\001 \001(\0132\023.milvus.grpc.Status\022\027\n\017table_" + "row_count\030\002 \001(\003\"\026\n\007Command\022\013\n\003cmd\030\001 \001(\t\"" + "*\n\005Index\022\022\n\nindex_type\030\001 \001(\005\022\r\n\005nlist\030\002 " + "\001(\005\"h\n\nIndexParam\022#\n\006status\030\001 \001(\0132\023.milv" + "us.grpc.Status\022\022\n\ntable_name\030\002 \001(\t\022!\n\005in" + "dex\030\003 \001(\0132\022.milvus.grpc.Index\"J\n\021DeleteB" + "yDateParam\022!\n\005range\030\001 \001(\0132\022.milvus.grpc." + "Range\022\022\n\ntable_name\030\002 \001(\t2\272\t\n\rMilvusServ" + "ice\022>\n\013CreateTable\022\030.milvus.grpc.TableSc" + "hema\032\023.milvus.grpc.Status\"\000\022<\n\010HasTable\022" + "\026.milvus.grpc.TableName\032\026.milvus.grpc.Bo" + "olReply\"\000\022C\n\rDescribeTable\022\026.milvus.grpc" + ".TableName\032\030.milvus.grpc.TableSchema\"\000\022B" + "\n\nCountTable\022\026.milvus.grpc.TableName\032\032.m" + "ilvus.grpc.TableRowCount\"\000\022@\n\nShowTables" + "\022\024.milvus.grpc.Command\032\032.milvus.grpc.Tab" + "leNameList\"\000\022:\n\tDropTable\022\026.milvus.grpc." + "TableName\032\023.milvus.grpc.Status\"\000\022=\n\013Crea" + "teIndex\022\027.milvus.grpc.IndexParam\032\023.milvu" + "s.grpc.Status\"\000\022B\n\rDescribeIndex\022\026.milvu" + "s.grpc.TableName\032\027.milvus.grpc.IndexPara" + "m\"\000\022:\n\tDropIndex\022\026.milvus.grpc.TableName" + "\032\023.milvus.grpc.Status\"\000\022E\n\017CreatePartiti" + "on\022\033.milvus.grpc.PartitionParam\032\023.milvus" + ".grpc.Status\"\000\022F\n\016ShowPartitions\022\026.milvu" + "s.grpc.TableName\032\032.milvus.grpc.Partition" + "List\"\000\022C\n\rDropPartition\022\033.milvus.grpc.Pa" + "rtitionParam\032\023.milvus.grpc.Status\"\000\022<\n\006I" + "nsert\022\030.milvus.grpc.InsertParam\032\026.milvus" + ".grpc.VectorIds\"\000\022B\n\006Search\022\030.milvus.grp" + "c.SearchParam\032\034.milvus.grpc.TopKQueryRes" + "ult\"\000\022P\n\rSearchInFiles\022\037.milvus.grpc.Sea" + "rchInFilesParam\032\034.milvus.grpc.TopKQueryR" + "esult\"\000\0227\n\003Cmd\022\024.milvus.grpc.Command\032\030.m" + "ilvus.grpc.StringReply\"\000\022E\n\014DeleteByDate" + "\022\036.milvus.grpc.DeleteByDateParam\032\023.milvu" + "s.grpc.Status\"\000\022=\n\014PreloadTable\022\026.milvus" + ".grpc.TableName\032\023.milvus.grpc.Status\"\000b\006" + "proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_milvus_2eproto_deps[1] = { &::descriptor_table_status_2eproto, }; -static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_milvus_2eproto_sccs[22] = { +static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_milvus_2eproto_sccs[20] = { &scc_info_BoolReply_milvus_2eproto.base, &scc_info_Command_milvus_2eproto.base, &scc_info_DeleteByDateParam_milvus_2eproto.base, @@ -748,7 +690,6 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_mil &scc_info_PartitionList_milvus_2eproto.base, &scc_info_PartitionName_milvus_2eproto.base, &scc_info_PartitionParam_milvus_2eproto.base, - &scc_info_QueryResult_milvus_2eproto.base, &scc_info_Range_milvus_2eproto.base, &scc_info_RowRecord_milvus_2eproto.base, &scc_info_SearchInFilesParam_milvus_2eproto.base, @@ -759,16 +700,15 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_mil &scc_info_TableRowCount_milvus_2eproto.base, &scc_info_TableSchema_milvus_2eproto.base, &scc_info_TopKQueryResult_milvus_2eproto.base, - &scc_info_TopKQueryResultList_milvus_2eproto.base, &scc_info_VectorIds_milvus_2eproto.base, }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_milvus_2eproto_once; static bool descriptor_table_milvus_2eproto_initialized = false; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_milvus_2eproto = { - &descriptor_table_milvus_2eproto_initialized, descriptor_table_protodef_milvus_2eproto, "milvus.proto", 3025, - &descriptor_table_milvus_2eproto_once, descriptor_table_milvus_2eproto_sccs, descriptor_table_milvus_2eproto_deps, 22, 1, + &descriptor_table_milvus_2eproto_initialized, descriptor_table_protodef_milvus_2eproto, "milvus.proto", 2886, + &descriptor_table_milvus_2eproto_once, descriptor_table_milvus_2eproto_sccs, descriptor_table_milvus_2eproto_deps, 20, 1, schemas, file_default_instances, TableStruct_milvus_2eproto::offsets, - file_level_metadata_milvus_2eproto, 22, file_level_enum_descriptors_milvus_2eproto, file_level_service_descriptors_milvus_2eproto, + file_level_metadata_milvus_2eproto, 20, file_level_enum_descriptors_milvus_2eproto, file_level_service_descriptors_milvus_2eproto, }; // Force running AddDescriptors() at dynamic initialization time. @@ -5091,308 +5031,27 @@ void SearchInFilesParam::InternalSwap(SearchInFilesParam* other) { } -// =================================================================== - -void QueryResult::InitAsDefaultInstance() { -} -class QueryResult::_Internal { - public: -}; - -QueryResult::QueryResult() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.QueryResult) -} -QueryResult::QueryResult(const QueryResult& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&id_, &from.id_, - static_cast(reinterpret_cast(&distance_) - - reinterpret_cast(&id_)) + sizeof(distance_)); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.QueryResult) -} - -void QueryResult::SharedCtor() { - ::memset(&id_, 0, static_cast( - reinterpret_cast(&distance_) - - reinterpret_cast(&id_)) + sizeof(distance_)); -} - -QueryResult::~QueryResult() { - // @@protoc_insertion_point(destructor:milvus.grpc.QueryResult) - SharedDtor(); -} - -void QueryResult::SharedDtor() { -} - -void QueryResult::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const QueryResult& QueryResult::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_QueryResult_milvus_2eproto.base); - return *internal_default_instance(); -} - - -void QueryResult::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.QueryResult) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&id_, 0, static_cast( - reinterpret_cast(&distance_) - - reinterpret_cast(&id_)) + sizeof(distance_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* QueryResult::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // int64 id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // double distance = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 17)) { - distance_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(double); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool QueryResult::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.QueryResult) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // int64 id = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &id_))); - } else { - goto handle_unusual; - } - break; - } - - // double distance = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (17 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>( - input, &distance_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.QueryResult) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.QueryResult) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void QueryResult::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.QueryResult) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int64 id = 1; - if (this->id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->id(), output); - } - - // double distance = 2; - if (!(this->distance() <= 0 && this->distance() >= 0)) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDouble(2, this->distance(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.QueryResult) -} - -::PROTOBUF_NAMESPACE_ID::uint8* QueryResult::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.QueryResult) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int64 id = 1; - if (this->id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->id(), target); - } - - // double distance = 2; - if (!(this->distance() <= 0 && this->distance() >= 0)) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(2, this->distance(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.QueryResult) - return target; -} - -size_t QueryResult::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.QueryResult) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // int64 id = 1; - if (this->id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->id()); - } - - // double distance = 2; - if (!(this->distance() <= 0 && this->distance() >= 0)) { - total_size += 1 + 8; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void QueryResult::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.QueryResult) - GOOGLE_DCHECK_NE(&from, this); - const QueryResult* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.QueryResult) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.QueryResult) - MergeFrom(*source); - } -} - -void QueryResult::MergeFrom(const QueryResult& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.QueryResult) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.id() != 0) { - set_id(from.id()); - } - if (!(from.distance() <= 0 && from.distance() >= 0)) { - set_distance(from.distance()); - } -} - -void QueryResult::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.QueryResult) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void QueryResult::CopyFrom(const QueryResult& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.QueryResult) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool QueryResult::IsInitialized() const { - return true; -} - -void QueryResult::InternalSwap(QueryResult* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(id_, other->id_); - swap(distance_, other->distance_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata QueryResult::GetMetadata() const { - return GetMetadataStatic(); -} - - // =================================================================== void TopKQueryResult::InitAsDefaultInstance() { + ::milvus::grpc::_TopKQueryResult_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( + ::milvus::grpc::Status::internal_default_instance()); } class TopKQueryResult::_Internal { public: + static const ::milvus::grpc::Status& status(const TopKQueryResult* msg); }; +const ::milvus::grpc::Status& +TopKQueryResult::_Internal::status(const TopKQueryResult* msg) { + return *msg->status_; +} +void TopKQueryResult::clear_status() { + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; +} TopKQueryResult::TopKQueryResult() : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { SharedCtor(); @@ -5401,13 +5060,23 @@ TopKQueryResult::TopKQueryResult() TopKQueryResult::TopKQueryResult(const TopKQueryResult& from) : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr), - query_result_arrays_(from.query_result_arrays_) { + ids_(from.ids_), + distances_(from.distances_) { _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_status()) { + status_ = new ::milvus::grpc::Status(*from.status_); + } else { + status_ = nullptr; + } + row_num_ = from.row_num_; // @@protoc_insertion_point(copy_constructor:milvus.grpc.TopKQueryResult) } void TopKQueryResult::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TopKQueryResult_milvus_2eproto.base); + ::memset(&status_, 0, static_cast( + reinterpret_cast(&row_num_) - + reinterpret_cast(&status_)) + sizeof(row_num_)); } TopKQueryResult::~TopKQueryResult() { @@ -5416,6 +5085,7 @@ TopKQueryResult::~TopKQueryResult() { } void TopKQueryResult::SharedDtor() { + if (this != internal_default_instance()) delete status_; } void TopKQueryResult::SetCachedSize(int size) const { @@ -5433,7 +5103,13 @@ void TopKQueryResult::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - query_result_arrays_.Clear(); + ids_.Clear(); + distances_.Clear(); + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; + row_num_ = PROTOBUF_LONGLONG(0); _internal_metadata_.Clear(); } @@ -5445,16 +5121,38 @@ const char* TopKQueryResult::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPAC ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); CHK_(ptr); switch (tag >> 3) { - // repeated .milvus.grpc.QueryResult query_result_arrays = 1; + // .milvus.grpc.Status status = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_query_result_arrays(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10); + ptr = ctx->ParseMessage(mutable_status(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 row_num = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + row_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // repeated int64 ids = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_ids(), ptr, ctx); + CHK_(ptr); + } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) { + add_ids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); + CHK_(ptr); + } else goto handle_unusual; + continue; + // repeated float distances = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(mutable_distances(), ptr, ctx); + CHK_(ptr); + } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37) { + add_distances(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); + ptr += sizeof(float); } else goto handle_unusual; continue; default: { @@ -5487,11 +5185,56 @@ bool TopKQueryResult::MergePartialFromCodedStream( tag = p.first; if (!p.second) goto handle_unusual; switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .milvus.grpc.QueryResult query_result_arrays = 1; + // .milvus.grpc.Status status = 1; case 1: { if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_query_result_arrays())); + input, mutable_status())); + } else { + goto handle_unusual; + } + break; + } + + // int64 row_num = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &row_num_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 ids = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_ids()))); + } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_ids()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated float distances = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< + float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_distances()))); + } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (37 & 0xFF)) { + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( + 1, 34u, input, this->mutable_distances()))); } else { goto handle_unusual; } @@ -5525,13 +5268,35 @@ void TopKQueryResult::SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - // repeated .milvus.grpc.QueryResult query_result_arrays = 1; - for (unsigned int i = 0, - n = static_cast(this->query_result_arrays_size()); i < n; i++) { + // .milvus.grpc.Status status = 1; + if (this->has_status()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, - this->query_result_arrays(static_cast(i)), - output); + 1, _Internal::status(this), output); + } + + // int64 row_num = 2; + if (this->row_num() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->row_num(), output); + } + + // repeated int64 ids = 3; + if (this->ids_size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(3, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_ids_cached_byte_size_.load( + std::memory_order_relaxed)); + } + for (int i = 0, n = this->ids_size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64NoTag( + this->ids(i), output); + } + + // repeated float distances = 4; + if (this->distances_size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(4, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_distances_cached_byte_size_.load( + std::memory_order_relaxed)); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatArray( + this->distances().data(), this->distances_size(), output); } if (_internal_metadata_.have_unknown_fields()) { @@ -5547,12 +5312,42 @@ void TopKQueryResult::SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - // repeated .milvus.grpc.QueryResult query_result_arrays = 1; - for (unsigned int i = 0, - n = static_cast(this->query_result_arrays_size()); i < n; i++) { + // .milvus.grpc.Status status = 1; + if (this->has_status()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessageToArray( - 1, this->query_result_arrays(static_cast(i)), target); + 1, _Internal::status(this), target); + } + + // int64 row_num = 2; + if (this->row_num() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->row_num(), target); + } + + // repeated int64 ids = 3; + if (this->ids_size() > 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( + 3, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( + _ids_cached_byte_size_.load(std::memory_order_relaxed), + target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->ids_, target); + } + + // repeated float distances = 4; + if (this->distances_size() > 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( + 4, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( + _distances_cached_byte_size_.load(std::memory_order_relaxed), + target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->distances_, target); } if (_internal_metadata_.have_unknown_fields()) { @@ -5576,15 +5371,48 @@ size_t TopKQueryResult::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated .milvus.grpc.QueryResult query_result_arrays = 1; + // repeated int64 ids = 3; { - unsigned int count = static_cast(this->query_result_arrays_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->query_result_arrays(static_cast(i))); + size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + Int64Size(this->ids_); + if (data_size > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); + _ids_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // repeated float distances = 4; + { + unsigned int count = static_cast(this->distances_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); + _distances_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // .milvus.grpc.Status status = 1; + if (this->has_status()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *status_); + } + + // int64 row_num = 2; + if (this->row_num() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->row_num()); } int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); @@ -5614,7 +5442,14 @@ void TopKQueryResult::MergeFrom(const TopKQueryResult& from) { ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - query_result_arrays_.MergeFrom(from.query_result_arrays_); + ids_.MergeFrom(from.ids_); + distances_.MergeFrom(from.distances_); + if (from.has_status()) { + mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); + } + if (from.row_num() != 0) { + set_row_num(from.row_num()); + } } void TopKQueryResult::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { @@ -5638,7 +5473,10 @@ bool TopKQueryResult::IsInitialized() const { void TopKQueryResult::InternalSwap(TopKQueryResult* other) { using std::swap; _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&query_result_arrays_)->InternalSwap(CastToBase(&other->query_result_arrays_)); + ids_.InternalSwap(&other->ids_); + distances_.InternalSwap(&other->distances_); + swap(status_, other->status_); + swap(row_num_, other->row_num_); } ::PROTOBUF_NAMESPACE_ID::Metadata TopKQueryResult::GetMetadata() const { @@ -5646,333 +5484,6 @@ void TopKQueryResult::InternalSwap(TopKQueryResult* other) { } -// =================================================================== - -void TopKQueryResultList::InitAsDefaultInstance() { - ::milvus::grpc::_TopKQueryResultList_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class TopKQueryResultList::_Internal { - public: - static const ::milvus::grpc::Status& status(const TopKQueryResultList* msg); -}; - -const ::milvus::grpc::Status& -TopKQueryResultList::_Internal::status(const TopKQueryResultList* msg) { - return *msg->status_; -} -void TopKQueryResultList::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -TopKQueryResultList::TopKQueryResultList() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.TopKQueryResultList) -} -TopKQueryResultList::TopKQueryResultList(const TopKQueryResultList& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - topk_query_result_(from.topk_query_result_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.TopKQueryResultList) -} - -void TopKQueryResultList::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TopKQueryResultList_milvus_2eproto.base); - status_ = nullptr; -} - -TopKQueryResultList::~TopKQueryResultList() { - // @@protoc_insertion_point(destructor:milvus.grpc.TopKQueryResultList) - SharedDtor(); -} - -void TopKQueryResultList::SharedDtor() { - if (this != internal_default_instance()) delete status_; -} - -void TopKQueryResultList::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const TopKQueryResultList& TopKQueryResultList::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TopKQueryResultList_milvus_2eproto.base); - return *internal_default_instance(); -} - - -void TopKQueryResultList::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.TopKQueryResultList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - topk_query_result_.Clear(); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* TopKQueryResultList::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.TopKQueryResult topk_query_result = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_topk_query_result(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool TopKQueryResultList::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.TopKQueryResultList) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.TopKQueryResult topk_query_result = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_topk_query_result())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.TopKQueryResultList) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.TopKQueryResultList) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void TopKQueryResultList::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.TopKQueryResultList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // repeated .milvus.grpc.TopKQueryResult topk_query_result = 2; - for (unsigned int i = 0, - n = static_cast(this->topk_query_result_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, - this->topk_query_result(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.TopKQueryResultList) -} - -::PROTOBUF_NAMESPACE_ID::uint8* TopKQueryResultList::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.TopKQueryResultList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // repeated .milvus.grpc.TopKQueryResult topk_query_result = 2; - for (unsigned int i = 0, - n = static_cast(this->topk_query_result_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, this->topk_query_result(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.TopKQueryResultList) - return target; -} - -size_t TopKQueryResultList::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.TopKQueryResultList) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.TopKQueryResult topk_query_result = 2; - { - unsigned int count = static_cast(this->topk_query_result_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->topk_query_result(static_cast(i))); - } - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void TopKQueryResultList::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.TopKQueryResultList) - GOOGLE_DCHECK_NE(&from, this); - const TopKQueryResultList* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.TopKQueryResultList) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.TopKQueryResultList) - MergeFrom(*source); - } -} - -void TopKQueryResultList::MergeFrom(const TopKQueryResultList& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.TopKQueryResultList) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - topk_query_result_.MergeFrom(from.topk_query_result_); - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } -} - -void TopKQueryResultList::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.TopKQueryResultList) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void TopKQueryResultList::CopyFrom(const TopKQueryResultList& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.TopKQueryResultList) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool TopKQueryResultList::IsInitialized() const { - return true; -} - -void TopKQueryResultList::InternalSwap(TopKQueryResultList* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&topk_query_result_)->InternalSwap(CastToBase(&other->topk_query_result_)); - swap(status_, other->status_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata TopKQueryResultList::GetMetadata() const { - return GetMetadataStatic(); -} - - // =================================================================== void StringReply::InitAsDefaultInstance() { @@ -8270,15 +7781,9 @@ template<> PROTOBUF_NOINLINE ::milvus::grpc::SearchParam* Arena::CreateMaybeMess template<> PROTOBUF_NOINLINE ::milvus::grpc::SearchInFilesParam* Arena::CreateMaybeMessage< ::milvus::grpc::SearchInFilesParam >(Arena* arena) { return Arena::CreateInternal< ::milvus::grpc::SearchInFilesParam >(arena); } -template<> PROTOBUF_NOINLINE ::milvus::grpc::QueryResult* Arena::CreateMaybeMessage< ::milvus::grpc::QueryResult >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::QueryResult >(arena); -} template<> PROTOBUF_NOINLINE ::milvus::grpc::TopKQueryResult* Arena::CreateMaybeMessage< ::milvus::grpc::TopKQueryResult >(Arena* arena) { return Arena::CreateInternal< ::milvus::grpc::TopKQueryResult >(arena); } -template<> PROTOBUF_NOINLINE ::milvus::grpc::TopKQueryResultList* Arena::CreateMaybeMessage< ::milvus::grpc::TopKQueryResultList >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::TopKQueryResultList >(arena); -} template<> PROTOBUF_NOINLINE ::milvus::grpc::StringReply* Arena::CreateMaybeMessage< ::milvus::grpc::StringReply >(Arena* arena) { return Arena::CreateInternal< ::milvus::grpc::StringReply >(arena); } diff --git a/core/src/grpc/gen-milvus/milvus.pb.h b/core/src/grpc/gen-milvus/milvus.pb.h index f41ca2c8c4..53ed2db22e 100644 --- a/core/src/grpc/gen-milvus/milvus.pb.h +++ b/core/src/grpc/gen-milvus/milvus.pb.h @@ -48,7 +48,7 @@ struct TableStruct_milvus_2eproto { PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[22] + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[20] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; @@ -84,9 +84,6 @@ extern PartitionNameDefaultTypeInternal _PartitionName_default_instance_; class PartitionParam; class PartitionParamDefaultTypeInternal; extern PartitionParamDefaultTypeInternal _PartitionParam_default_instance_; -class QueryResult; -class QueryResultDefaultTypeInternal; -extern QueryResultDefaultTypeInternal _QueryResult_default_instance_; class Range; class RangeDefaultTypeInternal; extern RangeDefaultTypeInternal _Range_default_instance_; @@ -117,9 +114,6 @@ extern TableSchemaDefaultTypeInternal _TableSchema_default_instance_; class TopKQueryResult; class TopKQueryResultDefaultTypeInternal; extern TopKQueryResultDefaultTypeInternal _TopKQueryResult_default_instance_; -class TopKQueryResultList; -class TopKQueryResultListDefaultTypeInternal; -extern TopKQueryResultListDefaultTypeInternal _TopKQueryResultList_default_instance_; class VectorIds; class VectorIdsDefaultTypeInternal; extern VectorIdsDefaultTypeInternal _VectorIds_default_instance_; @@ -135,7 +129,6 @@ template<> ::milvus::grpc::InsertParam* Arena::CreateMaybeMessage<::milvus::grpc template<> ::milvus::grpc::PartitionList* Arena::CreateMaybeMessage<::milvus::grpc::PartitionList>(Arena*); template<> ::milvus::grpc::PartitionName* Arena::CreateMaybeMessage<::milvus::grpc::PartitionName>(Arena*); template<> ::milvus::grpc::PartitionParam* Arena::CreateMaybeMessage<::milvus::grpc::PartitionParam>(Arena*); -template<> ::milvus::grpc::QueryResult* Arena::CreateMaybeMessage<::milvus::grpc::QueryResult>(Arena*); template<> ::milvus::grpc::Range* Arena::CreateMaybeMessage<::milvus::grpc::Range>(Arena*); template<> ::milvus::grpc::RowRecord* Arena::CreateMaybeMessage<::milvus::grpc::RowRecord>(Arena*); template<> ::milvus::grpc::SearchInFilesParam* Arena::CreateMaybeMessage<::milvus::grpc::SearchInFilesParam>(Arena*); @@ -146,7 +139,6 @@ template<> ::milvus::grpc::TableNameList* Arena::CreateMaybeMessage<::milvus::gr template<> ::milvus::grpc::TableRowCount* Arena::CreateMaybeMessage<::milvus::grpc::TableRowCount>(Arena*); template<> ::milvus::grpc::TableSchema* Arena::CreateMaybeMessage<::milvus::grpc::TableSchema>(Arena*); template<> ::milvus::grpc::TopKQueryResult* Arena::CreateMaybeMessage<::milvus::grpc::TopKQueryResult>(Arena*); -template<> ::milvus::grpc::TopKQueryResultList* Arena::CreateMaybeMessage<::milvus::grpc::TopKQueryResultList>(Arena*); template<> ::milvus::grpc::VectorIds* Arena::CreateMaybeMessage<::milvus::grpc::VectorIds>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace milvus { @@ -2021,144 +2013,6 @@ class SearchInFilesParam : }; // ------------------------------------------------------------------- -class QueryResult : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.QueryResult) */ { - public: - QueryResult(); - virtual ~QueryResult(); - - QueryResult(const QueryResult& from); - QueryResult(QueryResult&& from) noexcept - : QueryResult() { - *this = ::std::move(from); - } - - inline QueryResult& operator=(const QueryResult& from) { - CopyFrom(from); - return *this; - } - inline QueryResult& operator=(QueryResult&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const QueryResult& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const QueryResult* internal_default_instance() { - return reinterpret_cast( - &_QueryResult_default_instance_); - } - static constexpr int kIndexInFileMessages = - 12; - - friend void swap(QueryResult& a, QueryResult& b) { - a.Swap(&b); - } - inline void Swap(QueryResult* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline QueryResult* New() const final { - return CreateMaybeMessage(nullptr); - } - - QueryResult* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const QueryResult& from); - void MergeFrom(const QueryResult& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(QueryResult* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.QueryResult"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_milvus_2eproto); - return ::descriptor_table_milvus_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kIdFieldNumber = 1, - kDistanceFieldNumber = 2, - }; - // int64 id = 1; - void clear_id(); - ::PROTOBUF_NAMESPACE_ID::int64 id() const; - void set_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // double distance = 2; - void clear_distance(); - double distance() const; - void set_distance(double value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.QueryResult) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::int64 id_; - double distance_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_milvus_2eproto; -}; -// ------------------------------------------------------------------- - class TopKQueryResult : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.TopKQueryResult) */ { public: @@ -2201,7 +2055,7 @@ class TopKQueryResult : &_TopKQueryResult_default_instance_); } static constexpr int kIndexInFileMessages = - 13; + 12; friend void swap(TopKQueryResult& a, TopKQueryResult& b) { a.Swap(&b); @@ -2272,156 +2126,32 @@ class TopKQueryResult : // accessors ------------------------------------------------------- enum : int { - kQueryResultArraysFieldNumber = 1, - }; - // repeated .milvus.grpc.QueryResult query_result_arrays = 1; - int query_result_arrays_size() const; - void clear_query_result_arrays(); - ::milvus::grpc::QueryResult* mutable_query_result_arrays(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::QueryResult >* - mutable_query_result_arrays(); - const ::milvus::grpc::QueryResult& query_result_arrays(int index) const; - ::milvus::grpc::QueryResult* add_query_result_arrays(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::QueryResult >& - query_result_arrays() const; - - // @@protoc_insertion_point(class_scope:milvus.grpc.TopKQueryResult) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::QueryResult > query_result_arrays_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_milvus_2eproto; -}; -// ------------------------------------------------------------------- - -class TopKQueryResultList : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.TopKQueryResultList) */ { - public: - TopKQueryResultList(); - virtual ~TopKQueryResultList(); - - TopKQueryResultList(const TopKQueryResultList& from); - TopKQueryResultList(TopKQueryResultList&& from) noexcept - : TopKQueryResultList() { - *this = ::std::move(from); - } - - inline TopKQueryResultList& operator=(const TopKQueryResultList& from) { - CopyFrom(from); - return *this; - } - inline TopKQueryResultList& operator=(TopKQueryResultList&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const TopKQueryResultList& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const TopKQueryResultList* internal_default_instance() { - return reinterpret_cast( - &_TopKQueryResultList_default_instance_); - } - static constexpr int kIndexInFileMessages = - 14; - - friend void swap(TopKQueryResultList& a, TopKQueryResultList& b) { - a.Swap(&b); - } - inline void Swap(TopKQueryResultList* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline TopKQueryResultList* New() const final { - return CreateMaybeMessage(nullptr); - } - - TopKQueryResultList* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const TopKQueryResultList& from); - void MergeFrom(const TopKQueryResultList& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(TopKQueryResultList* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.TopKQueryResultList"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_milvus_2eproto); - return ::descriptor_table_milvus_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kTopkQueryResultFieldNumber = 2, + kIdsFieldNumber = 3, + kDistancesFieldNumber = 4, kStatusFieldNumber = 1, + kRowNumFieldNumber = 2, }; - // repeated .milvus.grpc.TopKQueryResult topk_query_result = 2; - int topk_query_result_size() const; - void clear_topk_query_result(); - ::milvus::grpc::TopKQueryResult* mutable_topk_query_result(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::TopKQueryResult >* - mutable_topk_query_result(); - const ::milvus::grpc::TopKQueryResult& topk_query_result(int index) const; - ::milvus::grpc::TopKQueryResult* add_topk_query_result(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::TopKQueryResult >& - topk_query_result() const; + // repeated int64 ids = 3; + int ids_size() const; + void clear_ids(); + ::PROTOBUF_NAMESPACE_ID::int64 ids(int index) const; + void set_ids(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); + void add_ids(::PROTOBUF_NAMESPACE_ID::int64 value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& + ids() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* + mutable_ids(); + + // repeated float distances = 4; + int distances_size() const; + void clear_distances(); + float distances(int index) const; + void set_distances(int index, float value); + void add_distances(float value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >& + distances() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >* + mutable_distances(); // .milvus.grpc.Status status = 1; bool has_status() const; @@ -2431,13 +2161,22 @@ class TopKQueryResultList : ::milvus::grpc::Status* mutable_status(); void set_allocated_status(::milvus::grpc::Status* status); - // @@protoc_insertion_point(class_scope:milvus.grpc.TopKQueryResultList) + // int64 row_num = 2; + void clear_row_num(); + ::PROTOBUF_NAMESPACE_ID::int64 row_num() const; + void set_row_num(::PROTOBUF_NAMESPACE_ID::int64 value); + + // @@protoc_insertion_point(class_scope:milvus.grpc.TopKQueryResult) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::TopKQueryResult > topk_query_result_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > ids_; + mutable std::atomic _ids_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > distances_; + mutable std::atomic _distances_cached_byte_size_; ::milvus::grpc::Status* status_; + ::PROTOBUF_NAMESPACE_ID::int64 row_num_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_milvus_2eproto; }; @@ -2485,7 +2224,7 @@ class StringReply : &_StringReply_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 13; friend void swap(StringReply& a, StringReply& b) { a.Swap(&b); @@ -2632,7 +2371,7 @@ class BoolReply : &_BoolReply_default_instance_); } static constexpr int kIndexInFileMessages = - 16; + 14; friend void swap(BoolReply& a, BoolReply& b) { a.Swap(&b); @@ -2773,7 +2512,7 @@ class TableRowCount : &_TableRowCount_default_instance_); } static constexpr int kIndexInFileMessages = - 17; + 15; friend void swap(TableRowCount& a, TableRowCount& b) { a.Swap(&b); @@ -2914,7 +2653,7 @@ class Command : &_Command_default_instance_); } static constexpr int kIndexInFileMessages = - 18; + 16; friend void swap(Command& a, Command& b) { a.Swap(&b); @@ -3051,7 +2790,7 @@ class Index : &_Index_default_instance_); } static constexpr int kIndexInFileMessages = - 19; + 17; friend void swap(Index& a, Index& b) { a.Swap(&b); @@ -3189,7 +2928,7 @@ class IndexParam : &_IndexParam_default_instance_); } static constexpr int kIndexInFileMessages = - 20; + 18; friend void swap(IndexParam& a, IndexParam& b) { a.Swap(&b); @@ -3346,7 +3085,7 @@ class DeleteByDateParam : &_DeleteByDateParam_default_instance_); } static constexpr int kIndexInFileMessages = - 21; + 19; friend void swap(DeleteByDateParam& a, DeleteByDateParam& b) { a.Swap(&b); @@ -4773,101 +4512,35 @@ inline void SearchInFilesParam::set_allocated_search_param(::milvus::grpc::Searc // ------------------------------------------------------------------- -// QueryResult - -// int64 id = 1; -inline void QueryResult::clear_id() { - id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 QueryResult::id() const { - // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.id) - return id_; -} -inline void QueryResult::set_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - id_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.QueryResult.id) -} - -// double distance = 2; -inline void QueryResult::clear_distance() { - distance_ = 0; -} -inline double QueryResult::distance() const { - // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.distance) - return distance_; -} -inline void QueryResult::set_distance(double value) { - - distance_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.QueryResult.distance) -} - -// ------------------------------------------------------------------- - // TopKQueryResult -// repeated .milvus.grpc.QueryResult query_result_arrays = 1; -inline int TopKQueryResult::query_result_arrays_size() const { - return query_result_arrays_.size(); -} -inline void TopKQueryResult::clear_query_result_arrays() { - query_result_arrays_.Clear(); -} -inline ::milvus::grpc::QueryResult* TopKQueryResult::mutable_query_result_arrays(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.TopKQueryResult.query_result_arrays) - return query_result_arrays_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::QueryResult >* -TopKQueryResult::mutable_query_result_arrays() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.TopKQueryResult.query_result_arrays) - return &query_result_arrays_; -} -inline const ::milvus::grpc::QueryResult& TopKQueryResult::query_result_arrays(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.TopKQueryResult.query_result_arrays) - return query_result_arrays_.Get(index); -} -inline ::milvus::grpc::QueryResult* TopKQueryResult::add_query_result_arrays() { - // @@protoc_insertion_point(field_add:milvus.grpc.TopKQueryResult.query_result_arrays) - return query_result_arrays_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::QueryResult >& -TopKQueryResult::query_result_arrays() const { - // @@protoc_insertion_point(field_list:milvus.grpc.TopKQueryResult.query_result_arrays) - return query_result_arrays_; -} - -// ------------------------------------------------------------------- - -// TopKQueryResultList - // .milvus.grpc.Status status = 1; -inline bool TopKQueryResultList::has_status() const { +inline bool TopKQueryResult::has_status() const { return this != internal_default_instance() && status_ != nullptr; } -inline const ::milvus::grpc::Status& TopKQueryResultList::status() const { +inline const ::milvus::grpc::Status& TopKQueryResult::status() const { const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.TopKQueryResultList.status) + // @@protoc_insertion_point(field_get:milvus.grpc.TopKQueryResult.status) return p != nullptr ? *p : *reinterpret_cast( &::milvus::grpc::_Status_default_instance_); } -inline ::milvus::grpc::Status* TopKQueryResultList::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.TopKQueryResultList.status) +inline ::milvus::grpc::Status* TopKQueryResult::release_status() { + // @@protoc_insertion_point(field_release:milvus.grpc.TopKQueryResult.status) ::milvus::grpc::Status* temp = status_; status_ = nullptr; return temp; } -inline ::milvus::grpc::Status* TopKQueryResultList::mutable_status() { +inline ::milvus::grpc::Status* TopKQueryResult::mutable_status() { if (status_ == nullptr) { auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); status_ = p; } - // @@protoc_insertion_point(field_mutable:milvus.grpc.TopKQueryResultList.status) + // @@protoc_insertion_point(field_mutable:milvus.grpc.TopKQueryResult.status) return status_; } -inline void TopKQueryResultList::set_allocated_status(::milvus::grpc::Status* status) { +inline void TopKQueryResult::set_allocated_status(::milvus::grpc::Status* status) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == nullptr) { delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(status_); @@ -4883,37 +4556,81 @@ inline void TopKQueryResultList::set_allocated_status(::milvus::grpc::Status* st } status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.TopKQueryResultList.status) + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.TopKQueryResult.status) } -// repeated .milvus.grpc.TopKQueryResult topk_query_result = 2; -inline int TopKQueryResultList::topk_query_result_size() const { - return topk_query_result_.size(); +// int64 row_num = 2; +inline void TopKQueryResult::clear_row_num() { + row_num_ = PROTOBUF_LONGLONG(0); } -inline void TopKQueryResultList::clear_topk_query_result() { - topk_query_result_.Clear(); +inline ::PROTOBUF_NAMESPACE_ID::int64 TopKQueryResult::row_num() const { + // @@protoc_insertion_point(field_get:milvus.grpc.TopKQueryResult.row_num) + return row_num_; } -inline ::milvus::grpc::TopKQueryResult* TopKQueryResultList::mutable_topk_query_result(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.TopKQueryResultList.topk_query_result) - return topk_query_result_.Mutable(index); +inline void TopKQueryResult::set_row_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + + row_num_ = value; + // @@protoc_insertion_point(field_set:milvus.grpc.TopKQueryResult.row_num) } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::TopKQueryResult >* -TopKQueryResultList::mutable_topk_query_result() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.TopKQueryResultList.topk_query_result) - return &topk_query_result_; + +// repeated int64 ids = 3; +inline int TopKQueryResult::ids_size() const { + return ids_.size(); } -inline const ::milvus::grpc::TopKQueryResult& TopKQueryResultList::topk_query_result(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.TopKQueryResultList.topk_query_result) - return topk_query_result_.Get(index); +inline void TopKQueryResult::clear_ids() { + ids_.Clear(); } -inline ::milvus::grpc::TopKQueryResult* TopKQueryResultList::add_topk_query_result() { - // @@protoc_insertion_point(field_add:milvus.grpc.TopKQueryResultList.topk_query_result) - return topk_query_result_.Add(); +inline ::PROTOBUF_NAMESPACE_ID::int64 TopKQueryResult::ids(int index) const { + // @@protoc_insertion_point(field_get:milvus.grpc.TopKQueryResult.ids) + return ids_.Get(index); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::TopKQueryResult >& -TopKQueryResultList::topk_query_result() const { - // @@protoc_insertion_point(field_list:milvus.grpc.TopKQueryResultList.topk_query_result) - return topk_query_result_; +inline void TopKQueryResult::set_ids(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { + ids_.Set(index, value); + // @@protoc_insertion_point(field_set:milvus.grpc.TopKQueryResult.ids) +} +inline void TopKQueryResult::add_ids(::PROTOBUF_NAMESPACE_ID::int64 value) { + ids_.Add(value); + // @@protoc_insertion_point(field_add:milvus.grpc.TopKQueryResult.ids) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& +TopKQueryResult::ids() const { + // @@protoc_insertion_point(field_list:milvus.grpc.TopKQueryResult.ids) + return ids_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* +TopKQueryResult::mutable_ids() { + // @@protoc_insertion_point(field_mutable_list:milvus.grpc.TopKQueryResult.ids) + return &ids_; +} + +// repeated float distances = 4; +inline int TopKQueryResult::distances_size() const { + return distances_.size(); +} +inline void TopKQueryResult::clear_distances() { + distances_.Clear(); +} +inline float TopKQueryResult::distances(int index) const { + // @@protoc_insertion_point(field_get:milvus.grpc.TopKQueryResult.distances) + return distances_.Get(index); +} +inline void TopKQueryResult::set_distances(int index, float value) { + distances_.Set(index, value); + // @@protoc_insertion_point(field_set:milvus.grpc.TopKQueryResult.distances) +} +inline void TopKQueryResult::add_distances(float value) { + distances_.Add(value); + // @@protoc_insertion_point(field_add:milvus.grpc.TopKQueryResult.distances) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >& +TopKQueryResult::distances() const { + // @@protoc_insertion_point(field_list:milvus.grpc.TopKQueryResult.distances) + return distances_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >* +TopKQueryResult::mutable_distances() { + // @@protoc_insertion_point(field_mutable_list:milvus.grpc.TopKQueryResult.distances) + return &distances_; } // ------------------------------------------------------------------- @@ -5527,10 +5244,6 @@ inline void DeleteByDateParam::set_allocated_table_name(std::string* table_name) // ------------------------------------------------------------------- -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - // @@protoc_insertion_point(namespace_scope) diff --git a/core/src/grpc/milvus.proto b/core/src/grpc/milvus.proto index c2dbbc43ab..4cfc1cfa0d 100644 --- a/core/src/grpc/milvus.proto +++ b/core/src/grpc/milvus.proto @@ -110,24 +110,11 @@ message SearchInFilesParam { /** * @brief Query result params */ -message QueryResult { - int64 id = 1; - double distance = 2; -} - -/** - * @brief TopK query result - */ message TopKQueryResult { - repeated QueryResult query_result_arrays = 1; -} - -/** - * @brief List of topK query result - */ -message TopKQueryResultList { Status status = 1; - repeated TopKQueryResult topk_query_result = 2; + int64 row_num = 2; + repeated int64 ids = 3; + repeated float distances = 4; } /** @@ -311,18 +298,18 @@ service MilvusService { * * @param SearchParam, search parameters. * - * @return TopKQueryResultList + * @return TopKQueryResult */ - rpc Search(SearchParam) returns (TopKQueryResultList) {} + rpc Search(SearchParam) returns (TopKQueryResult) {} /** * @brief This method is used to query vector in specified files. * * @param SearchInFilesParam, search in files paremeters. * - * @return TopKQueryResultList + * @return TopKQueryResult */ - rpc SearchInFiles(SearchInFilesParam) returns (TopKQueryResultList) {} + rpc SearchInFiles(SearchInFilesParam) returns (TopKQueryResult) {} /** * @brief This method is used to give the server status. diff --git a/core/src/index/unittest/faiss_benchmark/faiss_benchmark_test.cpp b/core/src/index/unittest/faiss_benchmark/faiss_benchmark_test.cpp index 780e620e6a..ce5aa4bafa 100644 --- a/core/src/index/unittest/faiss_benchmark/faiss_benchmark_test.cpp +++ b/core/src/index/unittest/faiss_benchmark/faiss_benchmark_test.cpp @@ -202,14 +202,14 @@ parse_ann_test_name(const std::string& ann_test_name, size_t& dim, faiss::Metric int32_t GetResultHitCount(const faiss::Index::idx_t* ground_index, const faiss::Index::idx_t* index, size_t ground_k, size_t k, size_t nq, int32_t index_add_loops) { - assert(ground_k <= k); + size_t min_k = std::min(ground_k, k); int hit = 0; for (int i = 0; i < nq; i++) { // count the num of results exist in ground truth result set // each result replicates INDEX_ADD_LOOPS times for (int j_c = 0; j_c < k; j_c++) { int r_c = index[i * k + j_c]; - for (int j_g = 0; j_g < ground_k / index_add_loops; j_g++) { + for (int j_g = 0; j_g < min_k / index_add_loops; j_g++) { if (ground_index[i * ground_k + j_g] == r_c) { hit++; continue; @@ -283,7 +283,11 @@ load_base_data(faiss::Index*& index, const std::string& ann_test_name, const std // add index multiple times to get ~1G data set for (int i = 0; i < index_add_loops; i++) { printf("[%.3f s] No.%d Indexing database, size %ld*%ld\n", elapsed() - t0, i, nb, d); - gpu_index->add(nb, xb); + std::vector xids(nb); + for (int t = 0; t < nb; t++) { + xids[t] = i * nb + t; + } + gpu_index->add_with_ids(nb, xb, xids.data()); } printf("[%.3f s] Coping GPU index to CPU\n", elapsed() - t0); @@ -359,13 +363,14 @@ test_with_nprobes(const std::string& ann_test_name, const std::string& index_key const int32_t search_loops) { double t0 = elapsed(); - const size_t NQ = 1000, NQ_START = 10, NQ_STEP = 10; - const size_t K = 1000, K_START = 100, K_STEP = 10; + const std::vector NQ = {10, 100}; + const std::vector K = {10, 100, 1000}; const size_t GK = 100; // topk of ground truth std::unordered_map mode_str_map = { {MODE_CPU, "MODE_CPU"}, {MODE_MIX, "MODE_MIX"}, {MODE_GPU, "MODE_GPU"}}; + double copy_time = 0.0; faiss::Index *gpu_index, *index; if (query_mode != MODE_CPU) { faiss::gpu::GpuClonerOptions option; @@ -375,7 +380,6 @@ test_with_nprobes(const std::string& ann_test_name, const std::string& index_key index_composition.index = cpu_index; index_composition.quantizer = nullptr; - double copy_time; switch (query_mode) { case MODE_MIX: { index_composition.mode = 1; // 0: all data, 1: copy quantizer, 2: copy data @@ -420,34 +424,39 @@ test_with_nprobes(const std::string& ann_test_name, const std::string& index_key } for (auto nprobe : nprobes) { - switch (query_mode) { - case MODE_CPU: - case MODE_MIX: { - faiss::ParameterSpace params; - std::string nprobe_str = "nprobe=" + std::to_string(nprobe); - params.set_index_parameters(index, nprobe_str.c_str()); - break; - } - case MODE_GPU: { - faiss::gpu::GpuIndexIVF* gpu_index_ivf = dynamic_cast(index); - gpu_index_ivf->setNumProbes(nprobe); + // brute-force need not set nprobe + if (index_key.find("IDMap") == std::string::npos) { + switch (query_mode) { + case MODE_CPU: + case MODE_MIX: { + faiss::ParameterSpace params; + std::string nprobe_str = "nprobe=" + std::to_string(nprobe); + params.set_index_parameters(index, nprobe_str.c_str()); + break; + } + case MODE_GPU: { + faiss::gpu::GpuIndexIVF* gpu_index_ivf = dynamic_cast(index); + gpu_index_ivf->setNumProbes(nprobe); + } } } // output buffers - faiss::Index::idx_t* I = new faiss::Index::idx_t[NQ * K]; - faiss::Index::distance_t* D = new faiss::Index::distance_t[NQ * K]; + faiss::Index::idx_t* I = new faiss::Index::idx_t[NQ.back() * K.back()]; + faiss::Index::distance_t* D = new faiss::Index::distance_t[NQ.back() * K.back()]; printf("\n%s | %s - %s | nprobe=%lu\n", ann_test_name.c_str(), index_key.c_str(), mode_str_map[query_mode].c_str(), nprobe); printf("======================================================================================\n"); - for (size_t t_nq = NQ_START; t_nq <= NQ; t_nq *= NQ_STEP) { // nq = {10, 100, 1000} - for (size_t t_k = K_START; t_k <= K; t_k *= K_STEP) { // k = {100, 1000} + for (size_t j = 0; j < K.size(); j++) { + size_t t_k = K[j]; + for (size_t i = 0; i < NQ.size(); i++) { + size_t t_nq = NQ[i]; faiss::indexIVF_stats.quantization_time = 0.0; faiss::indexIVF_stats.search_time = 0.0; double t_start = elapsed(), t_end; - for (int i = 0; i < search_loops; i++) { + for (int s = 0; s < search_loops; s++) { index->search(t_nq, xq, t_k, D, I); } t_end = elapsed(); @@ -466,7 +475,7 @@ test_with_nprobes(const std::string& ann_test_name, const std::string& index_key printf("nq = %4ld, k = %4ld, elapse = %.4fs (quant = %.4fs, search = %.4fs), R@ = %.4f\n", t_nq, t_k, (t_end - t_start) / search_loops, faiss::indexIVF_stats.quantization_time / 1000 / search_loops, faiss::indexIVF_stats.search_time / 1000 / search_loops, - (hit / float(t_nq * GK / index_add_loops))); + (hit / float(t_nq * std::min(GK, t_k) / index_add_loops))); } } printf("======================================================================================\n"); @@ -479,8 +488,9 @@ test_with_nprobes(const std::string& ann_test_name, const std::string& index_key } void -test_ann_hdf5(const std::string& ann_test_name, const std::string& index_type, const QueryMode query_mode, - int32_t index_add_loops, const std::vector& nprobes, int32_t search_loops) { +test_ann_hdf5(const std::string& ann_test_name, const std::string& cluster_type, const std::string& index_type, + const QueryMode query_mode, int32_t index_add_loops, const std::vector& nprobes, + int32_t search_loops) { double t0 = elapsed(); faiss::gpu::StandardGpuResources res; @@ -493,7 +503,7 @@ test_ann_hdf5(const std::string& ann_test_name, const std::string& index_type, c return; } - std::string index_key = "IVF16384," + index_type; + std::string index_key = cluster_type + "," + index_type; if (!parse_ann_test_name(ann_test_name, dim, metric_type)) { printf("Invalid ann test name: %s\n", ann_test_name.c_str()); @@ -526,7 +536,7 @@ test_ann_hdf5(const std::string& ann_test_name, const std::string& index_type, c * * Dataset Dimensions Train_size Test_size Neighbors Distance Download * Fashion- - * MNIST 784 60,000 10,000 100 Euclidean HDF5 (217MB) + MNIST 784 60,000 10,000 100 Euclidean HDF5 (217MB) * GIST 960 1,000,000 1,000 100 Euclidean HDF5 (3.6GB) * GloVe 100 1,183,514 10,000 100 Angular HDF5 (463MB) * GloVe 200 1,183,514 10,000 100 Angular HDF5 (918MB) @@ -542,30 +552,39 @@ TEST(FAISSTEST, BENCHMARK) { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// const int32_t SIFT_INSERT_LOOPS = 2; // insert twice to get ~1G data set - test_ann_hdf5("sift-128-euclidean", "Flat", MODE_CPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); - test_ann_hdf5("sift-128-euclidean", "Flat", MODE_GPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("sift-128-euclidean", "IDMap", "Flat", MODE_CPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("sift-128-euclidean", "IDMap", "Flat", MODE_GPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); - test_ann_hdf5("sift-128-euclidean", "SQ8", MODE_CPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); - test_ann_hdf5("sift-128-euclidean", "SQ8", MODE_GPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("sift-128-euclidean", "IVF16384", "Flat", MODE_CPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("sift-128-euclidean", "IVF16384", "Flat", MODE_GPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + + test_ann_hdf5("sift-128-euclidean", "IVF16384", "SQ8", MODE_CPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("sift-128-euclidean", "IVF16384", "SQ8", MODE_GPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); #ifdef CUSTOMIZATION - test_ann_hdf5("sift-128-euclidean", "SQ8Hybrid", MODE_CPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); - test_ann_hdf5("sift-128-euclidean", "SQ8Hybrid", MODE_MIX, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); - test_ann_hdf5("sift-128-euclidean", "SQ8Hybrid", MODE_GPU, SIFT_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("sift-128-euclidean", "IVF16384", "SQ8Hybrid", MODE_CPU, SIFT_INSERT_LOOPS, param_nprobes, + SEARCH_LOOPS); + test_ann_hdf5("sift-128-euclidean", "IVF16384", "SQ8Hybrid", MODE_MIX, SIFT_INSERT_LOOPS, param_nprobes, + SEARCH_LOOPS); + test_ann_hdf5("sift-128-euclidean", "IVF16384", "SQ8Hybrid", MODE_GPU, SIFT_INSERT_LOOPS, param_nprobes, + SEARCH_LOOPS); #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// const int32_t GLOVE_INSERT_LOOPS = 1; - test_ann_hdf5("glove-200-angular", "Flat", MODE_CPU, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); - test_ann_hdf5("glove-200-angular", "Flat", MODE_GPU, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("glove-200-angular", "IVF16384", "Flat", MODE_CPU, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("glove-200-angular", "IVF16384", "Flat", MODE_GPU, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); - test_ann_hdf5("glove-200-angular", "SQ8", MODE_CPU, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); - test_ann_hdf5("glove-200-angular", "SQ8", MODE_GPU, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("glove-200-angular", "IVF16384", "SQ8", MODE_CPU, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("glove-200-angular", "IVF16384", "SQ8", MODE_GPU, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); #ifdef CUSTOMIZATION - test_ann_hdf5("glove-200-angular", "SQ8Hybrid", MODE_CPU, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); - test_ann_hdf5("glove-200-angular", "SQ8Hybrid", MODE_MIX, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); - test_ann_hdf5("glove-200-angular", "SQ8Hybrid", MODE_GPU, GLOVE_INSERT_LOOPS, param_nprobes, SEARCH_LOOPS); + test_ann_hdf5("glove-200-angular", "IVF16384", "SQ8Hybrid", MODE_CPU, GLOVE_INSERT_LOOPS, param_nprobes, + SEARCH_LOOPS); + test_ann_hdf5("glove-200-angular", "IVF16384", "SQ8Hybrid", MODE_MIX, GLOVE_INSERT_LOOPS, param_nprobes, + SEARCH_LOOPS); + test_ann_hdf5("glove-200-angular", "IVF16384", "SQ8Hybrid", MODE_GPU, GLOVE_INSERT_LOOPS, param_nprobes, + SEARCH_LOOPS); #endif } diff --git a/core/src/sdk/examples/partition/src/ClientTest.cpp b/core/src/sdk/examples/partition/src/ClientTest.cpp index e58de0ce27..775e1f6d60 100644 --- a/core/src/sdk/examples/partition/src/ClientTest.cpp +++ b/core/src/sdk/examples/partition/src/ClientTest.cpp @@ -133,18 +133,18 @@ ClientTest::Test(const std::string& address, const std::string& port) { { // search vectors std::cout << "Search in correct partition" << std::endl; std::vector partiton_tags = {std::to_string(TARGET_PARTITION)}; - std::vector topk_query_result_array; + milvus::TopKQueryResult topk_query_result; milvus_sdk::Utils::DoSearch(conn, TABLE_NAME, partiton_tags, TOP_K, NPROBE, search_record_array, - topk_query_result_array); + topk_query_result); std::cout << "Search in wrong partition" << std::endl; partiton_tags = {"0"}; milvus_sdk::Utils::DoSearch(conn, TABLE_NAME, partiton_tags, TOP_K, NPROBE, search_record_array, - topk_query_result_array); + topk_query_result); std::cout << "Search by regex matched partition tag" << std::endl; partiton_tags = {"\\d"}; milvus_sdk::Utils::DoSearch(conn, TABLE_NAME, partiton_tags, TOP_K, NPROBE, search_record_array, - topk_query_result_array); + topk_query_result); } { // wait unit build index finish @@ -182,9 +182,9 @@ ClientTest::Test(const std::string& address, const std::string& port) { { // search vectors std::cout << "Search in whole table" << std::endl; std::vector partiton_tags; - std::vector topk_query_result_array; + milvus::TopKQueryResult topk_query_result; milvus_sdk::Utils::DoSearch(conn, TABLE_NAME, partiton_tags, TOP_K, NPROBE, search_record_array, - topk_query_result_array); + topk_query_result); } { // drop index diff --git a/core/src/sdk/examples/simple/src/ClientTest.cpp b/core/src/sdk/examples/simple/src/ClientTest.cpp index 9b217a1ed0..dfa5e2219e 100644 --- a/core/src/sdk/examples/simple/src/ClientTest.cpp +++ b/core/src/sdk/examples/simple/src/ClientTest.cpp @@ -144,9 +144,9 @@ ClientTest::Test(const std::string& address, const std::string& port) { milvus_sdk::Utils::Sleep(3); { // search vectors std::vector partiton_tags; - std::vector topk_query_result_array; + milvus::TopKQueryResult topk_query_result; milvus_sdk::Utils::DoSearch(conn, TABLE_NAME, partiton_tags, TOP_K, NPROBE, search_record_array, - topk_query_result_array); + topk_query_result); } { // wait unit build index finish @@ -169,9 +169,9 @@ ClientTest::Test(const std::string& address, const std::string& port) { { // search vectors std::vector partiton_tags; - std::vector topk_query_result_array; + milvus::TopKQueryResult topk_query_result; milvus_sdk::Utils::DoSearch(conn, TABLE_NAME, partiton_tags, TOP_K, NPROBE, search_record_array, - topk_query_result_array); + topk_query_result); } { // drop index diff --git a/core/src/sdk/examples/utils/Utils.cpp b/core/src/sdk/examples/utils/Utils.cpp index 3f96a5b6df..d9dd950710 100644 --- a/core/src/sdk/examples/utils/Utils.cpp +++ b/core/src/sdk/examples/utils/Utils.cpp @@ -155,32 +155,34 @@ Utils::BuildVectors(int64_t from, int64_t to, std::vector& ve void Utils::PrintSearchResult(const std::vector>& search_record_array, - const std::vector& topk_query_result_array) { + const milvus::TopKQueryResult& topk_query_result) { BLOCK_SPLITER - std::cout << "Returned result count: " << topk_query_result_array.size() << std::endl; + size_t nq = topk_query_result.row_num; + size_t topk = topk_query_result.ids.size() / nq; + std::cout << "Returned result count: " << nq * topk << std::endl; int32_t index = 0; - for (auto& result : topk_query_result_array) { + for (size_t i = 0; i < nq; i++) { auto search_id = search_record_array[index].first; index++; - std::cout << "No." << std::to_string(index) << " vector " << std::to_string(search_id) << " top " - << std::to_string(result.query_result_arrays.size()) << " search result:" << std::endl; - for (auto& item : result.query_result_arrays) { - std::cout << "\t" << std::to_string(item.id) << "\tdistance:" << std::to_string(item.distance); - std::cout << std::endl; + std::cout << "No." << index << " vector " << search_id << " top " << topk << " search result:" << std::endl; + for (size_t j = 0; j < topk; j++) { + size_t idx = i * nq + j; + std::cout << "\t" << topk_query_result.ids[idx] << "\t" << topk_query_result.distances[idx] << std::endl; } } - BLOCK_SPLITER } void Utils::CheckSearchResult(const std::vector>& search_record_array, - const std::vector& topk_query_result_array) { + const milvus::TopKQueryResult& topk_query_result) { BLOCK_SPLITER + size_t nq = topk_query_result.row_num; + size_t result_k = topk_query_result.ids.size() / nq; int64_t index = 0; - for (auto& result : topk_query_result_array) { - auto result_id = result.query_result_arrays[0].id; + for (size_t i = 0; i < nq; i++) { + auto result_id = topk_query_result.ids[i * result_k]; auto search_id = search_record_array[index++].first; if (result_id != search_id) { std::cout << "The top 1 result is wrong: " << result_id << " vs. " << search_id << std::endl; @@ -195,8 +197,10 @@ void Utils::DoSearch(std::shared_ptr conn, const std::string& table_name, const std::vector& partiton_tags, int64_t top_k, int64_t nprobe, const std::vector>& search_record_array, - std::vector& topk_query_result_array) { - topk_query_result_array.clear(); + milvus::TopKQueryResult& topk_query_result) { + topk_query_result.distances.clear(); + topk_query_result.ids.clear(); + topk_query_result.row_num = 0; std::vector query_range_array; milvus::Range rg; @@ -212,14 +216,14 @@ Utils::DoSearch(std::shared_ptr conn, const std::string& tab { BLOCK_SPLITER milvus_sdk::TimeRecorder rc("search"); - milvus::Status stat = conn->Search(table_name, partiton_tags, record_array, query_range_array, top_k, nprobe, - topk_query_result_array); + milvus::Status stat = + conn->Search(table_name, partiton_tags, record_array, query_range_array, top_k, nprobe, topk_query_result); std::cout << "SearchVector function call status: " << stat.message() << std::endl; BLOCK_SPLITER } - PrintSearchResult(search_record_array, topk_query_result_array); - CheckSearchResult(search_record_array, topk_query_result_array); + PrintSearchResult(search_record_array, topk_query_result); + CheckSearchResult(search_record_array, topk_query_result); } } // namespace milvus_sdk diff --git a/core/src/sdk/examples/utils/Utils.h b/core/src/sdk/examples/utils/Utils.h index cab0d8810a..8066a24ff4 100644 --- a/core/src/sdk/examples/utils/Utils.h +++ b/core/src/sdk/examples/utils/Utils.h @@ -61,17 +61,17 @@ class Utils { static void PrintSearchResult(const std::vector>& search_record_array, - const std::vector& topk_query_result_array); + const milvus::TopKQueryResult& topk_query_result); static void CheckSearchResult(const std::vector>& search_record_array, - const std::vector& topk_query_result_array); + const milvus::TopKQueryResult& topk_query_result); static void DoSearch(std::shared_ptr conn, const std::string& table_name, const std::vector& partiton_tags, int64_t top_k, int64_t nprobe, const std::vector>& search_record_array, - std::vector& topk_query_result_array); + milvus::TopKQueryResult& topk_query_result); }; } // namespace milvus_sdk diff --git a/core/src/sdk/grpc/ClientProxy.cpp b/core/src/sdk/grpc/ClientProxy.cpp index 3321a9f85e..4ec94cfa98 100644 --- a/core/src/sdk/grpc/ClientProxy.cpp +++ b/core/src/sdk/grpc/ClientProxy.cpp @@ -32,6 +32,13 @@ UriCheck(const std::string& uri) { return (index != std::string::npos); } +void +CopyRowRecord(::milvus::grpc::RowRecord* target, const RowRecord& src) { + auto vector_data = target->mutable_vector_data(); + vector_data->Resize(static_cast(src.data.size()), 0.0); + memcpy(vector_data->mutable_data(), src.data.data(), src.data.size() * sizeof(float)); +} + Status ClientProxy::Connect(const ConnectParam& param) { std::string uri = param.ip_address + ":" + param.port; @@ -189,23 +196,22 @@ ClientProxy::Insert(const std::string& table_name, const std::string& partition_ for (auto& record : record_array) { ::milvus::grpc::RowRecord* grpc_record = insert_param.add_row_record_array(); - for (size_t i = 0; i < record.data.size(); i++) { - grpc_record->add_vector_data(record.data[i]); - } + CopyRowRecord(grpc_record, record); } // Single thread ::milvus::grpc::VectorIds vector_ids; if (!id_array.empty()) { - for (auto i = 0; i < id_array.size(); i++) { - insert_param.add_row_id_array(id_array[i]); - } + /* set user's ids */ + auto row_ids = insert_param.mutable_row_id_array(); + row_ids->Reserve(static_cast(id_array.size())); + memcpy(row_ids->mutable_data(), id_array.data(), id_array.size() * sizeof(int64_t)); + client_ptr_->Insert(vector_ids, insert_param, status); } else { client_ptr_->Insert(vector_ids, insert_param, status); - for (size_t i = 0; i < vector_ids.vector_id_array_size(); i++) { - id_array.push_back(vector_ids.vector_id_array(i)); - } + /* return Milvus generated ids back to user */ + id_array.insert(id_array.end(), vector_ids.vector_id_array().begin(), vector_ids.vector_id_array().end()); } #endif } catch (std::exception& ex) { @@ -218,7 +224,7 @@ ClientProxy::Insert(const std::string& table_name, const std::string& partition_ Status ClientProxy::Search(const std::string& table_name, const std::vector& partiton_tags, const std::vector& query_record_array, const std::vector& query_range_array, - int64_t topk, int64_t nprobe, std::vector& topk_query_result_array) { + int64_t topk, int64_t nprobe, TopKQueryResult& topk_query_result) { try { // step 1: convert vectors data ::milvus::grpc::SearchParam search_param; @@ -230,9 +236,7 @@ ClientProxy::Search(const std::string& table_name, const std::vectoradd_vector_data(rec); - } + CopyRowRecord(row_record, record); } // step 2: convert range array @@ -243,21 +247,17 @@ ClientProxy::Search(const std::string& table_name, const std::vectorSearch(topk_query_result_list, search_param); + ::milvus::grpc::TopKQueryResult result; + Status status = client_ptr_->Search(result, search_param); // step 4: convert result array - for (uint64_t i = 0; i < topk_query_result_list.topk_query_result_size(); ++i) { - TopKQueryResult result; - for (uint64_t j = 0; j < topk_query_result_list.topk_query_result(i).query_result_arrays_size(); ++j) { - QueryResult query_result; - query_result.id = topk_query_result_list.topk_query_result(i).query_result_arrays(j).id(); - query_result.distance = topk_query_result_list.topk_query_result(i).query_result_arrays(j).distance(); - result.query_result_arrays.emplace_back(query_result); - } + topk_query_result.row_num = result.row_num(); + topk_query_result.ids.resize(result.ids().size()); + memcpy(topk_query_result.ids.data(), result.ids().data(), result.ids().size() * sizeof(int64_t)); + topk_query_result.distances.resize(result.distances().size()); + memcpy(topk_query_result.distances.data(), result.distances().data(), + result.distances().size() * sizeof(float)); - topk_query_result_array.emplace_back(result); - } return status; } catch (std::exception& ex) { return Status(StatusCode::UnknownError, "fail to search vectors: " + std::string(ex.what())); diff --git a/core/src/sdk/grpc/ClientProxy.h b/core/src/sdk/grpc/ClientProxy.h index eb21e9c4b5..e332266acf 100644 --- a/core/src/sdk/grpc/ClientProxy.h +++ b/core/src/sdk/grpc/ClientProxy.h @@ -60,7 +60,7 @@ class ClientProxy : public Connection { Status Search(const std::string& table_name, const std::vector& partiton_tags, const std::vector& query_record_array, const std::vector& query_range_array, int64_t topk, - int64_t nprobe, std::vector& topk_query_result_array) override; + int64_t nprobe, TopKQueryResult& topk_query_result) override; Status DescribeTable(const std::string& table_name, TableSchema& table_schema) override; diff --git a/core/src/sdk/grpc/GrpcClient.cpp b/core/src/sdk/grpc/GrpcClient.cpp index 29f378276d..44c6565ceb 100644 --- a/core/src/sdk/grpc/GrpcClient.cpp +++ b/core/src/sdk/grpc/GrpcClient.cpp @@ -134,20 +134,20 @@ GrpcClient::Insert(::milvus::grpc::VectorIds& vector_ids, const ::milvus::grpc:: } Status -GrpcClient::Search(::milvus::grpc::TopKQueryResultList& topk_query_result_list, +GrpcClient::Search(::milvus::grpc::TopKQueryResult& topk_query_result, const ::milvus::grpc::SearchParam& search_param) { ::milvus::grpc::TopKQueryResult query_result; ClientContext context; - ::grpc::Status grpc_status = stub_->Search(&context, search_param, &topk_query_result_list); + ::grpc::Status grpc_status = stub_->Search(&context, search_param, &topk_query_result); if (!grpc_status.ok()) { std::cerr << "SearchVector rpc failed!" << std::endl; std::cerr << grpc_status.error_message() << std::endl; return Status(StatusCode::RPCFailed, grpc_status.error_message()); } - if (topk_query_result_list.status().error_code() != grpc::SUCCESS) { - std::cerr << topk_query_result_list.status().reason() << std::endl; - return Status(StatusCode::ServerFailed, topk_query_result_list.status().reason()); + if (topk_query_result.status().error_code() != grpc::SUCCESS) { + std::cerr << topk_query_result.status().reason() << std::endl; + return Status(StatusCode::ServerFailed, topk_query_result.status().reason()); } return Status::OK(); diff --git a/core/src/sdk/grpc/GrpcClient.h b/core/src/sdk/grpc/GrpcClient.h index 8599f8a53f..329622dc59 100644 --- a/core/src/sdk/grpc/GrpcClient.h +++ b/core/src/sdk/grpc/GrpcClient.h @@ -57,7 +57,7 @@ class GrpcClient { Insert(grpc::VectorIds& vector_ids, const grpc::InsertParam& insert_param, Status& status); Status - Search(::milvus::grpc::TopKQueryResultList& topk_query_result_list, const grpc::SearchParam& search_param); + Search(::milvus::grpc::TopKQueryResult& topk_query_result, const grpc::SearchParam& search_param); Status DescribeTable(grpc::TableSchema& grpc_schema, const std::string& table_name); diff --git a/core/src/sdk/include/MilvusApi.h b/core/src/sdk/include/MilvusApi.h index ea1dbf6d75..0ec37fa9a4 100644 --- a/core/src/sdk/include/MilvusApi.h +++ b/core/src/sdk/include/MilvusApi.h @@ -78,19 +78,13 @@ struct RowRecord { std::vector data; ///< Vector raw data }; -/** - * @brief Query result - */ -struct QueryResult { - int64_t id; ///< Output result - double distance; ///< Vector similarity distance -}; - /** * @brief TopK query result */ struct TopKQueryResult { - std::vector query_result_arrays; ///< TopK query result + int64_t row_num; + std::vector ids; + std::vector distances; }; /** @@ -274,7 +268,7 @@ class Connection { virtual Status Search(const std::string& table_name, const std::vector& partiton_tags, const std::vector& query_record_array, const std::vector& query_range_array, int64_t topk, - int64_t nprobe, std::vector& topk_query_result_array) = 0; + int64_t nprobe, TopKQueryResult& topk_query_result) = 0; /** * @brief Show table description diff --git a/core/src/sdk/interface/ConnectionImpl.cpp b/core/src/sdk/interface/ConnectionImpl.cpp index 04531b46eb..448c011c1f 100644 --- a/core/src/sdk/interface/ConnectionImpl.cpp +++ b/core/src/sdk/interface/ConnectionImpl.cpp @@ -91,9 +91,9 @@ ConnectionImpl::Insert(const std::string& table_name, const std::string& partiti Status ConnectionImpl::Search(const std::string& table_name, const std::vector& partiton_tags, const std::vector& query_record_array, const std::vector& query_range_array, - int64_t topk, int64_t nprobe, std::vector& topk_query_result_array) { + int64_t topk, int64_t nprobe, TopKQueryResult& topk_query_result) { return client_proxy_->Search(table_name, partiton_tags, query_record_array, query_range_array, topk, nprobe, - topk_query_result_array); + topk_query_result); } Status diff --git a/core/src/sdk/interface/ConnectionImpl.h b/core/src/sdk/interface/ConnectionImpl.h index 199d22bf9d..126e59c375 100644 --- a/core/src/sdk/interface/ConnectionImpl.h +++ b/core/src/sdk/interface/ConnectionImpl.h @@ -62,7 +62,7 @@ class ConnectionImpl : public Connection { Status Search(const std::string& table_name, const std::vector& partiton_tags, const std::vector& query_record_array, const std::vector& query_range_array, int64_t topk, - int64_t nprobe, std::vector& topk_query_result_array) override; + int64_t nprobe, TopKQueryResult& topk_query_result) override; Status DescribeTable(const std::string& table_name, TableSchema& table_schema) override; diff --git a/core/src/server/Config.h b/core/src/server/Config.h index b82614e0b9..3ab0cd8053 100644 --- a/core/src/server/Config.h +++ b/core/src/server/Config.h @@ -93,11 +93,13 @@ static const char* CONFIG_RESOURCE_MODE = "mode"; static const char* CONFIG_RESOURCE_MODE_DEFAULT = "simple"; static const char* CONFIG_RESOURCE_SEARCH_RESOURCES = "search_resources"; static const char* CONFIG_RESOURCE_SEARCH_RESOURCES_DELIMITER = ","; + #ifdef MILVUS_CPU_VERSION static const char* CONFIG_RESOURCE_SEARCH_RESOURCES_DEFAULT = "cpu"; #else static const char* CONFIG_RESOURCE_SEARCH_RESOURCES_DEFAULT = "cpu,gpu0"; #endif + static const char* CONFIG_RESOURCE_INDEX_BUILD_DEVICE = "index_build_device"; #ifdef MILVUS_CPU_VERSION static const char* CONFIG_RESOURCE_INDEX_BUILD_DEVICE_DEFAULT = "cpu"; diff --git a/core/src/server/grpc_impl/GrpcRequestHandler.cpp b/core/src/server/grpc_impl/GrpcRequestHandler.cpp index bb38349b4a..a6680745ad 100644 --- a/core/src/server/grpc_impl/GrpcRequestHandler.cpp +++ b/core/src/server/grpc_impl/GrpcRequestHandler.cpp @@ -75,7 +75,7 @@ GrpcRequestHandler::Insert(::grpc::ServerContext* context, const ::milvus::grpc: ::grpc::Status GrpcRequestHandler::Search(::grpc::ServerContext* context, const ::milvus::grpc::SearchParam* request, - ::milvus::grpc::TopKQueryResultList* response) { + ::milvus::grpc::TopKQueryResult* response) { std::vector file_id_array; BaseTaskPtr task_ptr = SearchTask::Create(request, file_id_array, response); ::milvus::grpc::Status grpc_status; @@ -87,7 +87,7 @@ GrpcRequestHandler::Search(::grpc::ServerContext* context, const ::milvus::grpc: ::grpc::Status GrpcRequestHandler::SearchInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchInFilesParam* request, - ::milvus::grpc::TopKQueryResultList* response) { + ::milvus::grpc::TopKQueryResult* response) { std::vector file_id_array; for (int i = 0; i < request->file_id_array_size(); i++) { file_id_array.push_back(request->file_id_array(i)); diff --git a/core/src/server/grpc_impl/GrpcRequestHandler.h b/core/src/server/grpc_impl/GrpcRequestHandler.h index 11a7efbb98..7ba40af0de 100644 --- a/core/src/server/grpc_impl/GrpcRequestHandler.h +++ b/core/src/server/grpc_impl/GrpcRequestHandler.h @@ -153,7 +153,8 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service { // @return TopKQueryResultList ::grpc::Status Search(::grpc::ServerContext* context, const ::milvus::grpc::SearchParam* request, - ::milvus::grpc::TopKQueryResultList* response) override; + ::milvus::grpc::TopKQueryResult* response) override; + // * // @brief This method is used to query vector in specified files. // @@ -162,7 +163,8 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service { // @return TopKQueryResultList ::grpc::Status SearchInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchInFilesParam* request, - ::milvus::grpc::TopKQueryResultList* response) override; + ::milvus::grpc::TopKQueryResult* response) override; + // * // @brief This method is used to give the server status. // diff --git a/core/src/server/grpc_impl/GrpcRequestTask.cpp b/core/src/server/grpc_impl/GrpcRequestTask.cpp index 960b826635..b8a9dbccbf 100644 --- a/core/src/server/grpc_impl/GrpcRequestTask.cpp +++ b/core/src/server/grpc_impl/GrpcRequestTask.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include //#include @@ -542,16 +543,16 @@ InsertTask::OnExecute() { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SearchTask::SearchTask(const ::milvus::grpc::SearchParam* search_vector_infos, - const std::vector& file_id_array, ::milvus::grpc::TopKQueryResultList* response) + const std::vector& file_id_array, ::milvus::grpc::TopKQueryResult* response) : GrpcBaseTask(DQL_TASK_GROUP), search_param_(search_vector_infos), file_id_array_(file_id_array), - topk_result_list(response) { + topk_result_(response) { } BaseTaskPtr SearchTask::Create(const ::milvus::grpc::SearchParam* search_vector_infos, - const std::vector& file_id_array, ::milvus::grpc::TopKQueryResultList* response) { + const std::vector& file_id_array, ::milvus::grpc::TopKQueryResult* response) { if (search_vector_infos == nullptr) { SERVER_LOG_ERROR << "grpc input is null!"; return nullptr; @@ -679,18 +680,13 @@ SearchTask::OnExecute() { return Status::OK(); // empty table } - size_t result_k = result_ids.size() / record_count; - // step 7: construct result array - for (size_t i = 0; i < record_count; i++) { - ::milvus::grpc::TopKQueryResult* topk_query_result = topk_result_list->add_topk_query_result(); - for (size_t j = 0; j < result_k; j++) { - ::milvus::grpc::QueryResult* grpc_result = topk_query_result->add_query_result_arrays(); - size_t idx = i * result_k + j; - grpc_result->set_id(result_ids[idx]); - grpc_result->set_distance(result_distances[idx]); - } - } + topk_result_->set_row_num(record_count); + topk_result_->mutable_ids()->Resize(static_cast(result_ids.size()), 0); + memcpy(topk_result_->mutable_ids()->mutable_data(), result_ids.data(), result_ids.size() * sizeof(int64_t)); + topk_result_->mutable_distances()->Resize(static_cast(result_distances.size()), 0.0); + memcpy(topk_result_->mutable_distances()->mutable_data(), result_distances.data(), + result_distances.size() * sizeof(float)); // step 8: print time cost percent rc.RecordSection("construct result and send"); diff --git a/core/src/server/grpc_impl/GrpcRequestTask.h b/core/src/server/grpc_impl/GrpcRequestTask.h index 6f8e66af43..087c71aaaf 100644 --- a/core/src/server/grpc_impl/GrpcRequestTask.h +++ b/core/src/server/grpc_impl/GrpcRequestTask.h @@ -153,11 +153,11 @@ class SearchTask : public GrpcBaseTask { public: static BaseTaskPtr Create(const ::milvus::grpc::SearchParam* search_param, const std::vector& file_id_array, - ::milvus::grpc::TopKQueryResultList* response); + ::milvus::grpc::TopKQueryResult* response); protected: SearchTask(const ::milvus::grpc::SearchParam* search_param, const std::vector& file_id_array, - ::milvus::grpc::TopKQueryResultList* response); + ::milvus::grpc::TopKQueryResult* response); Status OnExecute() override; @@ -165,7 +165,7 @@ class SearchTask : public GrpcBaseTask { private: const ::milvus::grpc::SearchParam* search_param_; std::vector file_id_array_; - ::milvus::grpc::TopKQueryResultList* topk_result_list; + ::milvus::grpc::TopKQueryResult* topk_result_; }; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/core/src/server/grpc_impl/GrpcServer.cpp b/core/src/server/grpc_impl/GrpcServer.cpp index 5e0c5f3169..f5aca77798 100644 --- a/core/src/server/grpc_impl/GrpcServer.cpp +++ b/core/src/server/grpc_impl/GrpcServer.cpp @@ -93,7 +93,7 @@ GrpcServer::StartService() { builder.SetCompressionAlgorithmSupportStatus(GRPC_COMPRESS_STREAM_GZIP, true); builder.SetDefaultCompressionAlgorithm(GRPC_COMPRESS_STREAM_GZIP); - builder.SetDefaultCompressionLevel(GRPC_COMPRESS_LEVEL_HIGH); + builder.SetDefaultCompressionLevel(GRPC_COMPRESS_LEVEL_NONE); GrpcRequestHandler service; diff --git a/core/unittest/db/CMakeLists.txt b/core/unittest/db/CMakeLists.txt index 83f242a31a..f214394c7f 100644 --- a/core/unittest/db/CMakeLists.txt +++ b/core/unittest/db/CMakeLists.txt @@ -17,8 +17,16 @@ # under the License. #------------------------------------------------------------------------------- - -aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} test_files) +set(test_files + ${CMAKE_CURRENT_SOURCE_DIR}/test_db.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_db_mysql.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_engine.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_mem.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_meta.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_meta_mysql.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_misc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_search.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/utils.cpp) add_executable(test_db ${common_files} diff --git a/core/unittest/metrics/CMakeLists.txt b/core/unittest/metrics/CMakeLists.txt index eba8146baa..ad9d4e3943 100644 --- a/core/unittest/metrics/CMakeLists.txt +++ b/core/unittest/metrics/CMakeLists.txt @@ -17,7 +17,11 @@ # under the License. #------------------------------------------------------------------------------- -aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} test_files) +set(test_files + ${CMAKE_CURRENT_SOURCE_DIR}/test_metricbase.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_metrics.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_prometheus.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/utils.cpp) add_executable(test_metrics ${common_files} diff --git a/core/unittest/scheduler/CMakeLists.txt b/core/unittest/scheduler/CMakeLists.txt index 77404f3cba..0148441c2d 100644 --- a/core/unittest/scheduler/CMakeLists.txt +++ b/core/unittest/scheduler/CMakeLists.txt @@ -17,7 +17,17 @@ # under the License. #------------------------------------------------------------------------------- -aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} test_files) +set(test_files + ${CMAKE_CURRENT_SOURCE_DIR}/test_algorithm.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_event.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_node.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_normal.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_resource.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_resource_factory.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_resource_mgr.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_scheduler.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_task.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_tasktable.cpp) add_executable(test_scheduler ${common_files} diff --git a/core/unittest/scheduler/task_test.cpp b/core/unittest/scheduler/test_task.cpp similarity index 100% rename from core/unittest/scheduler/task_test.cpp rename to core/unittest/scheduler/test_task.cpp diff --git a/core/unittest/server/CMakeLists.txt b/core/unittest/server/CMakeLists.txt index 38309611da..a64efbae49 100644 --- a/core/unittest/server/CMakeLists.txt +++ b/core/unittest/server/CMakeLists.txt @@ -17,7 +17,12 @@ # under the License. #------------------------------------------------------------------------------- -aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} test_files) +set(test_files + ${CMAKE_CURRENT_SOURCE_DIR}/test_cache.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_config.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_rpc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_util.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/utils.cpp) include_directories("${CUDA_TOOLKIT_ROOT_DIR}/include") link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64") diff --git a/core/unittest/server/test_config.cpp b/core/unittest/server/test_config.cpp index 6a62ddd97c..637273732d 100644 --- a/core/unittest/server/test_config.cpp +++ b/core/unittest/server/test_config.cpp @@ -415,6 +415,9 @@ TEST_F(ConfigTest, SERVER_CONFIG_INVALID_TEST) { s = config.SetResourceConfigSearchResources("gpu10"); ASSERT_FALSE(s.ok()); + s = config.SetResourceConfigSearchResources("cpu"); + ASSERT_TRUE(s.ok()); + s = config.SetResourceConfigIndexBuildDevice("gup2"); ASSERT_FALSE(s.ok()); s = config.SetResourceConfigIndexBuildDevice("gpu16"); @@ -435,3 +438,4 @@ TEST_F(ConfigTest, SERVER_CONFIG_TEST) { s = config.ResetDefaultConfig(); ASSERT_TRUE(s.ok()); } + diff --git a/core/unittest/server/test_rpc.cpp b/core/unittest/server/test_rpc.cpp index 4d5b9e3567..76c10769a7 100644 --- a/core/unittest/server/test_rpc.cpp +++ b/core/unittest/server/test_rpc.cpp @@ -43,6 +43,12 @@ static constexpr int64_t VECTOR_COUNT = 1000; static constexpr int64_t INSERT_LOOP = 10; constexpr int64_t SECONDS_EACH_HOUR = 3600; +void CopyRowRecord(::milvus::grpc::RowRecord* target, const std::vector& src) { + auto vector_data = target->mutable_vector_data(); + vector_data->Resize(static_cast(src.size()), 0.0); + memcpy(vector_data->mutable_data(), src.data(), src.size()* sizeof(float)); +} + class RpcHandlerTest : public testing::Test { protected: void @@ -201,9 +207,7 @@ TEST_F(RpcHandlerTest, INSERT_TEST) { ::milvus::grpc::VectorIds vector_ids; for (auto& record : record_array) { ::milvus::grpc::RowRecord* grpc_record = request.add_row_record_array(); - for (size_t i = 0; i < record.size(); i++) { - grpc_record->add_vector_data(record[i]); - } + CopyRowRecord(grpc_record, record); } handler->Insert(&context, &request, &vector_ids); ASSERT_EQ(vector_ids.vector_id_array_size(), VECTOR_COUNT); @@ -212,8 +216,8 @@ TEST_F(RpcHandlerTest, INSERT_TEST) { TEST_F(RpcHandlerTest, SEARCH_TEST) { ::grpc::ServerContext context; ::milvus::grpc::SearchParam request; - ::milvus::grpc::TopKQueryResultList response; - // test null input + ::milvus::grpc::TopKQueryResult response; + //test null input handler->Search(&context, nullptr, &response); // test invalid table name @@ -240,22 +244,17 @@ TEST_F(RpcHandlerTest, SEARCH_TEST) { ::milvus::grpc::InsertParam insert_param; for (auto& record : record_array) { ::milvus::grpc::RowRecord* grpc_record = insert_param.add_row_record_array(); - for (size_t i = 0; i < record.size(); i++) { - grpc_record->add_vector_data(record[i]); - } + CopyRowRecord(grpc_record, record); } // insert vectors insert_param.set_table_name(TABLE_NAME); ::milvus::grpc::VectorIds vector_ids; handler->Insert(&context, &insert_param, &vector_ids); - sleep(7); BuildVectors(0, 10, record_array); for (auto& record : record_array) { ::milvus::grpc::RowRecord* row_record = request.add_query_record_array(); - for (auto& rec : record) { - row_record->add_vector_data(rec); - } + CopyRowRecord(row_record, record); } handler->Search(&context, &request, &response); @@ -324,9 +323,7 @@ TEST_F(RpcHandlerTest, TABLES_TEST) { for (auto& record : record_array) { ::milvus::grpc::RowRecord* grpc_record = request.add_row_record_array(); - for (size_t i = 0; i < record.size(); i++) { - grpc_record->add_vector_data(record[i]); - } + CopyRowRecord(grpc_record, record); } // test vector_id size not equal to row record size vector_ids.clear_vector_id_array(); @@ -341,9 +338,7 @@ TEST_F(RpcHandlerTest, TABLES_TEST) { vector_ids.clear_vector_id_array(); for (uint64_t i = 0; i < 10; ++i) { ::milvus::grpc::RowRecord* grpc_record = request.add_row_record_array(); - for (size_t j = 0; j < 10; j++) { - grpc_record->add_vector_data(record_array[i][j]); - } + CopyRowRecord(grpc_record, record_array[i]); } handler->Insert(&context, &request, &vector_ids);