From 48064dfdee661e5eef38537ffebdd6332a03a917 Mon Sep 17 00:00:00 2001 From: kun yu Date: Mon, 22 Jul 2019 10:14:23 +0800 Subject: [PATCH] add grpc Former-commit-id: aee405b98f44290051fe022387c42bcb6d68cc76 --- cpp/src/CMakeLists.txt | 16 +- cpp/src/grpc/cpp_gen.sh | 9 + cpp/src/grpc/gen-milvus/milvus.grpc.pb.cc | 405 ++ cpp/src/grpc/gen-milvus/milvus.grpc.pb.h | 2003 ++++++ cpp/src/grpc/gen-milvus/milvus.pb.cc | 5987 +++++++++++++++++ cpp/src/grpc/gen-milvus/milvus.pb.h | 3376 ++++++++++ cpp/src/grpc/gen-status/status.grpc.pb.cc | 22 + cpp/src/grpc/gen-status/status.grpc.pb.h | 35 + cpp/src/grpc/gen-status/status.pb.cc | 494 ++ cpp/src/grpc/gen-status/status.pb.h | 333 + cpp/src/grpc/milvus.proto | 250 + cpp/src/grpc/status.proto | 33 + cpp/src/grpcsdk/CMakeLists.txt | 38 + cpp/src/grpcsdk/examples/CMakeLists.txt | 24 + cpp/src/grpcsdk/examples/main.cpp | 68 + cpp/src/grpcsdk/examples/src/ClientTest.cpp | 291 + cpp/src/grpcsdk/examples/src/ClientTest.h | 13 + cpp/src/grpcsdk/include/MilvusApi.h | 384 ++ cpp/src/grpcsdk/include/Status.h | 330 + cpp/src/grpcsdk/src/client/ClientProxy.cpp | 313 + cpp/src/grpcsdk/src/client/ClientProxy.h | 66 + cpp/src/grpcsdk/src/client/grpcClient.cpp | 168 + cpp/src/grpcsdk/src/client/grpcClient.h | 62 + .../grpcsdk/src/interface/ConnectionImpl.cpp | 118 + .../grpcsdk/src/interface/ConnectionImpl.h | 62 + cpp/src/grpcsdk/src/interface/Status.cpp | 129 + cpp/src/grpcsdk/src/util/Exception.h | 34 + cpp/src/grpcserver/DBWrapper.cpp | 102 + cpp/src/grpcserver/DBWrapper.h | 34 + cpp/src/grpcserver/MilvusServer.cpp | 101 + cpp/src/grpcserver/MilvusServer.h | 33 + cpp/src/grpcserver/RequestHandler.cpp | 120 + cpp/src/grpcserver/RequestHandler.h | 175 + cpp/src/grpcserver/RequestScheduler.cpp | 221 + cpp/src/grpcserver/RequestScheduler.h | 90 + cpp/src/grpcserver/RequestTask.cpp | 649 ++ cpp/src/grpcserver/RequestTask.h | 180 + cpp/src/grpcserver/Server.cpp | 245 + cpp/src/grpcserver/Server.h | 47 + cpp/src/grpcserver/ServerConfig.cpp | 82 + cpp/src/grpcserver/ServerConfig.h | 67 + cpp/src/main.cpp | 3 +- cpp/src/sdk/src/client/ClientProxy.cpp | 1 + cpp/src/sdk/src/interface/ConnectionImpl.h | 2 +- 44 files changed, 17211 insertions(+), 4 deletions(-) create mode 100644 cpp/src/grpc/cpp_gen.sh create mode 100644 cpp/src/grpc/gen-milvus/milvus.grpc.pb.cc create mode 100644 cpp/src/grpc/gen-milvus/milvus.grpc.pb.h create mode 100644 cpp/src/grpc/gen-milvus/milvus.pb.cc create mode 100644 cpp/src/grpc/gen-milvus/milvus.pb.h create mode 100644 cpp/src/grpc/gen-status/status.grpc.pb.cc create mode 100644 cpp/src/grpc/gen-status/status.grpc.pb.h create mode 100644 cpp/src/grpc/gen-status/status.pb.cc create mode 100644 cpp/src/grpc/gen-status/status.pb.h create mode 100644 cpp/src/grpc/milvus.proto create mode 100644 cpp/src/grpc/status.proto create mode 100644 cpp/src/grpcsdk/CMakeLists.txt create mode 100644 cpp/src/grpcsdk/examples/CMakeLists.txt create mode 100644 cpp/src/grpcsdk/examples/main.cpp create mode 100644 cpp/src/grpcsdk/examples/src/ClientTest.cpp create mode 100644 cpp/src/grpcsdk/examples/src/ClientTest.h create mode 100644 cpp/src/grpcsdk/include/MilvusApi.h create mode 100644 cpp/src/grpcsdk/include/Status.h create mode 100644 cpp/src/grpcsdk/src/client/ClientProxy.cpp create mode 100644 cpp/src/grpcsdk/src/client/ClientProxy.h create mode 100644 cpp/src/grpcsdk/src/client/grpcClient.cpp create mode 100644 cpp/src/grpcsdk/src/client/grpcClient.h create mode 100644 cpp/src/grpcsdk/src/interface/ConnectionImpl.cpp create mode 100644 cpp/src/grpcsdk/src/interface/ConnectionImpl.h create mode 100644 cpp/src/grpcsdk/src/interface/Status.cpp create mode 100644 cpp/src/grpcsdk/src/util/Exception.h create mode 100644 cpp/src/grpcserver/DBWrapper.cpp create mode 100644 cpp/src/grpcserver/DBWrapper.h create mode 100644 cpp/src/grpcserver/MilvusServer.cpp create mode 100644 cpp/src/grpcserver/MilvusServer.h create mode 100644 cpp/src/grpcserver/RequestHandler.cpp create mode 100644 cpp/src/grpcserver/RequestHandler.h create mode 100644 cpp/src/grpcserver/RequestScheduler.cpp create mode 100644 cpp/src/grpcserver/RequestScheduler.h create mode 100644 cpp/src/grpcserver/RequestTask.cpp create mode 100644 cpp/src/grpcserver/RequestTask.h create mode 100644 cpp/src/grpcserver/Server.cpp create mode 100644 cpp/src/grpcserver/Server.h create mode 100644 cpp/src/grpcserver/ServerConfig.cpp create mode 100644 cpp/src/grpcserver/ServerConfig.h diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index 00e2e1e87d..84b225efbe 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -8,6 +8,7 @@ aux_source_directory(cache cache_files) aux_source_directory(config config_files) aux_source_directory(server server_files) +aux_source_directory(grpcserver grpcserver_files) aux_source_directory(utils utils_files) aux_source_directory(db db_files) aux_source_directory(wrapper wrapper_files) @@ -40,6 +41,10 @@ set(service_files metrics/SystemInfo.h server/ThreadPoolServer.cpp server/ThreadPoolServer.h + grpc/gen-milvus/milvus.grpc.pb.cc + grpc/gen-milvus/milvus.pb.cc + grpc/gen-status/status.grpc.pb.cc + grpc/gen-status/status.pb.cc ) set(engine_files @@ -63,11 +68,16 @@ include_directories(/usr/include) include_directories("${CUDA_TOOLKIT_ROOT_DIR}/include") include_directories(thrift/gen-cpp) include_directories(/usr/include/mysql) +include_directories(grpc/gen-status) +include_directories(grpc/gen-milvus) set(third_party_libs easyloggingpp sqlite thrift + grpc + grpc++ + grpcpp_channelz yaml-cpp libgpufaiss.a faiss @@ -158,7 +168,8 @@ set(server_libs add_executable(milvus_server ${config_files} - ${server_files} +# ${server_files} + ${grpcserver_files} ${utils_files} ${service_files} ${metrics_files} @@ -189,4 +200,5 @@ install(FILES ${CMAKE_BINARY_DIR}/mysqlpp_ep-prefix/src/mysqlpp_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}mysqlpp${CMAKE_SHARED_LIBRARY_SUFFIX}.3.2.4 DESTINATION lib) #need to copy libmysqlpp.so -add_subdirectory(sdk) +#add_subdirectory(sdk) +add_subdirectory(grpcsdk) diff --git a/cpp/src/grpc/cpp_gen.sh b/cpp/src/grpc/cpp_gen.sh new file mode 100644 index 0000000000..91cbc907a6 --- /dev/null +++ b/cpp/src/grpc/cpp_gen.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +protoc -I . --grpc_out=./gen-status --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` status.proto + +protoc -I . --cpp_out=./gen-status status.proto + +protoc -I . --grpc_out=./gen-milvus --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` milvus.proto + +protoc -I . --cpp_out=./gen-milvus milvus.proto \ No newline at end of file diff --git a/cpp/src/grpc/gen-milvus/milvus.grpc.pb.cc b/cpp/src/grpc/gen-milvus/milvus.grpc.pb.cc new file mode 100644 index 0000000000..41cc8c03f4 --- /dev/null +++ b/cpp/src/grpc/gen-milvus/milvus.grpc.pb.cc @@ -0,0 +1,405 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: milvus.proto + +#include "milvus.pb.h" +#include "milvus.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace milvus { +namespace grpc { + +static const char* MilvusService_method_names[] = { + "/milvus.grpc.MilvusService/CreateTable", + "/milvus.grpc.MilvusService/HasTable", + "/milvus.grpc.MilvusService/DropTable", + "/milvus.grpc.MilvusService/BuildIndex", + "/milvus.grpc.MilvusService/InsertVector", + "/milvus.grpc.MilvusService/SearchVector", + "/milvus.grpc.MilvusService/SearchVectorInFiles", + "/milvus.grpc.MilvusService/DescribeTable", + "/milvus.grpc.MilvusService/GetTableRowCount", + "/milvus.grpc.MilvusService/ShowTables", + "/milvus.grpc.MilvusService/Ping", +}; + +std::unique_ptr< MilvusService::Stub> MilvusService::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { + (void)options; + std::unique_ptr< MilvusService::Stub> stub(new MilvusService::Stub(channel)); + return stub; +} + +MilvusService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) + : channel_(channel), rpcmethod_CreateTable_(MilvusService_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_HasTable_(MilvusService_method_names[1], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_DropTable_(MilvusService_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_BuildIndex_(MilvusService_method_names[3], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_InsertVector_(MilvusService_method_names[4], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_SearchVector_(MilvusService_method_names[5], ::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + , rpcmethod_SearchVectorInFiles_(MilvusService_method_names[6], ::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + , rpcmethod_DescribeTable_(MilvusService_method_names[7], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_GetTableRowCount_(MilvusService_method_names[8], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_ShowTables_(MilvusService_method_names[9], ::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + , rpcmethod_Ping_(MilvusService_method_names[10], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + {} + +::grpc::Status MilvusService::Stub::CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::milvus::Status* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreateTable_, context, request, response); +} + +void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateTable_, context, request, response, std::move(f)); +} + +void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateTable_, context, request, response, std::move(f)); +} + +::grpc::ClientAsyncResponseReader< ::milvus::Status>* MilvusService::Stub::AsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::Status>::Create(channel_.get(), cq, rpcmethod_CreateTable_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::milvus::Status>* MilvusService::Stub::PrepareAsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::Status>::Create(channel_.get(), cq, rpcmethod_CreateTable_, context, request, false); +} + +::grpc::Status MilvusService::Stub::HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::BoolReply* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_HasTable_, context, request, response); +} + +void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasTable_, context, request, response, std::move(f)); +} + +void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasTable_, context, request, response, std::move(f)); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::AsyncHasTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasTable_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::PrepareAsyncHasTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasTable_, context, request, false); +} + +::grpc::Status MilvusService::Stub::DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::Status* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DropTable_, context, request, response); +} + +void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropTable_, context, request, response, std::move(f)); +} + +void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropTable_, context, request, response, std::move(f)); +} + +::grpc::ClientAsyncResponseReader< ::milvus::Status>* MilvusService::Stub::AsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::Status>::Create(channel_.get(), cq, rpcmethod_DropTable_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::milvus::Status>* MilvusService::Stub::PrepareAsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::Status>::Create(channel_.get(), cq, rpcmethod_DropTable_, context, request, false); +} + +::grpc::Status MilvusService::Stub::BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::Status* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_BuildIndex_, context, request, response); +} + +void MilvusService::Stub::experimental_async::BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_BuildIndex_, context, request, response, std::move(f)); +} + +void MilvusService::Stub::experimental_async::BuildIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_BuildIndex_, context, request, response, std::move(f)); +} + +::grpc::ClientAsyncResponseReader< ::milvus::Status>* MilvusService::Stub::AsyncBuildIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::Status>::Create(channel_.get(), cq, rpcmethod_BuildIndex_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::milvus::Status>* MilvusService::Stub::PrepareAsyncBuildIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::Status>::Create(channel_.get(), cq, rpcmethod_BuildIndex_, context, request, false); +} + +::grpc::Status MilvusService::Stub::InsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::milvus::grpc::VectorIds* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_InsertVector_, context, request, response); +} + +void MilvusService::Stub::experimental_async::InsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_InsertVector_, context, request, response, std::move(f)); +} + +void MilvusService::Stub::experimental_async::InsertVector(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::VectorIds* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_InsertVector_, context, request, response, std::move(f)); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>* MilvusService::Stub::AsyncInsertVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::VectorIds>::Create(channel_.get(), cq, rpcmethod_InsertVector_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>* MilvusService::Stub::PrepareAsyncInsertVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::VectorIds>::Create(channel_.get(), cq, rpcmethod_InsertVector_, context, request, false); +} + +::grpc::ClientReader< ::milvus::grpc::TopKQueryResult>* MilvusService::Stub::SearchVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request) { + return ::grpc::internal::ClientReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(channel_.get(), rpcmethod_SearchVector_, context, request); +} + +void MilvusService::Stub::experimental_async::SearchVector(::grpc::ClientContext* context, ::milvus::grpc::SearchVectorInfos* request, ::grpc::experimental::ClientReadReactor< ::milvus::grpc::TopKQueryResult>* reactor) { + ::grpc::internal::ClientCallbackReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(stub_->channel_.get(), stub_->rpcmethod_SearchVector_, context, request, reactor); +} + +::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>* MilvusService::Stub::AsyncSearchVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request, ::grpc::CompletionQueue* cq, void* tag) { + return ::grpc::internal::ClientAsyncReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(channel_.get(), cq, rpcmethod_SearchVector_, context, request, true, tag); +} + +::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>* MilvusService::Stub::PrepareAsyncSearchVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(channel_.get(), cq, rpcmethod_SearchVector_, context, request, false, nullptr); +} + +::grpc::ClientReader< ::milvus::grpc::TopKQueryResult>* MilvusService::Stub::SearchVectorInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request) { + return ::grpc::internal::ClientReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(channel_.get(), rpcmethod_SearchVectorInFiles_, context, request); +} + +void MilvusService::Stub::experimental_async::SearchVectorInFiles(::grpc::ClientContext* context, ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::experimental::ClientReadReactor< ::milvus::grpc::TopKQueryResult>* reactor) { + ::grpc::internal::ClientCallbackReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(stub_->channel_.get(), stub_->rpcmethod_SearchVectorInFiles_, context, request, reactor); +} + +::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>* MilvusService::Stub::AsyncSearchVectorInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request, ::grpc::CompletionQueue* cq, void* tag) { + return ::grpc::internal::ClientAsyncReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(channel_.get(), cq, rpcmethod_SearchVectorInFiles_, context, request, true, tag); +} + +::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>* MilvusService::Stub::PrepareAsyncSearchVectorInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncReaderFactory< ::milvus::grpc::TopKQueryResult>::Create(channel_.get(), cq, rpcmethod_SearchVectorInFiles_, context, request, false, nullptr); +} + +::grpc::Status MilvusService::Stub::DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableSchema* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DescribeTable_, context, request, response); +} + +void MilvusService::Stub::experimental_async::DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeTable_, context, request, response, std::move(f)); +} + +void MilvusService::Stub::experimental_async::DescribeTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableSchema* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeTable_, context, request, response, std::move(f)); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>* MilvusService::Stub::AsyncDescribeTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableSchema>::Create(channel_.get(), cq, rpcmethod_DescribeTable_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>* MilvusService::Stub::PrepareAsyncDescribeTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableSchema>::Create(channel_.get(), cq, rpcmethod_DescribeTable_, context, request, false); +} + +::grpc::Status MilvusService::Stub::GetTableRowCount(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableRowCount* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_GetTableRowCount_, context, request, response); +} + +void MilvusService::Stub::experimental_async::GetTableRowCount(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_GetTableRowCount_, context, request, response, std::move(f)); +} + +void MilvusService::Stub::experimental_async::GetTableRowCount(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableRowCount* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_GetTableRowCount_, context, request, response, std::move(f)); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>* MilvusService::Stub::AsyncGetTableRowCountRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableRowCount>::Create(channel_.get(), cq, rpcmethod_GetTableRowCount_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>* MilvusService::Stub::PrepareAsyncGetTableRowCountRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableRowCount>::Create(channel_.get(), cq, rpcmethod_GetTableRowCount_, context, request, false); +} + +::grpc::ClientReader< ::milvus::grpc::TableName>* MilvusService::Stub::ShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request) { + return ::grpc::internal::ClientReaderFactory< ::milvus::grpc::TableName>::Create(channel_.get(), rpcmethod_ShowTables_, context, request); +} + +void MilvusService::Stub::experimental_async::ShowTables(::grpc::ClientContext* context, ::milvus::grpc::Command* request, ::grpc::experimental::ClientReadReactor< ::milvus::grpc::TableName>* reactor) { + ::grpc::internal::ClientCallbackReaderFactory< ::milvus::grpc::TableName>::Create(stub_->channel_.get(), stub_->rpcmethod_ShowTables_, context, request, reactor); +} + +::grpc::ClientAsyncReader< ::milvus::grpc::TableName>* MilvusService::Stub::AsyncShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq, void* tag) { + return ::grpc::internal::ClientAsyncReaderFactory< ::milvus::grpc::TableName>::Create(channel_.get(), cq, rpcmethod_ShowTables_, context, request, true, tag); +} + +::grpc::ClientAsyncReader< ::milvus::grpc::TableName>* MilvusService::Stub::PrepareAsyncShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncReaderFactory< ::milvus::grpc::TableName>::Create(channel_.get(), cq, rpcmethod_ShowTables_, context, request, false, nullptr); +} + +::grpc::Status MilvusService::Stub::Ping(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::ServerStatus* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Ping_, context, request, response); +} + +void MilvusService::Stub::experimental_async::Ping(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Ping_, context, request, response, std::move(f)); +} + +void MilvusService::Stub::experimental_async::Ping(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::ServerStatus* response, std::function f) { + return ::grpc::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Ping_, context, request, response, std::move(f)); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::ServerStatus>* MilvusService::Stub::AsyncPingRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::ServerStatus>::Create(channel_.get(), cq, rpcmethod_Ping_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::ServerStatus>* MilvusService::Stub::PrepareAsyncPingRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::ServerStatus>::Create(channel_.get(), cq, rpcmethod_Ping_, context, request, false); +} + +MilvusService::Service::Service() { + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[0], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableSchema, ::milvus::Status>( + std::mem_fn(&MilvusService::Service::CreateTable), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[1], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::BoolReply>( + std::mem_fn(&MilvusService::Service::HasTable), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[2], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::Status>( + std::mem_fn(&MilvusService::Service::DropTable), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[3], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::Status>( + std::mem_fn(&MilvusService::Service::BuildIndex), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[4], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::InsertInfos, ::milvus::grpc::VectorIds>( + std::mem_fn(&MilvusService::Service::InsertVector), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[5], + ::grpc::internal::RpcMethod::SERVER_STREAMING, + new ::grpc::internal::ServerStreamingHandler< MilvusService::Service, ::milvus::grpc::SearchVectorInfos, ::milvus::grpc::TopKQueryResult>( + std::mem_fn(&MilvusService::Service::SearchVector), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[6], + ::grpc::internal::RpcMethod::SERVER_STREAMING, + new ::grpc::internal::ServerStreamingHandler< MilvusService::Service, ::milvus::grpc::SearchVectorInFilesInfos, ::milvus::grpc::TopKQueryResult>( + std::mem_fn(&MilvusService::Service::SearchVectorInFiles), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[7], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::TableSchema>( + std::mem_fn(&MilvusService::Service::DescribeTable), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[8], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::TableRowCount>( + std::mem_fn(&MilvusService::Service::GetTableRowCount), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[9], + ::grpc::internal::RpcMethod::SERVER_STREAMING, + new ::grpc::internal::ServerStreamingHandler< MilvusService::Service, ::milvus::grpc::Command, ::milvus::grpc::TableName>( + std::mem_fn(&MilvusService::Service::ShowTables), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + MilvusService_method_names[10], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::Command, ::milvus::grpc::ServerStatus>( + std::mem_fn(&MilvusService::Service::Ping), this))); +} + +MilvusService::Service::~Service() { +} + +::grpc::Status MilvusService::Service::CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status MilvusService::Service::HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status MilvusService::Service::DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status MilvusService::Service::BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status MilvusService::Service::InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status MilvusService::Service::SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) { + (void) context; + (void) request; + (void) writer; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status MilvusService::Service::SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) { + (void) context; + (void) request; + (void) writer; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status MilvusService::Service::DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status MilvusService::Service::GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status MilvusService::Service::ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer) { + (void) context; + (void) request; + (void) writer; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status MilvusService::Service::Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + + +} // namespace milvus +} // namespace grpc + diff --git a/cpp/src/grpc/gen-milvus/milvus.grpc.pb.h b/cpp/src/grpc/gen-milvus/milvus.grpc.pb.h new file mode 100644 index 0000000000..464b9ad50f --- /dev/null +++ b/cpp/src/grpc/gen-milvus/milvus.grpc.pb.h @@ -0,0 +1,2003 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: milvus.proto +#ifndef GRPC_milvus_2eproto__INCLUDED +#define GRPC_milvus_2eproto__INCLUDED + +#include "milvus.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc { +class CompletionQueue; +class Channel; +class ServerCompletionQueue; +class ServerContext; +} // namespace grpc + +namespace milvus { +namespace grpc { + +class MilvusService final { + public: + static constexpr char const* service_full_name() { + return "milvus.grpc.MilvusService"; + } + class StubInterface { + public: + virtual ~StubInterface() {} + // * + // @brief Create table method + // + // This method is used to create table + // + // @param param, use to provide table information to be created. + // + virtual ::grpc::Status CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::milvus::Status* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>> AsyncCreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>>(AsyncCreateTableRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>> PrepareAsyncCreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>>(PrepareAsyncCreateTableRaw(context, request, cq)); + } + // * + // @brief Test table existence method + // + // This method is used to test table existence. + // + // @param table_name, table name is going to be tested. + // + virtual ::grpc::Status HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::BoolReply* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>> AsyncHasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>>(AsyncHasTableRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>> PrepareAsyncHasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>>(PrepareAsyncHasTableRaw(context, request, cq)); + } + // * + // @brief Delete table method + // + // This method is used to delete table. + // + // @param table_name, table name is going to be deleted. + // + virtual ::grpc::Status DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::Status* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>> AsyncDropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>>(AsyncDropTableRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>> PrepareAsyncDropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>>(PrepareAsyncDropTableRaw(context, request, cq)); + } + // * + // @brief Build index by table method + // + // This method is used to build index by table in sync mode. + // + // @param table_name, table is going to be built index. + // + virtual ::grpc::Status BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::Status* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>> AsyncBuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>>(AsyncBuildIndexRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>> PrepareAsyncBuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>>(PrepareAsyncBuildIndexRaw(context, request, cq)); + } + // * + // @brief Add vector array to table + // + // This method is used to add vector array to table. + // + // @param table_name, table_name is inserted. + // @param record_array, vector array is inserted. + // + // @return vector id array + virtual ::grpc::Status InsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::milvus::grpc::VectorIds* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::VectorIds>> AsyncInsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::VectorIds>>(AsyncInsertVectorRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::VectorIds>> PrepareAsyncInsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::VectorIds>>(PrepareAsyncInsertVectorRaw(context, request, cq)); + } + // * + // @brief Query vector + // + // This method is used to query vector in table. + // + // @param table_name, table_name is queried. + // @param query_record_array, all vector are going to be queried. + // @param query_range_array, optional ranges for conditional search. If not specified, search whole table + // @param topk, how many similarity vectors will be searched. + // + // @return query result array. + std::unique_ptr< ::grpc::ClientReaderInterface< ::milvus::grpc::TopKQueryResult>> SearchVector(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request) { + return std::unique_ptr< ::grpc::ClientReaderInterface< ::milvus::grpc::TopKQueryResult>>(SearchVectorRaw(context, request)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>> AsyncSearchVector(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>>(AsyncSearchVectorRaw(context, request, cq, tag)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>> PrepareAsyncSearchVector(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>>(PrepareAsyncSearchVectorRaw(context, request, cq)); + } + // * + // @brief Internal use query interface + // + // This method is used to query vector in specified files. + // + // @param file_id_array, specified files id array, queried. + // @param query_record_array, all vector are going to be queried. + // @param query_range_array, optional ranges for conditional search. If not specified, search whole table + // @param topk, how many similarity vectors will be searched. + // + // @return query result array. + std::unique_ptr< ::grpc::ClientReaderInterface< ::milvus::grpc::TopKQueryResult>> SearchVectorInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request) { + return std::unique_ptr< ::grpc::ClientReaderInterface< ::milvus::grpc::TopKQueryResult>>(SearchVectorInFilesRaw(context, request)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>> AsyncSearchVectorInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>>(AsyncSearchVectorInFilesRaw(context, request, cq, tag)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>> PrepareAsyncSearchVectorInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>>(PrepareAsyncSearchVectorInFilesRaw(context, request, cq)); + } + // * + // @brief Get table schema + // + // This method is used to get table schema. + // + // @param table_name, target table name. + // + // @return table schema + virtual ::grpc::Status DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableSchema* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableSchema>> AsyncDescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableSchema>>(AsyncDescribeTableRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableSchema>> PrepareAsyncDescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableSchema>>(PrepareAsyncDescribeTableRaw(context, request, cq)); + } + // * + // @brief Get table schema + // + // This method is used to get table schema. + // + // @param table_name, target table name. + // + // @return table schema + virtual ::grpc::Status GetTableRowCount(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableRowCount* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableRowCount>> AsyncGetTableRowCount(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableRowCount>>(AsyncGetTableRowCountRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableRowCount>> PrepareAsyncGetTableRowCount(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableRowCount>>(PrepareAsyncGetTableRowCountRaw(context, request, cq)); + } + // * + // @brief List all tables in database + // + // This method is used to list all tables. + // + // + // @return table names. + std::unique_ptr< ::grpc::ClientReaderInterface< ::milvus::grpc::TableName>> ShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command& request) { + return std::unique_ptr< ::grpc::ClientReaderInterface< ::milvus::grpc::TableName>>(ShowTablesRaw(context, request)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TableName>> AsyncShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TableName>>(AsyncShowTablesRaw(context, request, cq, tag)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TableName>> PrepareAsyncShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TableName>>(PrepareAsyncShowTablesRaw(context, request, cq)); + } + // * + // @brief Give the server status + // + // This method is used to give the server status. + // + // @return Server status. + virtual ::grpc::Status Ping(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::ServerStatus* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::ServerStatus>> AsyncPing(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::ServerStatus>>(AsyncPingRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::ServerStatus>> PrepareAsyncPing(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::ServerStatus>>(PrepareAsyncPingRaw(context, request, cq)); + } + class experimental_async_interface { + public: + virtual ~experimental_async_interface() {} + // * + // @brief Create table method + // + // This method is used to create table + // + // @param param, use to provide table information to be created. + // + virtual void CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response, std::function) = 0; + virtual void CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function) = 0; + // * + // @brief Test table existence method + // + // This method is used to test table existence. + // + // @param table_name, table name is going to be tested. + // + virtual void HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response, std::function) = 0; + virtual void HasTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function) = 0; + // * + // @brief Delete table method + // + // This method is used to delete table. + // + // @param table_name, table name is going to be deleted. + // + virtual void DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response, std::function) = 0; + virtual void DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function) = 0; + // * + // @brief Build index by table method + // + // This method is used to build index by table in sync mode. + // + // @param table_name, table is going to be built index. + // + virtual void BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response, std::function) = 0; + virtual void BuildIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function) = 0; + // * + // @brief Add vector array to table + // + // This method is used to add vector array to table. + // + // @param table_name, table_name is inserted. + // @param record_array, vector array is inserted. + // + // @return vector id array + virtual void InsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response, std::function) = 0; + virtual void InsertVector(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::VectorIds* response, std::function) = 0; + // * + // @brief Query vector + // + // This method is used to query vector in table. + // + // @param table_name, table_name is queried. + // @param query_record_array, all vector are going to be queried. + // @param query_range_array, optional ranges for conditional search. If not specified, search whole table + // @param topk, how many similarity vectors will be searched. + // + // @return query result array. + virtual void SearchVector(::grpc::ClientContext* context, ::milvus::grpc::SearchVectorInfos* request, ::grpc::experimental::ClientReadReactor< ::milvus::grpc::TopKQueryResult>* reactor) = 0; + // * + // @brief Internal use query interface + // + // This method is used to query vector in specified files. + // + // @param file_id_array, specified files id array, queried. + // @param query_record_array, all vector are going to be queried. + // @param query_range_array, optional ranges for conditional search. If not specified, search whole table + // @param topk, how many similarity vectors will be searched. + // + // @return query result array. + virtual void SearchVectorInFiles(::grpc::ClientContext* context, ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::experimental::ClientReadReactor< ::milvus::grpc::TopKQueryResult>* reactor) = 0; + // * + // @brief Get table schema + // + // This method is used to get table schema. + // + // @param table_name, target table name. + // + // @return table schema + virtual void DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response, std::function) = 0; + virtual void DescribeTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableSchema* response, std::function) = 0; + // * + // @brief Get table schema + // + // This method is used to get table schema. + // + // @param table_name, target table name. + // + // @return table schema + virtual void GetTableRowCount(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response, std::function) = 0; + virtual void GetTableRowCount(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableRowCount* response, std::function) = 0; + // * + // @brief List all tables in database + // + // This method is used to list all tables. + // + // + // @return table names. + virtual void ShowTables(::grpc::ClientContext* context, ::milvus::grpc::Command* request, ::grpc::experimental::ClientReadReactor< ::milvus::grpc::TableName>* reactor) = 0; + // * + // @brief Give the server status + // + // This method is used to give the server status. + // + // @return Server status. + virtual void Ping(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response, std::function) = 0; + virtual void Ping(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::ServerStatus* response, std::function) = 0; + }; + virtual class experimental_async_interface* experimental_async() { return nullptr; } + private: + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>* AsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>* PrepareAsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>* AsyncHasTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>* PrepareAsyncHasTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>* AsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>* PrepareAsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>* AsyncBuildIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::Status>* PrepareAsyncBuildIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::VectorIds>* AsyncInsertVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::VectorIds>* PrepareAsyncInsertVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientReaderInterface< ::milvus::grpc::TopKQueryResult>* SearchVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request) = 0; + virtual ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>* AsyncSearchVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request, ::grpc::CompletionQueue* cq, void* tag) = 0; + virtual ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>* PrepareAsyncSearchVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientReaderInterface< ::milvus::grpc::TopKQueryResult>* SearchVectorInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request) = 0; + virtual ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>* AsyncSearchVectorInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request, ::grpc::CompletionQueue* cq, void* tag) = 0; + virtual ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TopKQueryResult>* PrepareAsyncSearchVectorInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableSchema>* AsyncDescribeTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableSchema>* PrepareAsyncDescribeTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableRowCount>* AsyncGetTableRowCountRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::TableRowCount>* PrepareAsyncGetTableRowCountRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientReaderInterface< ::milvus::grpc::TableName>* ShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request) = 0; + virtual ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TableName>* AsyncShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq, void* tag) = 0; + virtual ::grpc::ClientAsyncReaderInterface< ::milvus::grpc::TableName>* PrepareAsyncShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::ServerStatus>* AsyncPingRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::ServerStatus>* PrepareAsyncPingRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) = 0; + }; + class Stub final : public StubInterface { + public: + Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); + ::grpc::Status CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::milvus::Status* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>> AsyncCreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>>(AsyncCreateTableRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>> PrepareAsyncCreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>>(PrepareAsyncCreateTableRaw(context, request, cq)); + } + ::grpc::Status HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::BoolReply* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>> AsyncHasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>>(AsyncHasTableRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>> PrepareAsyncHasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>>(PrepareAsyncHasTableRaw(context, request, cq)); + } + ::grpc::Status DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::Status* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>> AsyncDropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>>(AsyncDropTableRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>> PrepareAsyncDropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>>(PrepareAsyncDropTableRaw(context, request, cq)); + } + ::grpc::Status BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::Status* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>> AsyncBuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>>(AsyncBuildIndexRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>> PrepareAsyncBuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::Status>>(PrepareAsyncBuildIndexRaw(context, request, cq)); + } + ::grpc::Status InsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::milvus::grpc::VectorIds* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>> AsyncInsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>>(AsyncInsertVectorRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>> PrepareAsyncInsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>>(PrepareAsyncInsertVectorRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientReader< ::milvus::grpc::TopKQueryResult>> SearchVector(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request) { + return std::unique_ptr< ::grpc::ClientReader< ::milvus::grpc::TopKQueryResult>>(SearchVectorRaw(context, request)); + } + std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>> AsyncSearchVector(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>>(AsyncSearchVectorRaw(context, request, cq, tag)); + } + std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>> PrepareAsyncSearchVector(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>>(PrepareAsyncSearchVectorRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientReader< ::milvus::grpc::TopKQueryResult>> SearchVectorInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request) { + return std::unique_ptr< ::grpc::ClientReader< ::milvus::grpc::TopKQueryResult>>(SearchVectorInFilesRaw(context, request)); + } + std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>> AsyncSearchVectorInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>>(AsyncSearchVectorInFilesRaw(context, request, cq, tag)); + } + std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>> PrepareAsyncSearchVectorInFiles(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>>(PrepareAsyncSearchVectorInFilesRaw(context, request, cq)); + } + ::grpc::Status DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableSchema* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>> AsyncDescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>>(AsyncDescribeTableRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>> PrepareAsyncDescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>>(PrepareAsyncDescribeTableRaw(context, request, cq)); + } + ::grpc::Status GetTableRowCount(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableRowCount* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>> AsyncGetTableRowCount(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>>(AsyncGetTableRowCountRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>> PrepareAsyncGetTableRowCount(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>>(PrepareAsyncGetTableRowCountRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientReader< ::milvus::grpc::TableName>> ShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command& request) { + return std::unique_ptr< ::grpc::ClientReader< ::milvus::grpc::TableName>>(ShowTablesRaw(context, request)); + } + std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TableName>> AsyncShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TableName>>(AsyncShowTablesRaw(context, request, cq, tag)); + } + std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TableName>> PrepareAsyncShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReader< ::milvus::grpc::TableName>>(PrepareAsyncShowTablesRaw(context, request, cq)); + } + ::grpc::Status Ping(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::ServerStatus* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::ServerStatus>> AsyncPing(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::ServerStatus>>(AsyncPingRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::ServerStatus>> PrepareAsyncPing(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::ServerStatus>>(PrepareAsyncPingRaw(context, request, cq)); + } + class experimental_async final : + public StubInterface::experimental_async_interface { + public: + void CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response, std::function) override; + void CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function) override; + void HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response, std::function) override; + void HasTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function) override; + void DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response, std::function) override; + void DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function) override; + void BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response, std::function) override; + void BuildIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function) override; + void InsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response, std::function) override; + void InsertVector(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::VectorIds* response, std::function) override; + void SearchVector(::grpc::ClientContext* context, ::milvus::grpc::SearchVectorInfos* request, ::grpc::experimental::ClientReadReactor< ::milvus::grpc::TopKQueryResult>* reactor) override; + void SearchVectorInFiles(::grpc::ClientContext* context, ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::experimental::ClientReadReactor< ::milvus::grpc::TopKQueryResult>* reactor) override; + void DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response, std::function) override; + void DescribeTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableSchema* response, std::function) override; + void GetTableRowCount(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response, std::function) override; + void GetTableRowCount(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableRowCount* response, std::function) override; + void ShowTables(::grpc::ClientContext* context, ::milvus::grpc::Command* request, ::grpc::experimental::ClientReadReactor< ::milvus::grpc::TableName>* reactor) override; + void Ping(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response, std::function) override; + void Ping(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::ServerStatus* response, std::function) override; + private: + friend class Stub; + explicit experimental_async(Stub* stub): stub_(stub) { } + Stub* stub() { return stub_; } + Stub* stub_; + }; + class experimental_async_interface* experimental_async() override { return &async_stub_; } + + private: + std::shared_ptr< ::grpc::ChannelInterface> channel_; + class experimental_async async_stub_{this}; + ::grpc::ClientAsyncResponseReader< ::milvus::Status>* AsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::Status>* PrepareAsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* AsyncHasTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* PrepareAsyncHasTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::Status>* AsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::Status>* PrepareAsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::Status>* AsyncBuildIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::Status>* PrepareAsyncBuildIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>* AsyncInsertVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::VectorIds>* PrepareAsyncInsertVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientReader< ::milvus::grpc::TopKQueryResult>* SearchVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request) override; + ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>* AsyncSearchVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request, ::grpc::CompletionQueue* cq, void* tag) override; + ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>* PrepareAsyncSearchVectorRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInfos& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientReader< ::milvus::grpc::TopKQueryResult>* SearchVectorInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request) override; + ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>* AsyncSearchVectorInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request, ::grpc::CompletionQueue* cq, void* tag) override; + ::grpc::ClientAsyncReader< ::milvus::grpc::TopKQueryResult>* PrepareAsyncSearchVectorInFilesRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchVectorInFilesInfos& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>* AsyncDescribeTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>* PrepareAsyncDescribeTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>* AsyncGetTableRowCountRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>* PrepareAsyncGetTableRowCountRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientReader< ::milvus::grpc::TableName>* ShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request) override; + ::grpc::ClientAsyncReader< ::milvus::grpc::TableName>* AsyncShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq, void* tag) override; + ::grpc::ClientAsyncReader< ::milvus::grpc::TableName>* PrepareAsyncShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::ServerStatus>* AsyncPingRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::ServerStatus>* PrepareAsyncPingRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) override; + const ::grpc::internal::RpcMethod rpcmethod_CreateTable_; + const ::grpc::internal::RpcMethod rpcmethod_HasTable_; + const ::grpc::internal::RpcMethod rpcmethod_DropTable_; + const ::grpc::internal::RpcMethod rpcmethod_BuildIndex_; + const ::grpc::internal::RpcMethod rpcmethod_InsertVector_; + const ::grpc::internal::RpcMethod rpcmethod_SearchVector_; + const ::grpc::internal::RpcMethod rpcmethod_SearchVectorInFiles_; + const ::grpc::internal::RpcMethod rpcmethod_DescribeTable_; + const ::grpc::internal::RpcMethod rpcmethod_GetTableRowCount_; + const ::grpc::internal::RpcMethod rpcmethod_ShowTables_; + const ::grpc::internal::RpcMethod rpcmethod_Ping_; + }; + static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + + class Service : public ::grpc::Service { + public: + Service(); + virtual ~Service(); + // * + // @brief Create table method + // + // This method is used to create table + // + // @param param, use to provide table information to be created. + // + virtual ::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response); + // * + // @brief Test table existence method + // + // This method is used to test table existence. + // + // @param table_name, table name is going to be tested. + // + virtual ::grpc::Status HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response); + // * + // @brief Delete table method + // + // This method is used to delete table. + // + // @param table_name, table name is going to be deleted. + // + virtual ::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response); + // * + // @brief Build index by table method + // + // This method is used to build index by table in sync mode. + // + // @param table_name, table is going to be built index. + // + virtual ::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response); + // * + // @brief Add vector array to table + // + // This method is used to add vector array to table. + // + // @param table_name, table_name is inserted. + // @param record_array, vector array is inserted. + // + // @return vector id array + virtual ::grpc::Status InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response); + // * + // @brief Query vector + // + // This method is used to query vector in table. + // + // @param table_name, table_name is queried. + // @param query_record_array, all vector are going to be queried. + // @param query_range_array, optional ranges for conditional search. If not specified, search whole table + // @param topk, how many similarity vectors will be searched. + // + // @return query result array. + virtual ::grpc::Status SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer); + // * + // @brief Internal use query interface + // + // This method is used to query vector in specified files. + // + // @param file_id_array, specified files id array, queried. + // @param query_record_array, all vector are going to be queried. + // @param query_range_array, optional ranges for conditional search. If not specified, search whole table + // @param topk, how many similarity vectors will be searched. + // + // @return query result array. + virtual ::grpc::Status SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer); + // * + // @brief Get table schema + // + // This method is used to get table schema. + // + // @param table_name, target table name. + // + // @return table schema + virtual ::grpc::Status DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response); + // * + // @brief Get table schema + // + // This method is used to get table schema. + // + // @param table_name, target table name. + // + // @return table schema + virtual ::grpc::Status GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response); + // * + // @brief List all tables in database + // + // This method is used to list all tables. + // + // + // @return table names. + virtual ::grpc::Status ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer); + // * + // @brief Give the server status + // + // This method is used to give the server status. + // + // @return Server status. + virtual ::grpc::Status Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response); + }; + template + class WithAsyncMethod_CreateTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_CreateTable() { + ::grpc::Service::MarkMethodAsync(0); + } + ~WithAsyncMethod_CreateTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestCreateTable(::grpc::ServerContext* context, ::milvus::grpc::TableSchema* request, ::grpc::ServerAsyncResponseWriter< ::milvus::Status>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_HasTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_HasTable() { + ::grpc::Service::MarkMethodAsync(1); + } + ~WithAsyncMethod_HasTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestHasTable(::grpc::ServerContext* context, ::milvus::grpc::TableName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::BoolReply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_DropTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_DropTable() { + ::grpc::Service::MarkMethodAsync(2); + } + ~WithAsyncMethod_DropTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestDropTable(::grpc::ServerContext* context, ::milvus::grpc::TableName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::Status>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_BuildIndex : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_BuildIndex() { + ::grpc::Service::MarkMethodAsync(3); + } + ~WithAsyncMethod_BuildIndex() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestBuildIndex(::grpc::ServerContext* context, ::milvus::grpc::TableName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::Status>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_InsertVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_InsertVector() { + ::grpc::Service::MarkMethodAsync(4); + } + ~WithAsyncMethod_InsertVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestInsertVector(::grpc::ServerContext* context, ::milvus::grpc::InsertInfos* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::VectorIds>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_SearchVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_SearchVector() { + ::grpc::Service::MarkMethodAsync(5); + } + ~WithAsyncMethod_SearchVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestSearchVector(::grpc::ServerContext* context, ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerAsyncWriter< ::milvus::grpc::TopKQueryResult>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncServerStreaming(5, context, request, writer, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_SearchVectorInFiles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_SearchVectorInFiles() { + ::grpc::Service::MarkMethodAsync(6); + } + ~WithAsyncMethod_SearchVectorInFiles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestSearchVectorInFiles(::grpc::ServerContext* context, ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerAsyncWriter< ::milvus::grpc::TopKQueryResult>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncServerStreaming(6, context, request, writer, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_DescribeTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_DescribeTable() { + ::grpc::Service::MarkMethodAsync(7); + } + ~WithAsyncMethod_DescribeTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestDescribeTable(::grpc::ServerContext* context, ::milvus::grpc::TableName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::TableSchema>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(7, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_GetTableRowCount : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_GetTableRowCount() { + ::grpc::Service::MarkMethodAsync(8); + } + ~WithAsyncMethod_GetTableRowCount() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetTableRowCount(::grpc::ServerContext* context, ::milvus::grpc::TableName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::TableRowCount>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(8, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_ShowTables : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_ShowTables() { + ::grpc::Service::MarkMethodAsync(9); + } + ~WithAsyncMethod_ShowTables() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestShowTables(::grpc::ServerContext* context, ::milvus::grpc::Command* request, ::grpc::ServerAsyncWriter< ::milvus::grpc::TableName>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncServerStreaming(9, context, request, writer, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_Ping() { + ::grpc::Service::MarkMethodAsync(10); + } + ~WithAsyncMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestPing(::grpc::ServerContext* context, ::milvus::grpc::Command* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::ServerStatus>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_CreateTable > > > > > > > > > > AsyncService; + template + class ExperimentalWithCallbackMethod_CreateTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_CreateTable() { + ::grpc::Service::experimental().MarkMethodCallback(0, + new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableSchema, ::milvus::Status>( + [this](::grpc::ServerContext* context, + const ::milvus::grpc::TableSchema* request, + ::milvus::Status* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->CreateTable(context, request, response, controller); + })); + } + ~ExperimentalWithCallbackMethod_CreateTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithCallbackMethod_HasTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_HasTable() { + ::grpc::Service::experimental().MarkMethodCallback(1, + new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableName, ::milvus::grpc::BoolReply>( + [this](::grpc::ServerContext* context, + const ::milvus::grpc::TableName* request, + ::milvus::grpc::BoolReply* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->HasTable(context, request, response, controller); + })); + } + ~ExperimentalWithCallbackMethod_HasTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithCallbackMethod_DropTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_DropTable() { + ::grpc::Service::experimental().MarkMethodCallback(2, + new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableName, ::milvus::Status>( + [this](::grpc::ServerContext* context, + const ::milvus::grpc::TableName* request, + ::milvus::Status* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->DropTable(context, request, response, controller); + })); + } + ~ExperimentalWithCallbackMethod_DropTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithCallbackMethod_BuildIndex : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_BuildIndex() { + ::grpc::Service::experimental().MarkMethodCallback(3, + new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableName, ::milvus::Status>( + [this](::grpc::ServerContext* context, + const ::milvus::grpc::TableName* request, + ::milvus::Status* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->BuildIndex(context, request, response, controller); + })); + } + ~ExperimentalWithCallbackMethod_BuildIndex() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithCallbackMethod_InsertVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_InsertVector() { + ::grpc::Service::experimental().MarkMethodCallback(4, + new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::InsertInfos, ::milvus::grpc::VectorIds>( + [this](::grpc::ServerContext* context, + const ::milvus::grpc::InsertInfos* request, + ::milvus::grpc::VectorIds* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->InsertVector(context, request, response, controller); + })); + } + ~ExperimentalWithCallbackMethod_InsertVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithCallbackMethod_SearchVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_SearchVector() { + ::grpc::Service::experimental().MarkMethodCallback(5, + new ::grpc::internal::CallbackServerStreamingHandler< ::milvus::grpc::SearchVectorInfos, ::milvus::grpc::TopKQueryResult>( + [this] { return this->SearchVector(); })); + } + ~ExperimentalWithCallbackMethod_SearchVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::experimental::ServerWriteReactor< ::milvus::grpc::SearchVectorInfos, ::milvus::grpc::TopKQueryResult>* SearchVector() { + return new ::grpc::internal::UnimplementedWriteReactor< + ::milvus::grpc::SearchVectorInfos, ::milvus::grpc::TopKQueryResult>;} + }; + template + class ExperimentalWithCallbackMethod_SearchVectorInFiles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_SearchVectorInFiles() { + ::grpc::Service::experimental().MarkMethodCallback(6, + new ::grpc::internal::CallbackServerStreamingHandler< ::milvus::grpc::SearchVectorInFilesInfos, ::milvus::grpc::TopKQueryResult>( + [this] { return this->SearchVectorInFiles(); })); + } + ~ExperimentalWithCallbackMethod_SearchVectorInFiles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::experimental::ServerWriteReactor< ::milvus::grpc::SearchVectorInFilesInfos, ::milvus::grpc::TopKQueryResult>* SearchVectorInFiles() { + return new ::grpc::internal::UnimplementedWriteReactor< + ::milvus::grpc::SearchVectorInFilesInfos, ::milvus::grpc::TopKQueryResult>;} + }; + template + class ExperimentalWithCallbackMethod_DescribeTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_DescribeTable() { + ::grpc::Service::experimental().MarkMethodCallback(7, + new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableName, ::milvus::grpc::TableSchema>( + [this](::grpc::ServerContext* context, + const ::milvus::grpc::TableName* request, + ::milvus::grpc::TableSchema* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->DescribeTable(context, request, response, controller); + })); + } + ~ExperimentalWithCallbackMethod_DescribeTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithCallbackMethod_GetTableRowCount : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_GetTableRowCount() { + ::grpc::Service::experimental().MarkMethodCallback(8, + new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableName, ::milvus::grpc::TableRowCount>( + [this](::grpc::ServerContext* context, + const ::milvus::grpc::TableName* request, + ::milvus::grpc::TableRowCount* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->GetTableRowCount(context, request, response, controller); + })); + } + ~ExperimentalWithCallbackMethod_GetTableRowCount() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithCallbackMethod_ShowTables : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_ShowTables() { + ::grpc::Service::experimental().MarkMethodCallback(9, + new ::grpc::internal::CallbackServerStreamingHandler< ::milvus::grpc::Command, ::milvus::grpc::TableName>( + [this] { return this->ShowTables(); })); + } + ~ExperimentalWithCallbackMethod_ShowTables() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::experimental::ServerWriteReactor< ::milvus::grpc::Command, ::milvus::grpc::TableName>* ShowTables() { + return new ::grpc::internal::UnimplementedWriteReactor< + ::milvus::grpc::Command, ::milvus::grpc::TableName>;} + }; + template + class ExperimentalWithCallbackMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithCallbackMethod_Ping() { + ::grpc::Service::experimental().MarkMethodCallback(10, + new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::Command, ::milvus::grpc::ServerStatus>( + [this](::grpc::ServerContext* context, + const ::milvus::grpc::Command* request, + ::milvus::grpc::ServerStatus* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->Ping(context, request, response, controller); + })); + } + ~ExperimentalWithCallbackMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + typedef ExperimentalWithCallbackMethod_CreateTable > > > > > > > > > > ExperimentalCallbackService; + template + class WithGenericMethod_CreateTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_CreateTable() { + ::grpc::Service::MarkMethodGeneric(0); + } + ~WithGenericMethod_CreateTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_HasTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_HasTable() { + ::grpc::Service::MarkMethodGeneric(1); + } + ~WithGenericMethod_HasTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_DropTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_DropTable() { + ::grpc::Service::MarkMethodGeneric(2); + } + ~WithGenericMethod_DropTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_BuildIndex : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_BuildIndex() { + ::grpc::Service::MarkMethodGeneric(3); + } + ~WithGenericMethod_BuildIndex() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_InsertVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_InsertVector() { + ::grpc::Service::MarkMethodGeneric(4); + } + ~WithGenericMethod_InsertVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_SearchVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_SearchVector() { + ::grpc::Service::MarkMethodGeneric(5); + } + ~WithGenericMethod_SearchVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_SearchVectorInFiles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_SearchVectorInFiles() { + ::grpc::Service::MarkMethodGeneric(6); + } + ~WithGenericMethod_SearchVectorInFiles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_DescribeTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_DescribeTable() { + ::grpc::Service::MarkMethodGeneric(7); + } + ~WithGenericMethod_DescribeTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_GetTableRowCount : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_GetTableRowCount() { + ::grpc::Service::MarkMethodGeneric(8); + } + ~WithGenericMethod_GetTableRowCount() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_ShowTables : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_ShowTables() { + ::grpc::Service::MarkMethodGeneric(9); + } + ~WithGenericMethod_ShowTables() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_Ping() { + ::grpc::Service::MarkMethodGeneric(10); + } + ~WithGenericMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithRawMethod_CreateTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_CreateTable() { + ::grpc::Service::MarkMethodRaw(0); + } + ~WithRawMethod_CreateTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestCreateTable(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_HasTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_HasTable() { + ::grpc::Service::MarkMethodRaw(1); + } + ~WithRawMethod_HasTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestHasTable(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_DropTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_DropTable() { + ::grpc::Service::MarkMethodRaw(2); + } + ~WithRawMethod_DropTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestDropTable(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_BuildIndex : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_BuildIndex() { + ::grpc::Service::MarkMethodRaw(3); + } + ~WithRawMethod_BuildIndex() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestBuildIndex(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_InsertVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_InsertVector() { + ::grpc::Service::MarkMethodRaw(4); + } + ~WithRawMethod_InsertVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestInsertVector(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_SearchVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_SearchVector() { + ::grpc::Service::MarkMethodRaw(5); + } + ~WithRawMethod_SearchVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestSearchVector(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncServerStreaming(5, context, request, writer, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_SearchVectorInFiles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_SearchVectorInFiles() { + ::grpc::Service::MarkMethodRaw(6); + } + ~WithRawMethod_SearchVectorInFiles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestSearchVectorInFiles(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncServerStreaming(6, context, request, writer, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_DescribeTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_DescribeTable() { + ::grpc::Service::MarkMethodRaw(7); + } + ~WithRawMethod_DescribeTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestDescribeTable(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(7, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_GetTableRowCount : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_GetTableRowCount() { + ::grpc::Service::MarkMethodRaw(8); + } + ~WithRawMethod_GetTableRowCount() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetTableRowCount(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(8, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_ShowTables : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_ShowTables() { + ::grpc::Service::MarkMethodRaw(9); + } + ~WithRawMethod_ShowTables() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestShowTables(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncServerStreaming(9, context, request, writer, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithRawMethod_Ping() { + ::grpc::Service::MarkMethodRaw(10); + } + ~WithRawMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestPing(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class ExperimentalWithRawCallbackMethod_CreateTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_CreateTable() { + ::grpc::Service::experimental().MarkMethodRawCallback(0, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->CreateTable(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_CreateTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void CreateTable(::grpc::ServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithRawCallbackMethod_HasTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_HasTable() { + ::grpc::Service::experimental().MarkMethodRawCallback(1, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->HasTable(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_HasTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void HasTable(::grpc::ServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithRawCallbackMethod_DropTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_DropTable() { + ::grpc::Service::experimental().MarkMethodRawCallback(2, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->DropTable(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_DropTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void DropTable(::grpc::ServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithRawCallbackMethod_BuildIndex : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_BuildIndex() { + ::grpc::Service::experimental().MarkMethodRawCallback(3, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->BuildIndex(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_BuildIndex() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void BuildIndex(::grpc::ServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithRawCallbackMethod_InsertVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_InsertVector() { + ::grpc::Service::experimental().MarkMethodRawCallback(4, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->InsertVector(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_InsertVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void InsertVector(::grpc::ServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithRawCallbackMethod_SearchVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_SearchVector() { + ::grpc::Service::experimental().MarkMethodRawCallback(5, + new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this] { return this->SearchVector(); })); + } + ~ExperimentalWithRawCallbackMethod_SearchVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* SearchVector() { + return new ::grpc::internal::UnimplementedWriteReactor< + ::grpc::ByteBuffer, ::grpc::ByteBuffer>;} + }; + template + class ExperimentalWithRawCallbackMethod_SearchVectorInFiles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_SearchVectorInFiles() { + ::grpc::Service::experimental().MarkMethodRawCallback(6, + new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this] { return this->SearchVectorInFiles(); })); + } + ~ExperimentalWithRawCallbackMethod_SearchVectorInFiles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* SearchVectorInFiles() { + return new ::grpc::internal::UnimplementedWriteReactor< + ::grpc::ByteBuffer, ::grpc::ByteBuffer>;} + }; + template + class ExperimentalWithRawCallbackMethod_DescribeTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_DescribeTable() { + ::grpc::Service::experimental().MarkMethodRawCallback(7, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->DescribeTable(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_DescribeTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void DescribeTable(::grpc::ServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithRawCallbackMethod_GetTableRowCount : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_GetTableRowCount() { + ::grpc::Service::experimental().MarkMethodRawCallback(8, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->GetTableRowCount(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_GetTableRowCount() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void GetTableRowCount(::grpc::ServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithRawCallbackMethod_ShowTables : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_ShowTables() { + ::grpc::Service::experimental().MarkMethodRawCallback(9, + new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this] { return this->ShowTables(); })); + } + ~ExperimentalWithRawCallbackMethod_ShowTables() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* ShowTables() { + return new ::grpc::internal::UnimplementedWriteReactor< + ::grpc::ByteBuffer, ::grpc::ByteBuffer>;} + }; + template + class ExperimentalWithRawCallbackMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + ExperimentalWithRawCallbackMethod_Ping() { + ::grpc::Service::experimental().MarkMethodRawCallback(10, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->Ping(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void Ping(::grpc::ServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class WithStreamedUnaryMethod_CreateTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithStreamedUnaryMethod_CreateTable() { + ::grpc::Service::MarkMethodStreamed(0, + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableSchema, ::milvus::Status>(std::bind(&WithStreamedUnaryMethod_CreateTable::StreamedCreateTable, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_CreateTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedCreateTable(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::TableSchema,::milvus::Status>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_HasTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithStreamedUnaryMethod_HasTable() { + ::grpc::Service::MarkMethodStreamed(1, + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableName, ::milvus::grpc::BoolReply>(std::bind(&WithStreamedUnaryMethod_HasTable::StreamedHasTable, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_HasTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedHasTable(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::TableName,::milvus::grpc::BoolReply>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_DropTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithStreamedUnaryMethod_DropTable() { + ::grpc::Service::MarkMethodStreamed(2, + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableName, ::milvus::Status>(std::bind(&WithStreamedUnaryMethod_DropTable::StreamedDropTable, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_DropTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedDropTable(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::TableName,::milvus::Status>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_BuildIndex : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithStreamedUnaryMethod_BuildIndex() { + ::grpc::Service::MarkMethodStreamed(3, + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableName, ::milvus::Status>(std::bind(&WithStreamedUnaryMethod_BuildIndex::StreamedBuildIndex, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_BuildIndex() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedBuildIndex(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::TableName,::milvus::Status>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_InsertVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithStreamedUnaryMethod_InsertVector() { + ::grpc::Service::MarkMethodStreamed(4, + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::InsertInfos, ::milvus::grpc::VectorIds>(std::bind(&WithStreamedUnaryMethod_InsertVector::StreamedInsertVector, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_InsertVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedInsertVector(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::InsertInfos,::milvus::grpc::VectorIds>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_DescribeTable : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithStreamedUnaryMethod_DescribeTable() { + ::grpc::Service::MarkMethodStreamed(7, + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableName, ::milvus::grpc::TableSchema>(std::bind(&WithStreamedUnaryMethod_DescribeTable::StreamedDescribeTable, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_DescribeTable() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedDescribeTable(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::TableName,::milvus::grpc::TableSchema>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_GetTableRowCount : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithStreamedUnaryMethod_GetTableRowCount() { + ::grpc::Service::MarkMethodStreamed(8, + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableName, ::milvus::grpc::TableRowCount>(std::bind(&WithStreamedUnaryMethod_GetTableRowCount::StreamedGetTableRowCount, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_GetTableRowCount() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedGetTableRowCount(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::TableName,::milvus::grpc::TableRowCount>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_Ping : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithStreamedUnaryMethod_Ping() { + ::grpc::Service::MarkMethodStreamed(10, + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::Command, ::milvus::grpc::ServerStatus>(std::bind(&WithStreamedUnaryMethod_Ping::StreamedPing, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_Ping() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedPing(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::Command,::milvus::grpc::ServerStatus>* server_unary_streamer) = 0; + }; + typedef WithStreamedUnaryMethod_CreateTable > > > > > > > StreamedUnaryService; + template + class WithSplitStreamingMethod_SearchVector : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithSplitStreamingMethod_SearchVector() { + ::grpc::Service::MarkMethodStreamed(5, + new ::grpc::internal::SplitServerStreamingHandler< ::milvus::grpc::SearchVectorInfos, ::milvus::grpc::TopKQueryResult>(std::bind(&WithSplitStreamingMethod_SearchVector::StreamedSearchVector, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithSplitStreamingMethod_SearchVector() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with split streamed + virtual ::grpc::Status StreamedSearchVector(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::milvus::grpc::SearchVectorInfos,::milvus::grpc::TopKQueryResult>* server_split_streamer) = 0; + }; + template + class WithSplitStreamingMethod_SearchVectorInFiles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithSplitStreamingMethod_SearchVectorInFiles() { + ::grpc::Service::MarkMethodStreamed(6, + new ::grpc::internal::SplitServerStreamingHandler< ::milvus::grpc::SearchVectorInFilesInfos, ::milvus::grpc::TopKQueryResult>(std::bind(&WithSplitStreamingMethod_SearchVectorInFiles::StreamedSearchVectorInFiles, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithSplitStreamingMethod_SearchVectorInFiles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter< ::milvus::grpc::TopKQueryResult>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with split streamed + virtual ::grpc::Status StreamedSearchVectorInFiles(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::milvus::grpc::SearchVectorInFilesInfos,::milvus::grpc::TopKQueryResult>* server_split_streamer) = 0; + }; + template + class WithSplitStreamingMethod_ShowTables : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithSplitStreamingMethod_ShowTables() { + ::grpc::Service::MarkMethodStreamed(9, + new ::grpc::internal::SplitServerStreamingHandler< ::milvus::grpc::Command, ::milvus::grpc::TableName>(std::bind(&WithSplitStreamingMethod_ShowTables::StreamedShowTables, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithSplitStreamingMethod_ShowTables() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with split streamed + virtual ::grpc::Status StreamedShowTables(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::milvus::grpc::Command,::milvus::grpc::TableName>* server_split_streamer) = 0; + }; + typedef WithSplitStreamingMethod_SearchVector > > SplitStreamedService; + typedef WithStreamedUnaryMethod_CreateTable > > > > > > > > > > StreamedService; +}; + +} // namespace grpc +} // namespace milvus + + +#endif // GRPC_milvus_2eproto__INCLUDED diff --git a/cpp/src/grpc/gen-milvus/milvus.pb.cc b/cpp/src/grpc/gen-milvus/milvus.pb.cc new file mode 100644 index 0000000000..925105ac60 --- /dev/null +++ b/cpp/src/grpc/gen-milvus/milvus.pb.cc @@ -0,0 +1,5987 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: milvus.proto + +#include "milvus.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_QueryResult_milvus_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Range_milvus_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_RowRecord_milvus_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TableName_milvus_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_SearchVectorInfos_milvus_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_status_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Status_status_2eproto; +namespace milvus { +namespace grpc { +class TableNameDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _TableName_default_instance_; +class TableSchemaDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _TableSchema_default_instance_; +class RangeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _Range_default_instance_; +class RowRecordDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _RowRecord_default_instance_; +class InsertInfosDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _InsertInfos_default_instance_; +class VectorIdsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _VectorIds_default_instance_; +class SearchVectorInfosDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _SearchVectorInfos_default_instance_; +class SearchVectorInFilesInfosDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _SearchVectorInFilesInfos_default_instance_; +class QueryResultDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _QueryResult_default_instance_; +class TopKQueryResultDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _TopKQueryResult_default_instance_; +class StringReplyDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _StringReply_default_instance_; +class BoolReplyDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _BoolReply_default_instance_; +class TableRowCountDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _TableRowCount_default_instance_; +class CommandDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _Command_default_instance_; +class ServerStatusDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _ServerStatus_default_instance_; +} // namespace grpc +} // namespace milvus +static void InitDefaultsTableName_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_TableName_default_instance_; + new (ptr) ::milvus::grpc::TableName(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::TableName::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TableName_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTableName_milvus_2eproto}, { + &scc_info_Status_status_2eproto.base,}}; + +static void InitDefaultsTableSchema_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_TableSchema_default_instance_; + new (ptr) ::milvus::grpc::TableSchema(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::TableSchema::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TableSchema_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTableSchema_milvus_2eproto}, { + &scc_info_TableName_milvus_2eproto.base,}}; + +static void InitDefaultsRange_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_Range_default_instance_; + new (ptr) ::milvus::grpc::Range(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::Range::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Range_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsRange_milvus_2eproto}, {}}; + +static void InitDefaultsRowRecord_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_RowRecord_default_instance_; + new (ptr) ::milvus::grpc::RowRecord(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::RowRecord::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_RowRecord_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsRowRecord_milvus_2eproto}, {}}; + +static void InitDefaultsInsertInfos_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_InsertInfos_default_instance_; + new (ptr) ::milvus::grpc::InsertInfos(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::InsertInfos::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_InsertInfos_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsInsertInfos_milvus_2eproto}, { + &scc_info_RowRecord_milvus_2eproto.base,}}; + +static void InitDefaultsVectorIds_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_VectorIds_default_instance_; + new (ptr) ::milvus::grpc::VectorIds(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::VectorIds::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_VectorIds_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsVectorIds_milvus_2eproto}, { + &scc_info_Status_status_2eproto.base,}}; + +static void InitDefaultsSearchVectorInfos_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_SearchVectorInfos_default_instance_; + new (ptr) ::milvus::grpc::SearchVectorInfos(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::SearchVectorInfos::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_SearchVectorInfos_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsSearchVectorInfos_milvus_2eproto}, { + &scc_info_RowRecord_milvus_2eproto.base, + &scc_info_Range_milvus_2eproto.base,}}; + +static void InitDefaultsSearchVectorInFilesInfos_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_SearchVectorInFilesInfos_default_instance_; + new (ptr) ::milvus::grpc::SearchVectorInFilesInfos(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::SearchVectorInFilesInfos::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SearchVectorInFilesInfos_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSearchVectorInFilesInfos_milvus_2eproto}, { + &scc_info_SearchVectorInfos_milvus_2eproto.base,}}; + +static void InitDefaultsQueryResult_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_QueryResult_default_instance_; + new (ptr) ::milvus::grpc::QueryResult(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::QueryResult::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_QueryResult_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsQueryResult_milvus_2eproto}, {}}; + +static void InitDefaultsTopKQueryResult_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_TopKQueryResult_default_instance_; + new (ptr) ::milvus::grpc::TopKQueryResult(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::TopKQueryResult::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_TopKQueryResult_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTopKQueryResult_milvus_2eproto}, { + &scc_info_Status_status_2eproto.base, + &scc_info_QueryResult_milvus_2eproto.base,}}; + +static void InitDefaultsStringReply_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_StringReply_default_instance_; + new (ptr) ::milvus::grpc::StringReply(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::StringReply::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_StringReply_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsStringReply_milvus_2eproto}, { + &scc_info_Status_status_2eproto.base,}}; + +static void InitDefaultsBoolReply_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_BoolReply_default_instance_; + new (ptr) ::milvus::grpc::BoolReply(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::BoolReply::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_BoolReply_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsBoolReply_milvus_2eproto}, { + &scc_info_Status_status_2eproto.base,}}; + +static void InitDefaultsTableRowCount_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_TableRowCount_default_instance_; + new (ptr) ::milvus::grpc::TableRowCount(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::TableRowCount::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TableRowCount_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTableRowCount_milvus_2eproto}, { + &scc_info_Status_status_2eproto.base,}}; + +static void InitDefaultsCommand_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_Command_default_instance_; + new (ptr) ::milvus::grpc::Command(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::Command::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Command_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCommand_milvus_2eproto}, {}}; + +static void InitDefaultsServerStatus_milvus_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_ServerStatus_default_instance_; + new (ptr) ::milvus::grpc::ServerStatus(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::ServerStatus::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ServerStatus_milvus_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsServerStatus_milvus_2eproto}, { + &scc_info_Status_status_2eproto.base,}}; + +void InitDefaults_milvus_2eproto() { + ::google::protobuf::internal::InitSCC(&scc_info_TableName_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_TableSchema_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_Range_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_RowRecord_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_InsertInfos_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_VectorIds_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_SearchVectorInfos_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_SearchVectorInFilesInfos_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_QueryResult_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_TopKQueryResult_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_StringReply_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_BoolReply_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_TableRowCount_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_Command_milvus_2eproto.base); + ::google::protobuf::internal::InitSCC(&scc_info_ServerStatus_milvus_2eproto.base); +} + +::google::protobuf::Metadata file_level_metadata_milvus_2eproto[15]; +constexpr ::google::protobuf::EnumDescriptor const** file_level_enum_descriptors_milvus_2eproto = nullptr; +constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_milvus_2eproto = nullptr; + +const ::google::protobuf::uint32 TableStruct_milvus_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableName, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableName, status_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableName, table_name_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableSchema, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableSchema, table_name_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableSchema, index_type_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableSchema, dimension_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableSchema, store_raw_vector_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::Range, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::Range, start_value_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::Range, end_value_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::RowRecord, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::RowRecord, vector_data_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertInfos, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertInfos, table_name_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertInfos, row_record_array_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorIds, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorIds, status_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorIds, vector_id_array_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchVectorInfos, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchVectorInfos, table_name_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchVectorInfos, query_record_array_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchVectorInfos, query_range_array_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchVectorInfos, topk_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchVectorInFilesInfos, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchVectorInFilesInfos, file_id_array_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchVectorInFilesInfos, search_vector_infos_), + ~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, status_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TopKQueryResult, query_result_arrays_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::StringReply, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::StringReply, status_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::StringReply, string_reply_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::BoolReply, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::BoolReply, status_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::BoolReply, bool_reply_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableRowCount, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableRowCount, status_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::TableRowCount, table_row_count_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::Command, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::Command, cmd_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::ServerStatus, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::ServerStatus, status_), + PROTOBUF_FIELD_OFFSET(::milvus::grpc::ServerStatus, info_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::milvus::grpc::TableName)}, + { 7, -1, sizeof(::milvus::grpc::TableSchema)}, + { 16, -1, sizeof(::milvus::grpc::Range)}, + { 23, -1, sizeof(::milvus::grpc::RowRecord)}, + { 29, -1, sizeof(::milvus::grpc::InsertInfos)}, + { 36, -1, sizeof(::milvus::grpc::VectorIds)}, + { 43, -1, sizeof(::milvus::grpc::SearchVectorInfos)}, + { 52, -1, sizeof(::milvus::grpc::SearchVectorInFilesInfos)}, + { 59, -1, sizeof(::milvus::grpc::QueryResult)}, + { 66, -1, sizeof(::milvus::grpc::TopKQueryResult)}, + { 73, -1, sizeof(::milvus::grpc::StringReply)}, + { 80, -1, sizeof(::milvus::grpc::BoolReply)}, + { 87, -1, sizeof(::milvus::grpc::TableRowCount)}, + { 94, -1, sizeof(::milvus::grpc::Command)}, + { 100, -1, sizeof(::milvus::grpc::ServerStatus)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::milvus::grpc::_TableName_default_instance_), + reinterpret_cast(&::milvus::grpc::_TableSchema_default_instance_), + reinterpret_cast(&::milvus::grpc::_Range_default_instance_), + reinterpret_cast(&::milvus::grpc::_RowRecord_default_instance_), + reinterpret_cast(&::milvus::grpc::_InsertInfos_default_instance_), + reinterpret_cast(&::milvus::grpc::_VectorIds_default_instance_), + reinterpret_cast(&::milvus::grpc::_SearchVectorInfos_default_instance_), + reinterpret_cast(&::milvus::grpc::_SearchVectorInFilesInfos_default_instance_), + reinterpret_cast(&::milvus::grpc::_QueryResult_default_instance_), + reinterpret_cast(&::milvus::grpc::_TopKQueryResult_default_instance_), + reinterpret_cast(&::milvus::grpc::_StringReply_default_instance_), + reinterpret_cast(&::milvus::grpc::_BoolReply_default_instance_), + reinterpret_cast(&::milvus::grpc::_TableRowCount_default_instance_), + reinterpret_cast(&::milvus::grpc::_Command_default_instance_), + reinterpret_cast(&::milvus::grpc::_ServerStatus_default_instance_), +}; + +::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_milvus_2eproto = { + {}, AddDescriptors_milvus_2eproto, "milvus.proto", schemas, + file_default_instances, TableStruct_milvus_2eproto::offsets, + file_level_metadata_milvus_2eproto, 15, file_level_enum_descriptors_milvus_2eproto, file_level_service_descriptors_milvus_2eproto, +}; + +const char descriptor_table_protodef_milvus_2eproto[] = + "\n\014milvus.proto\022\013milvus.grpc\032\014status.prot" + "o\"\?\n\tTableName\022\036\n\006status\030\001 \001(\0132\016.milvus." + "Status\022\022\n\ntable_name\030\002 \001(\t\"z\n\013TableSchem" + "a\022*\n\ntable_name\030\001 \001(\0132\026.milvus.grpc.Tabl" + "eName\022\022\n\nindex_type\030\002 \001(\005\022\021\n\tdimension\030\003" + " \001(\003\022\030\n\020store_raw_vector\030\004 \001(\010\"/\n\005Range\022" + "\023\n\013start_value\030\001 \001(\t\022\021\n\tend_value\030\002 \001(\t\"" + " \n\tRowRecord\022\023\n\013vector_data\030\001 \003(\002\"S\n\013Ins" + "ertInfos\022\022\n\ntable_name\030\001 \001(\t\0220\n\020row_reco" + "rd_array\030\002 \003(\0132\026.milvus.grpc.RowRecord\"D" + "\n\tVectorIds\022\036\n\006status\030\001 \001(\0132\016.milvus.Sta" + "tus\022\027\n\017vector_id_array\030\002 \003(\003\"\230\001\n\021SearchV" + "ectorInfos\022\022\n\ntable_name\030\001 \001(\t\0222\n\022query_" + "record_array\030\002 \003(\0132\026.milvus.grpc.RowReco" + "rd\022-\n\021query_range_array\030\003 \003(\0132\022.milvus.g" + "rpc.Range\022\014\n\004topk\030\004 \001(\003\"n\n\030SearchVectorI" + "nFilesInfos\022\025\n\rfile_id_array\030\001 \003(\t\022;\n\023se" + "arch_vector_infos\030\002 \001(\0132\036.milvus.grpc.Se" + "archVectorInfos\"+\n\013QueryResult\022\n\n\002id\030\001 \001" + "(\003\022\020\n\010distance\030\002 \001(\001\"h\n\017TopKQueryResult\022" + "\036\n\006status\030\001 \001(\0132\016.milvus.Status\0225\n\023query" + "_result_arrays\030\002 \003(\0132\030.milvus.grpc.Query" + "Result\"C\n\013StringReply\022\036\n\006status\030\001 \001(\0132\016." + "milvus.Status\022\024\n\014string_reply\030\002 \001(\t\"\?\n\tB" + "oolReply\022\036\n\006status\030\001 \001(\0132\016.milvus.Status" + "\022\022\n\nbool_reply\030\002 \001(\010\"H\n\rTableRowCount\022\036\n" + "\006status\030\001 \001(\0132\016.milvus.Status\022\027\n\017table_r" + "ow_count\030\002 \001(\003\"\026\n\007Command\022\013\n\003cmd\030\001 \001(\t\"<" + "\n\014ServerStatus\022\036\n\006status\030\001 \001(\0132\016.milvus." + "Status\022\014\n\004info\030\002 \001(\t2\367\005\n\rMilvusService\0229" + "\n\013CreateTable\022\030.milvus.grpc.TableSchema\032" + "\016.milvus.Status\"\000\022<\n\010HasTable\022\026.milvus.g" + "rpc.TableName\032\026.milvus.grpc.BoolReply\"\000\022" + "5\n\tDropTable\022\026.milvus.grpc.TableName\032\016.m" + "ilvus.Status\"\000\0226\n\nBuildIndex\022\026.milvus.gr" + "pc.TableName\032\016.milvus.Status\"\000\022B\n\014Insert" + "Vector\022\030.milvus.grpc.InsertInfos\032\026.milvu" + "s.grpc.VectorIds\"\000\022P\n\014SearchVector\022\036.mil" + "vus.grpc.SearchVectorInfos\032\034.milvus.grpc" + ".TopKQueryResult\"\0000\001\022^\n\023SearchVectorInFi" + "les\022%.milvus.grpc.SearchVectorInFilesInf" + "os\032\034.milvus.grpc.TopKQueryResult\"\0000\001\022C\n\r" + "DescribeTable\022\026.milvus.grpc.TableName\032\030." + "milvus.grpc.TableSchema\"\000\022H\n\020GetTableRow" + "Count\022\026.milvus.grpc.TableName\032\032.milvus.g" + "rpc.TableRowCount\"\000\022>\n\nShowTables\022\024.milv" + "us.grpc.Command\032\026.milvus.grpc.TableName\"" + "\0000\001\0229\n\004Ping\022\024.milvus.grpc.Command\032\031.milv" + "us.grpc.ServerStatus\"\000b\006proto3" + ; +::google::protobuf::internal::DescriptorTable descriptor_table_milvus_2eproto = { + false, InitDefaults_milvus_2eproto, + descriptor_table_protodef_milvus_2eproto, + "milvus.proto", &assign_descriptors_table_milvus_2eproto, 1950, +}; + +void AddDescriptors_milvus_2eproto() { + static constexpr ::google::protobuf::internal::InitFunc deps[1] = + { + ::AddDescriptors_status_2eproto, + }; + ::google::protobuf::internal::AddDescriptors(&descriptor_table_milvus_2eproto, deps, 1); +} + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_milvus_2eproto = []() { AddDescriptors_milvus_2eproto(); return true; }(); +namespace milvus { +namespace grpc { + +// =================================================================== + +void TableName::InitAsDefaultInstance() { + ::milvus::grpc::_TableName_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>( + ::milvus::Status::internal_default_instance()); +} +class TableName::HasBitSetters { + public: + static const ::milvus::Status& status(const TableName* msg); +}; + +const ::milvus::Status& +TableName::HasBitSetters::status(const TableName* msg) { + return *msg->status_; +} +void TableName::clear_status() { + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TableName::kStatusFieldNumber; +const int TableName::kTableNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TableName::TableName() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.TableName) +} +TableName::TableName(const TableName& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + table_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.table_name().size() > 0) { + table_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.table_name_); + } + if (from.has_status()) { + status_ = new ::milvus::Status(*from.status_); + } else { + status_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.TableName) +} + +void TableName::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_TableName_milvus_2eproto.base); + table_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + status_ = nullptr; +} + +TableName::~TableName() { + // @@protoc_insertion_point(destructor:milvus.grpc.TableName) + SharedDtor(); +} + +void TableName::SharedDtor() { + table_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete status_; +} + +void TableName::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const TableName& TableName::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_TableName_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void TableName::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.TableName) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + table_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* TableName::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .milvus.Status status = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::Status::_InternalParse; + object = msg->mutable_status(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + break; + } + // string table_name = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("milvus.grpc.TableName.table_name"); + object = msg->mutable_table_name(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool TableName::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.TableName) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .milvus.Status status = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_status())); + } else { + goto handle_unusual; + } + break; + } + + // string table_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_table_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->table_name().data(), static_cast(this->table_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "milvus.grpc.TableName.table_name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.TableName) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.TableName) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void TableName::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.TableName) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::status(this), output); + } + + // string table_name = 2; + if (this->table_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->table_name().data(), static_cast(this->table_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.TableName.table_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->table_name(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.TableName) +} + +::google::protobuf::uint8* TableName::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.TableName) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::status(this), target); + } + + // string table_name = 2; + if (this->table_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->table_name().data(), static_cast(this->table_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.TableName.table_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->table_name(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.TableName) + return target; +} + +size_t TableName::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.TableName) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string table_name = 2; + if (this->table_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->table_name()); + } + + // .milvus.Status status = 1; + if (this->has_status()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *status_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TableName::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.TableName) + GOOGLE_DCHECK_NE(&from, this); + const TableName* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.TableName) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.TableName) + MergeFrom(*source); + } +} + +void TableName::MergeFrom(const TableName& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.TableName) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.table_name().size() > 0) { + + table_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.table_name_); + } + if (from.has_status()) { + mutable_status()->::milvus::Status::MergeFrom(from.status()); + } +} + +void TableName::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.TableName) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TableName::CopyFrom(const TableName& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.TableName) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TableName::IsInitialized() const { + return true; +} + +void TableName::Swap(TableName* other) { + if (other == this) return; + InternalSwap(other); +} +void TableName::InternalSwap(TableName* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + table_name_.Swap(&other->table_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(status_, other->status_); +} + +::google::protobuf::Metadata TableName::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void TableSchema::InitAsDefaultInstance() { + ::milvus::grpc::_TableSchema_default_instance_._instance.get_mutable()->table_name_ = const_cast< ::milvus::grpc::TableName*>( + ::milvus::grpc::TableName::internal_default_instance()); +} +class TableSchema::HasBitSetters { + public: + static const ::milvus::grpc::TableName& table_name(const TableSchema* msg); +}; + +const ::milvus::grpc::TableName& +TableSchema::HasBitSetters::table_name(const TableSchema* msg) { + return *msg->table_name_; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TableSchema::kTableNameFieldNumber; +const int TableSchema::kIndexTypeFieldNumber; +const int TableSchema::kDimensionFieldNumber; +const int TableSchema::kStoreRawVectorFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TableSchema::TableSchema() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.TableSchema) +} +TableSchema::TableSchema(const TableSchema& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_table_name()) { + table_name_ = new ::milvus::grpc::TableName(*from.table_name_); + } else { + table_name_ = nullptr; + } + ::memcpy(&dimension_, &from.dimension_, + static_cast(reinterpret_cast(&store_raw_vector_) - + reinterpret_cast(&dimension_)) + sizeof(store_raw_vector_)); + // @@protoc_insertion_point(copy_constructor:milvus.grpc.TableSchema) +} + +void TableSchema::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_TableSchema_milvus_2eproto.base); + ::memset(&table_name_, 0, static_cast( + reinterpret_cast(&store_raw_vector_) - + reinterpret_cast(&table_name_)) + sizeof(store_raw_vector_)); +} + +TableSchema::~TableSchema() { + // @@protoc_insertion_point(destructor:milvus.grpc.TableSchema) + SharedDtor(); +} + +void TableSchema::SharedDtor() { + if (this != internal_default_instance()) delete table_name_; +} + +void TableSchema::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const TableSchema& TableSchema::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_TableSchema_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void TableSchema::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.TableSchema) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == nullptr && table_name_ != nullptr) { + delete table_name_; + } + table_name_ = nullptr; + ::memset(&dimension_, 0, static_cast( + reinterpret_cast(&store_raw_vector_) - + reinterpret_cast(&dimension_)) + sizeof(store_raw_vector_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* TableSchema::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .milvus.grpc.TableName table_name = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::grpc::TableName::_InternalParse; + object = msg->mutable_table_name(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + break; + } + // int32 index_type = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 16) goto handle_unusual; + msg->set_index_type(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // int64 dimension = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 24) goto handle_unusual; + msg->set_dimension(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // bool store_raw_vector = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 32) goto handle_unusual; + msg->set_store_raw_vector(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool TableSchema::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.TableSchema) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .milvus.grpc.TableName table_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_table_name())); + } else { + goto handle_unusual; + } + break; + } + + // int32 index_type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (16 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &index_type_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 dimension = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (24 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &dimension_))); + } else { + goto handle_unusual; + } + break; + } + + // bool store_raw_vector = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (32 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &store_raw_vector_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.TableSchema) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.TableSchema) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void TableSchema::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.TableSchema) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.grpc.TableName table_name = 1; + if (this->has_table_name()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::table_name(this), output); + } + + // int32 index_type = 2; + if (this->index_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->index_type(), output); + } + + // int64 dimension = 3; + if (this->dimension() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->dimension(), output); + } + + // bool store_raw_vector = 4; + if (this->store_raw_vector() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->store_raw_vector(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.TableSchema) +} + +::google::protobuf::uint8* TableSchema::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.TableSchema) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.grpc.TableName table_name = 1; + if (this->has_table_name()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::table_name(this), target); + } + + // int32 index_type = 2; + if (this->index_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->index_type(), target); + } + + // int64 dimension = 3; + if (this->dimension() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->dimension(), target); + } + + // bool store_raw_vector = 4; + if (this->store_raw_vector() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->store_raw_vector(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.TableSchema) + return target; +} + +size_t TableSchema::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.TableSchema) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .milvus.grpc.TableName table_name = 1; + if (this->has_table_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *table_name_); + } + + // int64 dimension = 3; + if (this->dimension() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->dimension()); + } + + // int32 index_type = 2; + if (this->index_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->index_type()); + } + + // bool store_raw_vector = 4; + if (this->store_raw_vector() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TableSchema::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.TableSchema) + GOOGLE_DCHECK_NE(&from, this); + const TableSchema* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.TableSchema) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.TableSchema) + MergeFrom(*source); + } +} + +void TableSchema::MergeFrom(const TableSchema& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.TableSchema) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_table_name()) { + mutable_table_name()->::milvus::grpc::TableName::MergeFrom(from.table_name()); + } + if (from.dimension() != 0) { + set_dimension(from.dimension()); + } + if (from.index_type() != 0) { + set_index_type(from.index_type()); + } + if (from.store_raw_vector() != 0) { + set_store_raw_vector(from.store_raw_vector()); + } +} + +void TableSchema::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.TableSchema) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TableSchema::CopyFrom(const TableSchema& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.TableSchema) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TableSchema::IsInitialized() const { + return true; +} + +void TableSchema::Swap(TableSchema* other) { + if (other == this) return; + InternalSwap(other); +} +void TableSchema::InternalSwap(TableSchema* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(table_name_, other->table_name_); + swap(dimension_, other->dimension_); + swap(index_type_, other->index_type_); + swap(store_raw_vector_, other->store_raw_vector_); +} + +::google::protobuf::Metadata TableSchema::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void Range::InitAsDefaultInstance() { +} +class Range::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Range::kStartValueFieldNumber; +const int Range::kEndValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Range::Range() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.Range) +} +Range::Range(const Range& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + start_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.start_value().size() > 0) { + start_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.start_value_); + } + end_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.end_value().size() > 0) { + end_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.end_value_); + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.Range) +} + +void Range::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_Range_milvus_2eproto.base); + start_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + end_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +Range::~Range() { + // @@protoc_insertion_point(destructor:milvus.grpc.Range) + SharedDtor(); +} + +void Range::SharedDtor() { + start_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + end_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Range::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Range& Range::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_Range_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void Range::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.Range) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + start_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + end_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Range::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // string start_value = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("milvus.grpc.Range.start_value"); + object = msg->mutable_start_value(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + // string end_value = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("milvus.grpc.Range.end_value"); + object = msg->mutable_end_value(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool Range::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.Range) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string start_value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_start_value())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->start_value().data(), static_cast(this->start_value().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "milvus.grpc.Range.start_value")); + } else { + goto handle_unusual; + } + break; + } + + // string end_value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_end_value())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->end_value().data(), static_cast(this->end_value().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "milvus.grpc.Range.end_value")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.Range) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.Range) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Range::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.Range) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string start_value = 1; + if (this->start_value().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->start_value().data(), static_cast(this->start_value().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.Range.start_value"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->start_value(), output); + } + + // string end_value = 2; + if (this->end_value().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->end_value().data(), static_cast(this->end_value().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.Range.end_value"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->end_value(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.Range) +} + +::google::protobuf::uint8* Range::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.Range) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string start_value = 1; + if (this->start_value().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->start_value().data(), static_cast(this->start_value().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.Range.start_value"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->start_value(), target); + } + + // string end_value = 2; + if (this->end_value().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->end_value().data(), static_cast(this->end_value().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.Range.end_value"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->end_value(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.Range) + return target; +} + +size_t Range::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.Range) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string start_value = 1; + if (this->start_value().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->start_value()); + } + + // string end_value = 2; + if (this->end_value().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->end_value()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Range::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.Range) + GOOGLE_DCHECK_NE(&from, this); + const Range* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.Range) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.Range) + MergeFrom(*source); + } +} + +void Range::MergeFrom(const Range& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.Range) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.start_value().size() > 0) { + + start_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.start_value_); + } + if (from.end_value().size() > 0) { + + end_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.end_value_); + } +} + +void Range::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.Range) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Range::CopyFrom(const Range& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.Range) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Range::IsInitialized() const { + return true; +} + +void Range::Swap(Range* other) { + if (other == this) return; + InternalSwap(other); +} +void Range::InternalSwap(Range* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + start_value_.Swap(&other->start_value_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + end_value_.Swap(&other->end_value_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} + +::google::protobuf::Metadata Range::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void RowRecord::InitAsDefaultInstance() { +} +class RowRecord::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int RowRecord::kVectorDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +RowRecord::RowRecord() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.RowRecord) +} +RowRecord::RowRecord(const RowRecord& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr), + vector_data_(from.vector_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:milvus.grpc.RowRecord) +} + +void RowRecord::SharedCtor() { +} + +RowRecord::~RowRecord() { + // @@protoc_insertion_point(destructor:milvus.grpc.RowRecord) + SharedDtor(); +} + +void RowRecord::SharedDtor() { +} + +void RowRecord::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const RowRecord& RowRecord::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_RowRecord_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void RowRecord::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.RowRecord) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + vector_data_.Clear(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* RowRecord::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // repeated float vector_data = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == 10) { + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::google::protobuf::internal::PackedFloatParser; + object = msg->mutable_vector_data(); + if (size > end - ptr) goto len_delim_till_end; + auto newend = ptr + size; + if (size) ptr = parser_till_end(ptr, newend, object, ctx); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr == newend); + break; + } else if (static_cast<::google::protobuf::uint8>(tag) != 13) goto handle_unusual; + do { + msg->add_vector_data(::google::protobuf::io::UnalignedLoad(ptr)); + ptr += sizeof(float); + if (ptr >= end) break; + } while ((::google::protobuf::io::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 13 && (ptr += 1)); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool RowRecord::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.RowRecord) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated float vector_data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_vector_data()))); + } else if (static_cast< ::google::protobuf::uint8>(tag) == (13 & 0xFF)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 10u, input, this->mutable_vector_data()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.RowRecord) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.RowRecord) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void RowRecord::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.RowRecord) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float vector_data = 1; + if (this->vector_data_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_vector_data_cached_byte_size_.load( + std::memory_order_relaxed)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->vector_data().data(), this->vector_data_size(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.RowRecord) +} + +::google::protobuf::uint8* RowRecord::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.RowRecord) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float vector_data = 1; + if (this->vector_data_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _vector_data_cached_byte_size_.load(std::memory_order_relaxed), + target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->vector_data_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.RowRecord) + return target; +} + +size_t RowRecord::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.RowRecord) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated float vector_data = 1; + { + unsigned int count = static_cast(this->vector_data_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast<::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + _vector_data_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void RowRecord::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.RowRecord) + GOOGLE_DCHECK_NE(&from, this); + const RowRecord* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.RowRecord) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.RowRecord) + MergeFrom(*source); + } +} + +void RowRecord::MergeFrom(const RowRecord& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.RowRecord) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + vector_data_.MergeFrom(from.vector_data_); +} + +void RowRecord::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.RowRecord) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void RowRecord::CopyFrom(const RowRecord& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.RowRecord) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool RowRecord::IsInitialized() const { + return true; +} + +void RowRecord::Swap(RowRecord* other) { + if (other == this) return; + InternalSwap(other); +} +void RowRecord::InternalSwap(RowRecord* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + vector_data_.InternalSwap(&other->vector_data_); +} + +::google::protobuf::Metadata RowRecord::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void InsertInfos::InitAsDefaultInstance() { +} +class InsertInfos::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int InsertInfos::kTableNameFieldNumber; +const int InsertInfos::kRowRecordArrayFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +InsertInfos::InsertInfos() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.InsertInfos) +} +InsertInfos::InsertInfos(const InsertInfos& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr), + row_record_array_(from.row_record_array_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + table_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.table_name().size() > 0) { + table_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.table_name_); + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.InsertInfos) +} + +void InsertInfos::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_InsertInfos_milvus_2eproto.base); + table_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +InsertInfos::~InsertInfos() { + // @@protoc_insertion_point(destructor:milvus.grpc.InsertInfos) + SharedDtor(); +} + +void InsertInfos::SharedDtor() { + table_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void InsertInfos::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const InsertInfos& InsertInfos::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_InsertInfos_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void InsertInfos::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.InsertInfos) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + row_record_array_.Clear(); + table_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* InsertInfos::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // string table_name = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("milvus.grpc.InsertInfos.table_name"); + object = msg->mutable_table_name(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + // repeated .milvus.grpc.RowRecord row_record_array = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual; + do { + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::grpc::RowRecord::_InternalParse; + object = msg->add_row_record_array(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + if (ptr >= end) break; + } while ((::google::protobuf::io::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 18 && (ptr += 1)); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool InsertInfos::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.InsertInfos) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string table_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_table_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->table_name().data(), static_cast(this->table_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "milvus.grpc.InsertInfos.table_name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .milvus.grpc.RowRecord row_record_array = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_row_record_array())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.InsertInfos) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.InsertInfos) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void InsertInfos::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.InsertInfos) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string table_name = 1; + if (this->table_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->table_name().data(), static_cast(this->table_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.InsertInfos.table_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->table_name(), output); + } + + // repeated .milvus.grpc.RowRecord row_record_array = 2; + for (unsigned int i = 0, + n = static_cast(this->row_record_array_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->row_record_array(static_cast(i)), + output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.InsertInfos) +} + +::google::protobuf::uint8* InsertInfos::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.InsertInfos) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string table_name = 1; + if (this->table_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->table_name().data(), static_cast(this->table_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.InsertInfos.table_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->table_name(), target); + } + + // repeated .milvus.grpc.RowRecord row_record_array = 2; + for (unsigned int i = 0, + n = static_cast(this->row_record_array_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->row_record_array(static_cast(i)), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.InsertInfos) + return target; +} + +size_t InsertInfos::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.InsertInfos) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .milvus.grpc.RowRecord row_record_array = 2; + { + unsigned int count = static_cast(this->row_record_array_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->row_record_array(static_cast(i))); + } + } + + // string table_name = 1; + if (this->table_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->table_name()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void InsertInfos::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.InsertInfos) + GOOGLE_DCHECK_NE(&from, this); + const InsertInfos* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.InsertInfos) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.InsertInfos) + MergeFrom(*source); + } +} + +void InsertInfos::MergeFrom(const InsertInfos& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.InsertInfos) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + row_record_array_.MergeFrom(from.row_record_array_); + if (from.table_name().size() > 0) { + + table_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.table_name_); + } +} + +void InsertInfos::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.InsertInfos) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InsertInfos::CopyFrom(const InsertInfos& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.InsertInfos) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InsertInfos::IsInitialized() const { + return true; +} + +void InsertInfos::Swap(InsertInfos* other) { + if (other == this) return; + InternalSwap(other); +} +void InsertInfos::InternalSwap(InsertInfos* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + CastToBase(&row_record_array_)->InternalSwap(CastToBase(&other->row_record_array_)); + table_name_.Swap(&other->table_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} + +::google::protobuf::Metadata InsertInfos::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void VectorIds::InitAsDefaultInstance() { + ::milvus::grpc::_VectorIds_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>( + ::milvus::Status::internal_default_instance()); +} +class VectorIds::HasBitSetters { + public: + static const ::milvus::Status& status(const VectorIds* msg); +}; + +const ::milvus::Status& +VectorIds::HasBitSetters::status(const VectorIds* msg) { + return *msg->status_; +} +void VectorIds::clear_status() { + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int VectorIds::kStatusFieldNumber; +const int VectorIds::kVectorIdArrayFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +VectorIds::VectorIds() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.VectorIds) +} +VectorIds::VectorIds(const VectorIds& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr), + vector_id_array_(from.vector_id_array_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_status()) { + status_ = new ::milvus::Status(*from.status_); + } else { + status_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.VectorIds) +} + +void VectorIds::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_VectorIds_milvus_2eproto.base); + status_ = nullptr; +} + +VectorIds::~VectorIds() { + // @@protoc_insertion_point(destructor:milvus.grpc.VectorIds) + SharedDtor(); +} + +void VectorIds::SharedDtor() { + if (this != internal_default_instance()) delete status_; +} + +void VectorIds::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const VectorIds& VectorIds::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_VectorIds_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void VectorIds::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.VectorIds) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + vector_id_array_.Clear(); + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* VectorIds::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .milvus.Status status = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::Status::_InternalParse; + object = msg->mutable_status(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + break; + } + // repeated int64 vector_id_array = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == 18) { + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::google::protobuf::internal::PackedInt64Parser; + object = msg->mutable_vector_id_array(); + if (size > end - ptr) goto len_delim_till_end; + auto newend = ptr + size; + if (size) ptr = parser_till_end(ptr, newend, object, ctx); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr == newend); + break; + } else if (static_cast<::google::protobuf::uint8>(tag) != 16) goto handle_unusual; + do { + msg->add_vector_id_array(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + if (ptr >= end) break; + } while ((::google::protobuf::io::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 16 && (ptr += 1)); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool VectorIds::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.VectorIds) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .milvus.Status status = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_status())); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 vector_id_array = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_vector_id_array()))); + } else if (static_cast< ::google::protobuf::uint8>(tag) == (16 & 0xFF)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 18u, input, this->mutable_vector_id_array()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.VectorIds) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.VectorIds) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void VectorIds::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.VectorIds) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::status(this), output); + } + + // repeated int64 vector_id_array = 2; + if (this->vector_id_array_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_vector_id_array_cached_byte_size_.load( + std::memory_order_relaxed)); + } + for (int i = 0, n = this->vector_id_array_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->vector_id_array(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.VectorIds) +} + +::google::protobuf::uint8* VectorIds::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.VectorIds) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::status(this), target); + } + + // repeated int64 vector_id_array = 2; + if (this->vector_id_array_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _vector_id_array_cached_byte_size_.load(std::memory_order_relaxed), + target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->vector_id_array_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.VectorIds) + return target; +} + +size_t VectorIds::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.VectorIds) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated int64 vector_id_array = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->vector_id_array_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast<::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + _vector_id_array_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // .milvus.Status status = 1; + if (this->has_status()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *status_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void VectorIds::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.VectorIds) + GOOGLE_DCHECK_NE(&from, this); + const VectorIds* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.VectorIds) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.VectorIds) + MergeFrom(*source); + } +} + +void VectorIds::MergeFrom(const VectorIds& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.VectorIds) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + vector_id_array_.MergeFrom(from.vector_id_array_); + if (from.has_status()) { + mutable_status()->::milvus::Status::MergeFrom(from.status()); + } +} + +void VectorIds::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.VectorIds) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void VectorIds::CopyFrom(const VectorIds& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.VectorIds) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool VectorIds::IsInitialized() const { + return true; +} + +void VectorIds::Swap(VectorIds* other) { + if (other == this) return; + InternalSwap(other); +} +void VectorIds::InternalSwap(VectorIds* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + vector_id_array_.InternalSwap(&other->vector_id_array_); + swap(status_, other->status_); +} + +::google::protobuf::Metadata VectorIds::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void SearchVectorInfos::InitAsDefaultInstance() { +} +class SearchVectorInfos::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SearchVectorInfos::kTableNameFieldNumber; +const int SearchVectorInfos::kQueryRecordArrayFieldNumber; +const int SearchVectorInfos::kQueryRangeArrayFieldNumber; +const int SearchVectorInfos::kTopkFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SearchVectorInfos::SearchVectorInfos() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.SearchVectorInfos) +} +SearchVectorInfos::SearchVectorInfos(const SearchVectorInfos& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr), + query_record_array_(from.query_record_array_), + query_range_array_(from.query_range_array_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + table_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.table_name().size() > 0) { + table_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.table_name_); + } + topk_ = from.topk_; + // @@protoc_insertion_point(copy_constructor:milvus.grpc.SearchVectorInfos) +} + +void SearchVectorInfos::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_SearchVectorInfos_milvus_2eproto.base); + table_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + topk_ = PROTOBUF_LONGLONG(0); +} + +SearchVectorInfos::~SearchVectorInfos() { + // @@protoc_insertion_point(destructor:milvus.grpc.SearchVectorInfos) + SharedDtor(); +} + +void SearchVectorInfos::SharedDtor() { + table_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void SearchVectorInfos::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const SearchVectorInfos& SearchVectorInfos::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_SearchVectorInfos_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void SearchVectorInfos::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.SearchVectorInfos) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + query_record_array_.Clear(); + query_range_array_.Clear(); + table_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + topk_ = PROTOBUF_LONGLONG(0); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* SearchVectorInfos::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // string table_name = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("milvus.grpc.SearchVectorInfos.table_name"); + object = msg->mutable_table_name(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + // repeated .milvus.grpc.RowRecord query_record_array = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual; + do { + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::grpc::RowRecord::_InternalParse; + object = msg->add_query_record_array(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + if (ptr >= end) break; + } while ((::google::protobuf::io::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 18 && (ptr += 1)); + break; + } + // repeated .milvus.grpc.Range query_range_array = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 26) goto handle_unusual; + do { + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::grpc::Range::_InternalParse; + object = msg->add_query_range_array(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + if (ptr >= end) break; + } while ((::google::protobuf::io::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 26 && (ptr += 1)); + break; + } + // int64 topk = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) != 32) goto handle_unusual; + msg->set_topk(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool SearchVectorInfos::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.SearchVectorInfos) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string table_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_table_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->table_name().data(), static_cast(this->table_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "milvus.grpc.SearchVectorInfos.table_name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .milvus.grpc.RowRecord query_record_array = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_query_record_array())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .milvus.grpc.Range query_range_array = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (26 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_query_range_array())); + } else { + goto handle_unusual; + } + break; + } + + // int64 topk = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == (32 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &topk_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.SearchVectorInfos) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.SearchVectorInfos) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void SearchVectorInfos::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.SearchVectorInfos) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string table_name = 1; + if (this->table_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->table_name().data(), static_cast(this->table_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.SearchVectorInfos.table_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->table_name(), output); + } + + // repeated .milvus.grpc.RowRecord query_record_array = 2; + for (unsigned int i = 0, + n = static_cast(this->query_record_array_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->query_record_array(static_cast(i)), + output); + } + + // repeated .milvus.grpc.Range query_range_array = 3; + for (unsigned int i = 0, + n = static_cast(this->query_range_array_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->query_range_array(static_cast(i)), + output); + } + + // int64 topk = 4; + if (this->topk() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->topk(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.SearchVectorInfos) +} + +::google::protobuf::uint8* SearchVectorInfos::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.SearchVectorInfos) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string table_name = 1; + if (this->table_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->table_name().data(), static_cast(this->table_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.SearchVectorInfos.table_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->table_name(), target); + } + + // repeated .milvus.grpc.RowRecord query_record_array = 2; + for (unsigned int i = 0, + n = static_cast(this->query_record_array_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->query_record_array(static_cast(i)), target); + } + + // repeated .milvus.grpc.Range query_range_array = 3; + for (unsigned int i = 0, + n = static_cast(this->query_range_array_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->query_range_array(static_cast(i)), target); + } + + // int64 topk = 4; + if (this->topk() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->topk(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.SearchVectorInfos) + return target; +} + +size_t SearchVectorInfos::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.SearchVectorInfos) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .milvus.grpc.RowRecord query_record_array = 2; + { + unsigned int count = static_cast(this->query_record_array_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->query_record_array(static_cast(i))); + } + } + + // repeated .milvus.grpc.Range query_range_array = 3; + { + unsigned int count = static_cast(this->query_range_array_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->query_range_array(static_cast(i))); + } + } + + // string table_name = 1; + if (this->table_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->table_name()); + } + + // int64 topk = 4; + if (this->topk() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->topk()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SearchVectorInfos::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.SearchVectorInfos) + GOOGLE_DCHECK_NE(&from, this); + const SearchVectorInfos* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.SearchVectorInfos) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.SearchVectorInfos) + MergeFrom(*source); + } +} + +void SearchVectorInfos::MergeFrom(const SearchVectorInfos& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.SearchVectorInfos) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + query_record_array_.MergeFrom(from.query_record_array_); + query_range_array_.MergeFrom(from.query_range_array_); + if (from.table_name().size() > 0) { + + table_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.table_name_); + } + if (from.topk() != 0) { + set_topk(from.topk()); + } +} + +void SearchVectorInfos::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.SearchVectorInfos) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SearchVectorInfos::CopyFrom(const SearchVectorInfos& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.SearchVectorInfos) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SearchVectorInfos::IsInitialized() const { + return true; +} + +void SearchVectorInfos::Swap(SearchVectorInfos* other) { + if (other == this) return; + InternalSwap(other); +} +void SearchVectorInfos::InternalSwap(SearchVectorInfos* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + CastToBase(&query_record_array_)->InternalSwap(CastToBase(&other->query_record_array_)); + CastToBase(&query_range_array_)->InternalSwap(CastToBase(&other->query_range_array_)); + table_name_.Swap(&other->table_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(topk_, other->topk_); +} + +::google::protobuf::Metadata SearchVectorInfos::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void SearchVectorInFilesInfos::InitAsDefaultInstance() { + ::milvus::grpc::_SearchVectorInFilesInfos_default_instance_._instance.get_mutable()->search_vector_infos_ = const_cast< ::milvus::grpc::SearchVectorInfos*>( + ::milvus::grpc::SearchVectorInfos::internal_default_instance()); +} +class SearchVectorInFilesInfos::HasBitSetters { + public: + static const ::milvus::grpc::SearchVectorInfos& search_vector_infos(const SearchVectorInFilesInfos* msg); +}; + +const ::milvus::grpc::SearchVectorInfos& +SearchVectorInFilesInfos::HasBitSetters::search_vector_infos(const SearchVectorInFilesInfos* msg) { + return *msg->search_vector_infos_; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SearchVectorInFilesInfos::kFileIdArrayFieldNumber; +const int SearchVectorInFilesInfos::kSearchVectorInfosFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SearchVectorInFilesInfos::SearchVectorInFilesInfos() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.SearchVectorInFilesInfos) +} +SearchVectorInFilesInfos::SearchVectorInFilesInfos(const SearchVectorInFilesInfos& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr), + file_id_array_(from.file_id_array_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_search_vector_infos()) { + search_vector_infos_ = new ::milvus::grpc::SearchVectorInfos(*from.search_vector_infos_); + } else { + search_vector_infos_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.SearchVectorInFilesInfos) +} + +void SearchVectorInFilesInfos::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_SearchVectorInFilesInfos_milvus_2eproto.base); + search_vector_infos_ = nullptr; +} + +SearchVectorInFilesInfos::~SearchVectorInFilesInfos() { + // @@protoc_insertion_point(destructor:milvus.grpc.SearchVectorInFilesInfos) + SharedDtor(); +} + +void SearchVectorInFilesInfos::SharedDtor() { + if (this != internal_default_instance()) delete search_vector_infos_; +} + +void SearchVectorInFilesInfos::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const SearchVectorInFilesInfos& SearchVectorInFilesInfos::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_SearchVectorInFilesInfos_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void SearchVectorInFilesInfos::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.SearchVectorInFilesInfos) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + file_id_array_.Clear(); + if (GetArenaNoVirtual() == nullptr && search_vector_infos_ != nullptr) { + delete search_vector_infos_; + } + search_vector_infos_ = nullptr; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* SearchVectorInFilesInfos::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // repeated string file_id_array = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + do { + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("milvus.grpc.SearchVectorInFilesInfos.file_id_array"); + object = msg->add_file_id_array(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + if (ptr >= end) break; + } while ((::google::protobuf::io::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 10 && (ptr += 1)); + break; + } + // .milvus.grpc.SearchVectorInfos search_vector_infos = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::grpc::SearchVectorInfos::_InternalParse; + object = msg->mutable_search_vector_infos(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool SearchVectorInFilesInfos::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.SearchVectorInFilesInfos) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated string file_id_array = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_file_id_array())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->file_id_array(this->file_id_array_size() - 1).data(), + static_cast(this->file_id_array(this->file_id_array_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "milvus.grpc.SearchVectorInFilesInfos.file_id_array")); + } else { + goto handle_unusual; + } + break; + } + + // .milvus.grpc.SearchVectorInfos search_vector_infos = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_search_vector_infos())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.SearchVectorInFilesInfos) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.SearchVectorInFilesInfos) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void SearchVectorInFilesInfos::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.SearchVectorInFilesInfos) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string file_id_array = 1; + for (int i = 0, n = this->file_id_array_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->file_id_array(i).data(), static_cast(this->file_id_array(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.SearchVectorInFilesInfos.file_id_array"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 1, this->file_id_array(i), output); + } + + // .milvus.grpc.SearchVectorInfos search_vector_infos = 2; + if (this->has_search_vector_infos()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, HasBitSetters::search_vector_infos(this), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.SearchVectorInFilesInfos) +} + +::google::protobuf::uint8* SearchVectorInFilesInfos::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.SearchVectorInFilesInfos) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string file_id_array = 1; + for (int i = 0, n = this->file_id_array_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->file_id_array(i).data(), static_cast(this->file_id_array(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.SearchVectorInFilesInfos.file_id_array"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(1, this->file_id_array(i), target); + } + + // .milvus.grpc.SearchVectorInfos search_vector_infos = 2; + if (this->has_search_vector_infos()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, HasBitSetters::search_vector_infos(this), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.SearchVectorInFilesInfos) + return target; +} + +size_t SearchVectorInFilesInfos::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.SearchVectorInFilesInfos) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated string file_id_array = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->file_id_array_size()); + for (int i = 0, n = this->file_id_array_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_id_array(i)); + } + + // .milvus.grpc.SearchVectorInfos search_vector_infos = 2; + if (this->has_search_vector_infos()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *search_vector_infos_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SearchVectorInFilesInfos::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.SearchVectorInFilesInfos) + GOOGLE_DCHECK_NE(&from, this); + const SearchVectorInFilesInfos* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.SearchVectorInFilesInfos) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.SearchVectorInFilesInfos) + MergeFrom(*source); + } +} + +void SearchVectorInFilesInfos::MergeFrom(const SearchVectorInFilesInfos& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.SearchVectorInFilesInfos) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + file_id_array_.MergeFrom(from.file_id_array_); + if (from.has_search_vector_infos()) { + mutable_search_vector_infos()->::milvus::grpc::SearchVectorInfos::MergeFrom(from.search_vector_infos()); + } +} + +void SearchVectorInFilesInfos::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.SearchVectorInFilesInfos) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SearchVectorInFilesInfos::CopyFrom(const SearchVectorInFilesInfos& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.SearchVectorInFilesInfos) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SearchVectorInFilesInfos::IsInitialized() const { + return true; +} + +void SearchVectorInFilesInfos::Swap(SearchVectorInFilesInfos* other) { + if (other == this) return; + InternalSwap(other); +} +void SearchVectorInFilesInfos::InternalSwap(SearchVectorInFilesInfos* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + file_id_array_.InternalSwap(CastToBase(&other->file_id_array_)); + swap(search_vector_infos_, other->search_vector_infos_); +} + +::google::protobuf::Metadata SearchVectorInFilesInfos::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void QueryResult::InitAsDefaultInstance() { +} +class QueryResult::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int QueryResult::kIdFieldNumber; +const int QueryResult::kDistanceFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +QueryResult::QueryResult() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.QueryResult) +} +QueryResult::QueryResult(const QueryResult& from) + : ::google::protobuf::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() { + ::google::protobuf::internal::InitSCC(&::scc_info_QueryResult_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void QueryResult::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.QueryResult) + ::google::protobuf::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* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // int64 id = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 8) goto handle_unusual; + msg->set_id(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // double distance = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 17) goto handle_unusual; + msg->set_distance(::google::protobuf::io::UnalignedLoad(ptr)); + ptr += sizeof(double); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool QueryResult::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.QueryResult) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (8 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &id_))); + } else { + goto handle_unusual; + } + break; + } + + // double distance = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (17 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &distance_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::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( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.QueryResult) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 id = 1; + if (this->id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output); + } + + // double distance = 2; + if (this->distance() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->distance(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.QueryResult) +} + +::google::protobuf::uint8* QueryResult::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.QueryResult) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 id = 1; + if (this->id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->id(), target); + } + + // double distance = 2; + if (this->distance() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->distance(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::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 += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::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 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->id()); + } + + // double distance = 2; + if (this->distance() != 0) { + total_size += 1 + 8; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void QueryResult::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.QueryResult) + GOOGLE_DCHECK_NE(&from, this); + const QueryResult* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.QueryResult) + ::google::protobuf::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_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.id() != 0) { + set_id(from.id()); + } + if (from.distance() != 0) { + set_distance(from.distance()); + } +} + +void QueryResult::CopyFrom(const ::google::protobuf::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::Swap(QueryResult* other) { + if (other == this) return; + InternalSwap(other); +} +void QueryResult::InternalSwap(QueryResult* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(id_, other->id_); + swap(distance_, other->distance_); +} + +::google::protobuf::Metadata QueryResult::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void TopKQueryResult::InitAsDefaultInstance() { + ::milvus::grpc::_TopKQueryResult_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>( + ::milvus::Status::internal_default_instance()); +} +class TopKQueryResult::HasBitSetters { + public: + static const ::milvus::Status& status(const TopKQueryResult* msg); +}; + +const ::milvus::Status& +TopKQueryResult::HasBitSetters::status(const TopKQueryResult* msg) { + return *msg->status_; +} +void TopKQueryResult::clear_status() { + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TopKQueryResult::kStatusFieldNumber; +const int TopKQueryResult::kQueryResultArraysFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TopKQueryResult::TopKQueryResult() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.TopKQueryResult) +} +TopKQueryResult::TopKQueryResult(const TopKQueryResult& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr), + query_result_arrays_(from.query_result_arrays_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_status()) { + status_ = new ::milvus::Status(*from.status_); + } else { + status_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.TopKQueryResult) +} + +void TopKQueryResult::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_TopKQueryResult_milvus_2eproto.base); + status_ = nullptr; +} + +TopKQueryResult::~TopKQueryResult() { + // @@protoc_insertion_point(destructor:milvus.grpc.TopKQueryResult) + SharedDtor(); +} + +void TopKQueryResult::SharedDtor() { + if (this != internal_default_instance()) delete status_; +} + +void TopKQueryResult::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const TopKQueryResult& TopKQueryResult::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_TopKQueryResult_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void TopKQueryResult::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.TopKQueryResult) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + query_result_arrays_.Clear(); + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* TopKQueryResult::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .milvus.Status status = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::Status::_InternalParse; + object = msg->mutable_status(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + break; + } + // repeated .milvus.grpc.QueryResult query_result_arrays = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual; + do { + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::grpc::QueryResult::_InternalParse; + object = msg->add_query_result_arrays(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + if (ptr >= end) break; + } while ((::google::protobuf::io::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 18 && (ptr += 1)); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool TopKQueryResult::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.TopKQueryResult) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .milvus.Status status = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_status())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .milvus.grpc.QueryResult query_result_arrays = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_query_result_arrays())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.TopKQueryResult) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.TopKQueryResult) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void TopKQueryResult::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.TopKQueryResult) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::status(this), output); + } + + // repeated .milvus.grpc.QueryResult query_result_arrays = 2; + for (unsigned int i = 0, + n = static_cast(this->query_result_arrays_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->query_result_arrays(static_cast(i)), + output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.TopKQueryResult) +} + +::google::protobuf::uint8* TopKQueryResult::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.TopKQueryResult) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::status(this), target); + } + + // repeated .milvus.grpc.QueryResult query_result_arrays = 2; + for (unsigned int i = 0, + n = static_cast(this->query_result_arrays_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->query_result_arrays(static_cast(i)), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.TopKQueryResult) + return target; +} + +size_t TopKQueryResult::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.TopKQueryResult) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .milvus.grpc.QueryResult query_result_arrays = 2; + { + unsigned int count = static_cast(this->query_result_arrays_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->query_result_arrays(static_cast(i))); + } + } + + // .milvus.Status status = 1; + if (this->has_status()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *status_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TopKQueryResult::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.TopKQueryResult) + GOOGLE_DCHECK_NE(&from, this); + const TopKQueryResult* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.TopKQueryResult) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.TopKQueryResult) + MergeFrom(*source); + } +} + +void TopKQueryResult::MergeFrom(const TopKQueryResult& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.TopKQueryResult) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + query_result_arrays_.MergeFrom(from.query_result_arrays_); + if (from.has_status()) { + mutable_status()->::milvus::Status::MergeFrom(from.status()); + } +} + +void TopKQueryResult::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.TopKQueryResult) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TopKQueryResult::CopyFrom(const TopKQueryResult& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.TopKQueryResult) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TopKQueryResult::IsInitialized() const { + return true; +} + +void TopKQueryResult::Swap(TopKQueryResult* other) { + if (other == this) return; + InternalSwap(other); +} +void TopKQueryResult::InternalSwap(TopKQueryResult* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + CastToBase(&query_result_arrays_)->InternalSwap(CastToBase(&other->query_result_arrays_)); + swap(status_, other->status_); +} + +::google::protobuf::Metadata TopKQueryResult::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void StringReply::InitAsDefaultInstance() { + ::milvus::grpc::_StringReply_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>( + ::milvus::Status::internal_default_instance()); +} +class StringReply::HasBitSetters { + public: + static const ::milvus::Status& status(const StringReply* msg); +}; + +const ::milvus::Status& +StringReply::HasBitSetters::status(const StringReply* msg) { + return *msg->status_; +} +void StringReply::clear_status() { + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int StringReply::kStatusFieldNumber; +const int StringReply::kStringReplyFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +StringReply::StringReply() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.StringReply) +} +StringReply::StringReply(const StringReply& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + string_reply_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.string_reply().size() > 0) { + string_reply_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_reply_); + } + if (from.has_status()) { + status_ = new ::milvus::Status(*from.status_); + } else { + status_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.StringReply) +} + +void StringReply::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_StringReply_milvus_2eproto.base); + string_reply_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + status_ = nullptr; +} + +StringReply::~StringReply() { + // @@protoc_insertion_point(destructor:milvus.grpc.StringReply) + SharedDtor(); +} + +void StringReply::SharedDtor() { + string_reply_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete status_; +} + +void StringReply::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const StringReply& StringReply::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_StringReply_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void StringReply::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.StringReply) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + string_reply_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* StringReply::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .milvus.Status status = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::Status::_InternalParse; + object = msg->mutable_status(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + break; + } + // string string_reply = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("milvus.grpc.StringReply.string_reply"); + object = msg->mutable_string_reply(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool StringReply::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.StringReply) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .milvus.Status status = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_status())); + } else { + goto handle_unusual; + } + break; + } + + // string string_reply = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_string_reply())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->string_reply().data(), static_cast(this->string_reply().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "milvus.grpc.StringReply.string_reply")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.StringReply) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.StringReply) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void StringReply::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.StringReply) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::status(this), output); + } + + // string string_reply = 2; + if (this->string_reply().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->string_reply().data(), static_cast(this->string_reply().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.StringReply.string_reply"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->string_reply(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.StringReply) +} + +::google::protobuf::uint8* StringReply::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.StringReply) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::status(this), target); + } + + // string string_reply = 2; + if (this->string_reply().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->string_reply().data(), static_cast(this->string_reply().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.StringReply.string_reply"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->string_reply(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.StringReply) + return target; +} + +size_t StringReply::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.StringReply) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string string_reply = 2; + if (this->string_reply().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->string_reply()); + } + + // .milvus.Status status = 1; + if (this->has_status()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *status_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StringReply::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.StringReply) + GOOGLE_DCHECK_NE(&from, this); + const StringReply* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.StringReply) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.StringReply) + MergeFrom(*source); + } +} + +void StringReply::MergeFrom(const StringReply& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.StringReply) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.string_reply().size() > 0) { + + string_reply_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_reply_); + } + if (from.has_status()) { + mutable_status()->::milvus::Status::MergeFrom(from.status()); + } +} + +void StringReply::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.StringReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StringReply::CopyFrom(const StringReply& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.StringReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StringReply::IsInitialized() const { + return true; +} + +void StringReply::Swap(StringReply* other) { + if (other == this) return; + InternalSwap(other); +} +void StringReply::InternalSwap(StringReply* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + string_reply_.Swap(&other->string_reply_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(status_, other->status_); +} + +::google::protobuf::Metadata StringReply::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void BoolReply::InitAsDefaultInstance() { + ::milvus::grpc::_BoolReply_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>( + ::milvus::Status::internal_default_instance()); +} +class BoolReply::HasBitSetters { + public: + static const ::milvus::Status& status(const BoolReply* msg); +}; + +const ::milvus::Status& +BoolReply::HasBitSetters::status(const BoolReply* msg) { + return *msg->status_; +} +void BoolReply::clear_status() { + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BoolReply::kStatusFieldNumber; +const int BoolReply::kBoolReplyFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BoolReply::BoolReply() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.BoolReply) +} +BoolReply::BoolReply(const BoolReply& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_status()) { + status_ = new ::milvus::Status(*from.status_); + } else { + status_ = nullptr; + } + bool_reply_ = from.bool_reply_; + // @@protoc_insertion_point(copy_constructor:milvus.grpc.BoolReply) +} + +void BoolReply::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_BoolReply_milvus_2eproto.base); + ::memset(&status_, 0, static_cast( + reinterpret_cast(&bool_reply_) - + reinterpret_cast(&status_)) + sizeof(bool_reply_)); +} + +BoolReply::~BoolReply() { + // @@protoc_insertion_point(destructor:milvus.grpc.BoolReply) + SharedDtor(); +} + +void BoolReply::SharedDtor() { + if (this != internal_default_instance()) delete status_; +} + +void BoolReply::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const BoolReply& BoolReply::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_BoolReply_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void BoolReply::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.BoolReply) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; + bool_reply_ = false; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* BoolReply::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .milvus.Status status = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::Status::_InternalParse; + object = msg->mutable_status(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + break; + } + // bool bool_reply = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 16) goto handle_unusual; + msg->set_bool_reply(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool BoolReply::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.BoolReply) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .milvus.Status status = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_status())); + } else { + goto handle_unusual; + } + break; + } + + // bool bool_reply = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (16 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bool_reply_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.BoolReply) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.BoolReply) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void BoolReply::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.BoolReply) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::status(this), output); + } + + // bool bool_reply = 2; + if (this->bool_reply() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->bool_reply(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.BoolReply) +} + +::google::protobuf::uint8* BoolReply::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.BoolReply) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::status(this), target); + } + + // bool bool_reply = 2; + if (this->bool_reply() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->bool_reply(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.BoolReply) + return target; +} + +size_t BoolReply::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.BoolReply) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *status_); + } + + // bool bool_reply = 2; + if (this->bool_reply() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void BoolReply::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.BoolReply) + GOOGLE_DCHECK_NE(&from, this); + const BoolReply* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.BoolReply) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.BoolReply) + MergeFrom(*source); + } +} + +void BoolReply::MergeFrom(const BoolReply& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.BoolReply) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_status()) { + mutable_status()->::milvus::Status::MergeFrom(from.status()); + } + if (from.bool_reply() != 0) { + set_bool_reply(from.bool_reply()); + } +} + +void BoolReply::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.BoolReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BoolReply::CopyFrom(const BoolReply& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.BoolReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BoolReply::IsInitialized() const { + return true; +} + +void BoolReply::Swap(BoolReply* other) { + if (other == this) return; + InternalSwap(other); +} +void BoolReply::InternalSwap(BoolReply* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(status_, other->status_); + swap(bool_reply_, other->bool_reply_); +} + +::google::protobuf::Metadata BoolReply::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void TableRowCount::InitAsDefaultInstance() { + ::milvus::grpc::_TableRowCount_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>( + ::milvus::Status::internal_default_instance()); +} +class TableRowCount::HasBitSetters { + public: + static const ::milvus::Status& status(const TableRowCount* msg); +}; + +const ::milvus::Status& +TableRowCount::HasBitSetters::status(const TableRowCount* msg) { + return *msg->status_; +} +void TableRowCount::clear_status() { + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TableRowCount::kStatusFieldNumber; +const int TableRowCount::kTableRowCountFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TableRowCount::TableRowCount() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.TableRowCount) +} +TableRowCount::TableRowCount(const TableRowCount& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_status()) { + status_ = new ::milvus::Status(*from.status_); + } else { + status_ = nullptr; + } + table_row_count_ = from.table_row_count_; + // @@protoc_insertion_point(copy_constructor:milvus.grpc.TableRowCount) +} + +void TableRowCount::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_TableRowCount_milvus_2eproto.base); + ::memset(&status_, 0, static_cast( + reinterpret_cast(&table_row_count_) - + reinterpret_cast(&status_)) + sizeof(table_row_count_)); +} + +TableRowCount::~TableRowCount() { + // @@protoc_insertion_point(destructor:milvus.grpc.TableRowCount) + SharedDtor(); +} + +void TableRowCount::SharedDtor() { + if (this != internal_default_instance()) delete status_; +} + +void TableRowCount::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const TableRowCount& TableRowCount::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_TableRowCount_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void TableRowCount::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.TableRowCount) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; + table_row_count_ = PROTOBUF_LONGLONG(0); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* TableRowCount::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .milvus.Status status = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::Status::_InternalParse; + object = msg->mutable_status(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + break; + } + // int64 table_row_count = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 16) goto handle_unusual; + msg->set_table_row_count(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool TableRowCount::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.TableRowCount) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .milvus.Status status = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_status())); + } else { + goto handle_unusual; + } + break; + } + + // int64 table_row_count = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (16 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &table_row_count_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.TableRowCount) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.TableRowCount) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void TableRowCount::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.TableRowCount) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::status(this), output); + } + + // int64 table_row_count = 2; + if (this->table_row_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->table_row_count(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.TableRowCount) +} + +::google::protobuf::uint8* TableRowCount::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.TableRowCount) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::status(this), target); + } + + // int64 table_row_count = 2; + if (this->table_row_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->table_row_count(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.TableRowCount) + return target; +} + +size_t TableRowCount::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.TableRowCount) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *status_); + } + + // int64 table_row_count = 2; + if (this->table_row_count() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->table_row_count()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TableRowCount::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.TableRowCount) + GOOGLE_DCHECK_NE(&from, this); + const TableRowCount* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.TableRowCount) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.TableRowCount) + MergeFrom(*source); + } +} + +void TableRowCount::MergeFrom(const TableRowCount& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.TableRowCount) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_status()) { + mutable_status()->::milvus::Status::MergeFrom(from.status()); + } + if (from.table_row_count() != 0) { + set_table_row_count(from.table_row_count()); + } +} + +void TableRowCount::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.TableRowCount) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TableRowCount::CopyFrom(const TableRowCount& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.TableRowCount) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TableRowCount::IsInitialized() const { + return true; +} + +void TableRowCount::Swap(TableRowCount* other) { + if (other == this) return; + InternalSwap(other); +} +void TableRowCount::InternalSwap(TableRowCount* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(status_, other->status_); + swap(table_row_count_, other->table_row_count_); +} + +::google::protobuf::Metadata TableRowCount::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void Command::InitAsDefaultInstance() { +} +class Command::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Command::kCmdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Command::Command() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.Command) +} +Command::Command(const Command& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + cmd_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.cmd().size() > 0) { + cmd_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.cmd_); + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.Command) +} + +void Command::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_Command_milvus_2eproto.base); + cmd_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +Command::~Command() { + // @@protoc_insertion_point(destructor:milvus.grpc.Command) + SharedDtor(); +} + +void Command::SharedDtor() { + cmd_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Command::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Command& Command::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_Command_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void Command::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.Command) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cmd_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Command::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // string cmd = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("milvus.grpc.Command.cmd"); + object = msg->mutable_cmd(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool Command::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.Command) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string cmd = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_cmd())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->cmd().data(), static_cast(this->cmd().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "milvus.grpc.Command.cmd")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.Command) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.Command) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Command::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.Command) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string cmd = 1; + if (this->cmd().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->cmd().data(), static_cast(this->cmd().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.Command.cmd"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->cmd(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.Command) +} + +::google::protobuf::uint8* Command::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.Command) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string cmd = 1; + if (this->cmd().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->cmd().data(), static_cast(this->cmd().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.Command.cmd"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->cmd(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.Command) + return target; +} + +size_t Command::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.Command) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string cmd = 1; + if (this->cmd().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->cmd()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Command::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.Command) + GOOGLE_DCHECK_NE(&from, this); + const Command* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.Command) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.Command) + MergeFrom(*source); + } +} + +void Command::MergeFrom(const Command& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.Command) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.cmd().size() > 0) { + + cmd_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.cmd_); + } +} + +void Command::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.Command) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Command::CopyFrom(const Command& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.Command) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Command::IsInitialized() const { + return true; +} + +void Command::Swap(Command* other) { + if (other == this) return; + InternalSwap(other); +} +void Command::InternalSwap(Command* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + cmd_.Swap(&other->cmd_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} + +::google::protobuf::Metadata Command::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// =================================================================== + +void ServerStatus::InitAsDefaultInstance() { + ::milvus::grpc::_ServerStatus_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>( + ::milvus::Status::internal_default_instance()); +} +class ServerStatus::HasBitSetters { + public: + static const ::milvus::Status& status(const ServerStatus* msg); +}; + +const ::milvus::Status& +ServerStatus::HasBitSetters::status(const ServerStatus* msg) { + return *msg->status_; +} +void ServerStatus::clear_status() { + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ServerStatus::kStatusFieldNumber; +const int ServerStatus::kInfoFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ServerStatus::ServerStatus() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.ServerStatus) +} +ServerStatus::ServerStatus(const ServerStatus& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + info_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.info().size() > 0) { + info_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.info_); + } + if (from.has_status()) { + status_ = new ::milvus::Status(*from.status_); + } else { + status_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.ServerStatus) +} + +void ServerStatus::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_ServerStatus_milvus_2eproto.base); + info_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + status_ = nullptr; +} + +ServerStatus::~ServerStatus() { + // @@protoc_insertion_point(destructor:milvus.grpc.ServerStatus) + SharedDtor(); +} + +void ServerStatus::SharedDtor() { + info_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete status_; +} + +void ServerStatus::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ServerStatus& ServerStatus::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_ServerStatus_milvus_2eproto.base); + return *internal_default_instance(); +} + + +void ServerStatus::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.ServerStatus) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + info_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { + delete status_; + } + status_ = nullptr; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* ServerStatus::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .milvus.Status status = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + parser_till_end = ::milvus::Status::_InternalParse; + object = msg->mutable_status(); + if (size > end - ptr) goto len_delim_till_end; + ptr += size; + GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange( + {parser_till_end, object}, ptr - size, ptr)); + break; + } + // string info = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("milvus.grpc.ServerStatus.info"); + object = msg->mutable_info(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool ServerStatus::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.ServerStatus) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .milvus.Status status = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_status())); + } else { + goto handle_unusual; + } + break; + } + + // string info = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_info())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->info().data(), static_cast(this->info().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "milvus.grpc.ServerStatus.info")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.ServerStatus) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.ServerStatus) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void ServerStatus::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.ServerStatus) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, HasBitSetters::status(this), output); + } + + // string info = 2; + if (this->info().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->info().data(), static_cast(this->info().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.ServerStatus.info"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->info(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.ServerStatus) +} + +::google::protobuf::uint8* ServerStatus::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.ServerStatus) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.Status status = 1; + if (this->has_status()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, HasBitSetters::status(this), target); + } + + // string info = 2; + if (this->info().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->info().data(), static_cast(this->info().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.ServerStatus.info"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->info(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.ServerStatus) + return target; +} + +size_t ServerStatus::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.ServerStatus) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string info = 2; + if (this->info().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->info()); + } + + // .milvus.Status status = 1; + if (this->has_status()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *status_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ServerStatus::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.ServerStatus) + GOOGLE_DCHECK_NE(&from, this); + const ServerStatus* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.ServerStatus) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.ServerStatus) + MergeFrom(*source); + } +} + +void ServerStatus::MergeFrom(const ServerStatus& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.ServerStatus) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.info().size() > 0) { + + info_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.info_); + } + if (from.has_status()) { + mutable_status()->::milvus::Status::MergeFrom(from.status()); + } +} + +void ServerStatus::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.ServerStatus) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ServerStatus::CopyFrom(const ServerStatus& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.ServerStatus) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ServerStatus::IsInitialized() const { + return true; +} + +void ServerStatus::Swap(ServerStatus* other) { + if (other == this) return; + InternalSwap(other); +} +void ServerStatus::InternalSwap(ServerStatus* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + info_.Swap(&other->info_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(status_, other->status_); +} + +::google::protobuf::Metadata ServerStatus::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_milvus_2eproto); + return ::file_level_metadata_milvus_2eproto[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace grpc +} // namespace milvus +namespace google { +namespace protobuf { +template<> PROTOBUF_NOINLINE ::milvus::grpc::TableName* Arena::CreateMaybeMessage< ::milvus::grpc::TableName >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::TableName >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::TableSchema* Arena::CreateMaybeMessage< ::milvus::grpc::TableSchema >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::TableSchema >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::Range* Arena::CreateMaybeMessage< ::milvus::grpc::Range >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::Range >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::RowRecord* Arena::CreateMaybeMessage< ::milvus::grpc::RowRecord >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::RowRecord >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::InsertInfos* Arena::CreateMaybeMessage< ::milvus::grpc::InsertInfos >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::InsertInfos >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::VectorIds* Arena::CreateMaybeMessage< ::milvus::grpc::VectorIds >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::VectorIds >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::SearchVectorInfos* Arena::CreateMaybeMessage< ::milvus::grpc::SearchVectorInfos >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::SearchVectorInfos >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::SearchVectorInFilesInfos* Arena::CreateMaybeMessage< ::milvus::grpc::SearchVectorInFilesInfos >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::SearchVectorInFilesInfos >(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::StringReply* Arena::CreateMaybeMessage< ::milvus::grpc::StringReply >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::StringReply >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::BoolReply* Arena::CreateMaybeMessage< ::milvus::grpc::BoolReply >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::BoolReply >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::TableRowCount* Arena::CreateMaybeMessage< ::milvus::grpc::TableRowCount >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::TableRowCount >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::Command* Arena::CreateMaybeMessage< ::milvus::grpc::Command >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::Command >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::ServerStatus* Arena::CreateMaybeMessage< ::milvus::grpc::ServerStatus >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::ServerStatus >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) +#include diff --git a/cpp/src/grpc/gen-milvus/milvus.pb.h b/cpp/src/grpc/gen-milvus/milvus.pb.h new file mode 100644 index 0000000000..7061eac44b --- /dev/null +++ b/cpp/src/grpc/gen-milvus/milvus.pb.h @@ -0,0 +1,3376 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: milvus.proto + +#ifndef PROTOBUF_INCLUDED_milvus_2eproto +#define PROTOBUF_INCLUDED_milvus_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3007000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "status.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_milvus_2eproto + +// Internal implementation detail -- do not use these members. +struct TableStruct_milvus_2eproto { + static const ::google::protobuf::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::ParseTable schema[15] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors_milvus_2eproto(); +namespace milvus { +namespace grpc { +class BoolReply; +class BoolReplyDefaultTypeInternal; +extern BoolReplyDefaultTypeInternal _BoolReply_default_instance_; +class Command; +class CommandDefaultTypeInternal; +extern CommandDefaultTypeInternal _Command_default_instance_; +class InsertInfos; +class InsertInfosDefaultTypeInternal; +extern InsertInfosDefaultTypeInternal _InsertInfos_default_instance_; +class QueryResult; +class QueryResultDefaultTypeInternal; +extern QueryResultDefaultTypeInternal _QueryResult_default_instance_; +class Range; +class RangeDefaultTypeInternal; +extern RangeDefaultTypeInternal _Range_default_instance_; +class RowRecord; +class RowRecordDefaultTypeInternal; +extern RowRecordDefaultTypeInternal _RowRecord_default_instance_; +class SearchVectorInFilesInfos; +class SearchVectorInFilesInfosDefaultTypeInternal; +extern SearchVectorInFilesInfosDefaultTypeInternal _SearchVectorInFilesInfos_default_instance_; +class SearchVectorInfos; +class SearchVectorInfosDefaultTypeInternal; +extern SearchVectorInfosDefaultTypeInternal _SearchVectorInfos_default_instance_; +class ServerStatus; +class ServerStatusDefaultTypeInternal; +extern ServerStatusDefaultTypeInternal _ServerStatus_default_instance_; +class StringReply; +class StringReplyDefaultTypeInternal; +extern StringReplyDefaultTypeInternal _StringReply_default_instance_; +class TableName; +class TableNameDefaultTypeInternal; +extern TableNameDefaultTypeInternal _TableName_default_instance_; +class TableRowCount; +class TableRowCountDefaultTypeInternal; +extern TableRowCountDefaultTypeInternal _TableRowCount_default_instance_; +class TableSchema; +class TableSchemaDefaultTypeInternal; +extern TableSchemaDefaultTypeInternal _TableSchema_default_instance_; +class TopKQueryResult; +class TopKQueryResultDefaultTypeInternal; +extern TopKQueryResultDefaultTypeInternal _TopKQueryResult_default_instance_; +class VectorIds; +class VectorIdsDefaultTypeInternal; +extern VectorIdsDefaultTypeInternal _VectorIds_default_instance_; +} // namespace grpc +} // namespace milvus +namespace google { +namespace protobuf { +template<> ::milvus::grpc::BoolReply* Arena::CreateMaybeMessage<::milvus::grpc::BoolReply>(Arena*); +template<> ::milvus::grpc::Command* Arena::CreateMaybeMessage<::milvus::grpc::Command>(Arena*); +template<> ::milvus::grpc::InsertInfos* Arena::CreateMaybeMessage<::milvus::grpc::InsertInfos>(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::SearchVectorInFilesInfos* Arena::CreateMaybeMessage<::milvus::grpc::SearchVectorInFilesInfos>(Arena*); +template<> ::milvus::grpc::SearchVectorInfos* Arena::CreateMaybeMessage<::milvus::grpc::SearchVectorInfos>(Arena*); +template<> ::milvus::grpc::ServerStatus* Arena::CreateMaybeMessage<::milvus::grpc::ServerStatus>(Arena*); +template<> ::milvus::grpc::StringReply* Arena::CreateMaybeMessage<::milvus::grpc::StringReply>(Arena*); +template<> ::milvus::grpc::TableName* Arena::CreateMaybeMessage<::milvus::grpc::TableName>(Arena*); +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::VectorIds* Arena::CreateMaybeMessage<::milvus::grpc::VectorIds>(Arena*); +} // namespace protobuf +} // namespace google +namespace milvus { +namespace grpc { + +// =================================================================== + +class TableName final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.TableName) */ { + public: + TableName(); + virtual ~TableName(); + + TableName(const TableName& from); + + inline TableName& operator=(const TableName& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TableName(TableName&& from) noexcept + : TableName() { + *this = ::std::move(from); + } + + inline TableName& operator=(TableName&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const TableName& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TableName* internal_default_instance() { + return reinterpret_cast( + &_TableName_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(TableName* other); + friend void swap(TableName& a, TableName& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TableName* New() const final { + return CreateMaybeMessage(nullptr); + } + + TableName* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TableName& from); + void MergeFrom(const TableName& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TableName* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string table_name = 2; + void clear_table_name(); + static const int kTableNameFieldNumber = 2; + const ::std::string& table_name() const; + void set_table_name(const ::std::string& value); + #if LANG_CXX11 + void set_table_name(::std::string&& value); + #endif + void set_table_name(const char* value); + void set_table_name(const char* value, size_t size); + ::std::string* mutable_table_name(); + ::std::string* release_table_name(); + void set_allocated_table_name(::std::string* table_name); + + // .milvus.Status status = 1; + bool has_status() const; + void clear_status(); + static const int kStatusFieldNumber = 1; + const ::milvus::Status& status() const; + ::milvus::Status* release_status(); + ::milvus::Status* mutable_status(); + void set_allocated_status(::milvus::Status* status); + + // @@protoc_insertion_point(class_scope:milvus.grpc.TableName) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr table_name_; + ::milvus::Status* status_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class TableSchema final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.TableSchema) */ { + public: + TableSchema(); + virtual ~TableSchema(); + + TableSchema(const TableSchema& from); + + inline TableSchema& operator=(const TableSchema& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TableSchema(TableSchema&& from) noexcept + : TableSchema() { + *this = ::std::move(from); + } + + inline TableSchema& operator=(TableSchema&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const TableSchema& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TableSchema* internal_default_instance() { + return reinterpret_cast( + &_TableSchema_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(TableSchema* other); + friend void swap(TableSchema& a, TableSchema& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TableSchema* New() const final { + return CreateMaybeMessage(nullptr); + } + + TableSchema* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TableSchema& from); + void MergeFrom(const TableSchema& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TableSchema* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .milvus.grpc.TableName table_name = 1; + bool has_table_name() const; + void clear_table_name(); + static const int kTableNameFieldNumber = 1; + const ::milvus::grpc::TableName& table_name() const; + ::milvus::grpc::TableName* release_table_name(); + ::milvus::grpc::TableName* mutable_table_name(); + void set_allocated_table_name(::milvus::grpc::TableName* table_name); + + // int64 dimension = 3; + void clear_dimension(); + static const int kDimensionFieldNumber = 3; + ::google::protobuf::int64 dimension() const; + void set_dimension(::google::protobuf::int64 value); + + // int32 index_type = 2; + void clear_index_type(); + static const int kIndexTypeFieldNumber = 2; + ::google::protobuf::int32 index_type() const; + void set_index_type(::google::protobuf::int32 value); + + // bool store_raw_vector = 4; + void clear_store_raw_vector(); + static const int kStoreRawVectorFieldNumber = 4; + bool store_raw_vector() const; + void set_store_raw_vector(bool value); + + // @@protoc_insertion_point(class_scope:milvus.grpc.TableSchema) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::milvus::grpc::TableName* table_name_; + ::google::protobuf::int64 dimension_; + ::google::protobuf::int32 index_type_; + bool store_raw_vector_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class Range final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.Range) */ { + public: + Range(); + virtual ~Range(); + + Range(const Range& from); + + inline Range& operator=(const Range& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Range(Range&& from) noexcept + : Range() { + *this = ::std::move(from); + } + + inline Range& operator=(Range&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const Range& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Range* internal_default_instance() { + return reinterpret_cast( + &_Range_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(Range* other); + friend void swap(Range& a, Range& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Range* New() const final { + return CreateMaybeMessage(nullptr); + } + + Range* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Range& from); + void MergeFrom(const Range& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Range* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string start_value = 1; + void clear_start_value(); + static const int kStartValueFieldNumber = 1; + const ::std::string& start_value() const; + void set_start_value(const ::std::string& value); + #if LANG_CXX11 + void set_start_value(::std::string&& value); + #endif + void set_start_value(const char* value); + void set_start_value(const char* value, size_t size); + ::std::string* mutable_start_value(); + ::std::string* release_start_value(); + void set_allocated_start_value(::std::string* start_value); + + // string end_value = 2; + void clear_end_value(); + static const int kEndValueFieldNumber = 2; + const ::std::string& end_value() const; + void set_end_value(const ::std::string& value); + #if LANG_CXX11 + void set_end_value(::std::string&& value); + #endif + void set_end_value(const char* value); + void set_end_value(const char* value, size_t size); + ::std::string* mutable_end_value(); + ::std::string* release_end_value(); + void set_allocated_end_value(::std::string* end_value); + + // @@protoc_insertion_point(class_scope:milvus.grpc.Range) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr start_value_; + ::google::protobuf::internal::ArenaStringPtr end_value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class RowRecord final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.RowRecord) */ { + public: + RowRecord(); + virtual ~RowRecord(); + + RowRecord(const RowRecord& from); + + inline RowRecord& operator=(const RowRecord& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + RowRecord(RowRecord&& from) noexcept + : RowRecord() { + *this = ::std::move(from); + } + + inline RowRecord& operator=(RowRecord&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const RowRecord& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const RowRecord* internal_default_instance() { + return reinterpret_cast( + &_RowRecord_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(RowRecord* other); + friend void swap(RowRecord& a, RowRecord& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline RowRecord* New() const final { + return CreateMaybeMessage(nullptr); + } + + RowRecord* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const RowRecord& from); + void MergeFrom(const RowRecord& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(RowRecord* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated float vector_data = 1; + int vector_data_size() const; + void clear_vector_data(); + static const int kVectorDataFieldNumber = 1; + float vector_data(int index) const; + void set_vector_data(int index, float value); + void add_vector_data(float value); + const ::google::protobuf::RepeatedField< float >& + vector_data() const; + ::google::protobuf::RepeatedField< float >* + mutable_vector_data(); + + // @@protoc_insertion_point(class_scope:milvus.grpc.RowRecord) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedField< float > vector_data_; + mutable std::atomic _vector_data_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class InsertInfos final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.InsertInfos) */ { + public: + InsertInfos(); + virtual ~InsertInfos(); + + InsertInfos(const InsertInfos& from); + + inline InsertInfos& operator=(const InsertInfos& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + InsertInfos(InsertInfos&& from) noexcept + : InsertInfos() { + *this = ::std::move(from); + } + + inline InsertInfos& operator=(InsertInfos&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const InsertInfos& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const InsertInfos* internal_default_instance() { + return reinterpret_cast( + &_InsertInfos_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(InsertInfos* other); + friend void swap(InsertInfos& a, InsertInfos& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline InsertInfos* New() const final { + return CreateMaybeMessage(nullptr); + } + + InsertInfos* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const InsertInfos& from); + void MergeFrom(const InsertInfos& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(InsertInfos* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .milvus.grpc.RowRecord row_record_array = 2; + int row_record_array_size() const; + void clear_row_record_array(); + static const int kRowRecordArrayFieldNumber = 2; + ::milvus::grpc::RowRecord* mutable_row_record_array(int index); + ::google::protobuf::RepeatedPtrField< ::milvus::grpc::RowRecord >* + mutable_row_record_array(); + const ::milvus::grpc::RowRecord& row_record_array(int index) const; + ::milvus::grpc::RowRecord* add_row_record_array(); + const ::google::protobuf::RepeatedPtrField< ::milvus::grpc::RowRecord >& + row_record_array() const; + + // string table_name = 1; + void clear_table_name(); + static const int kTableNameFieldNumber = 1; + const ::std::string& table_name() const; + void set_table_name(const ::std::string& value); + #if LANG_CXX11 + void set_table_name(::std::string&& value); + #endif + void set_table_name(const char* value); + void set_table_name(const char* value, size_t size); + ::std::string* mutable_table_name(); + ::std::string* release_table_name(); + void set_allocated_table_name(::std::string* table_name); + + // @@protoc_insertion_point(class_scope:milvus.grpc.InsertInfos) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::milvus::grpc::RowRecord > row_record_array_; + ::google::protobuf::internal::ArenaStringPtr table_name_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class VectorIds final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.VectorIds) */ { + public: + VectorIds(); + virtual ~VectorIds(); + + VectorIds(const VectorIds& from); + + inline VectorIds& operator=(const VectorIds& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + VectorIds(VectorIds&& from) noexcept + : VectorIds() { + *this = ::std::move(from); + } + + inline VectorIds& operator=(VectorIds&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const VectorIds& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const VectorIds* internal_default_instance() { + return reinterpret_cast( + &_VectorIds_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void Swap(VectorIds* other); + friend void swap(VectorIds& a, VectorIds& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline VectorIds* New() const final { + return CreateMaybeMessage(nullptr); + } + + VectorIds* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const VectorIds& from); + void MergeFrom(const VectorIds& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(VectorIds* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 vector_id_array = 2; + int vector_id_array_size() const; + void clear_vector_id_array(); + static const int kVectorIdArrayFieldNumber = 2; + ::google::protobuf::int64 vector_id_array(int index) const; + void set_vector_id_array(int index, ::google::protobuf::int64 value); + void add_vector_id_array(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + vector_id_array() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_vector_id_array(); + + // .milvus.Status status = 1; + bool has_status() const; + void clear_status(); + static const int kStatusFieldNumber = 1; + const ::milvus::Status& status() const; + ::milvus::Status* release_status(); + ::milvus::Status* mutable_status(); + void set_allocated_status(::milvus::Status* status); + + // @@protoc_insertion_point(class_scope:milvus.grpc.VectorIds) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > vector_id_array_; + mutable std::atomic _vector_id_array_cached_byte_size_; + ::milvus::Status* status_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class SearchVectorInfos final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.SearchVectorInfos) */ { + public: + SearchVectorInfos(); + virtual ~SearchVectorInfos(); + + SearchVectorInfos(const SearchVectorInfos& from); + + inline SearchVectorInfos& operator=(const SearchVectorInfos& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SearchVectorInfos(SearchVectorInfos&& from) noexcept + : SearchVectorInfos() { + *this = ::std::move(from); + } + + inline SearchVectorInfos& operator=(SearchVectorInfos&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const SearchVectorInfos& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SearchVectorInfos* internal_default_instance() { + return reinterpret_cast( + &_SearchVectorInfos_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void Swap(SearchVectorInfos* other); + friend void swap(SearchVectorInfos& a, SearchVectorInfos& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SearchVectorInfos* New() const final { + return CreateMaybeMessage(nullptr); + } + + SearchVectorInfos* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SearchVectorInfos& from); + void MergeFrom(const SearchVectorInfos& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SearchVectorInfos* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .milvus.grpc.RowRecord query_record_array = 2; + int query_record_array_size() const; + void clear_query_record_array(); + static const int kQueryRecordArrayFieldNumber = 2; + ::milvus::grpc::RowRecord* mutable_query_record_array(int index); + ::google::protobuf::RepeatedPtrField< ::milvus::grpc::RowRecord >* + mutable_query_record_array(); + const ::milvus::grpc::RowRecord& query_record_array(int index) const; + ::milvus::grpc::RowRecord* add_query_record_array(); + const ::google::protobuf::RepeatedPtrField< ::milvus::grpc::RowRecord >& + query_record_array() const; + + // repeated .milvus.grpc.Range query_range_array = 3; + int query_range_array_size() const; + void clear_query_range_array(); + static const int kQueryRangeArrayFieldNumber = 3; + ::milvus::grpc::Range* mutable_query_range_array(int index); + ::google::protobuf::RepeatedPtrField< ::milvus::grpc::Range >* + mutable_query_range_array(); + const ::milvus::grpc::Range& query_range_array(int index) const; + ::milvus::grpc::Range* add_query_range_array(); + const ::google::protobuf::RepeatedPtrField< ::milvus::grpc::Range >& + query_range_array() const; + + // string table_name = 1; + void clear_table_name(); + static const int kTableNameFieldNumber = 1; + const ::std::string& table_name() const; + void set_table_name(const ::std::string& value); + #if LANG_CXX11 + void set_table_name(::std::string&& value); + #endif + void set_table_name(const char* value); + void set_table_name(const char* value, size_t size); + ::std::string* mutable_table_name(); + ::std::string* release_table_name(); + void set_allocated_table_name(::std::string* table_name); + + // int64 topk = 4; + void clear_topk(); + static const int kTopkFieldNumber = 4; + ::google::protobuf::int64 topk() const; + void set_topk(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:milvus.grpc.SearchVectorInfos) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::milvus::grpc::RowRecord > query_record_array_; + ::google::protobuf::RepeatedPtrField< ::milvus::grpc::Range > query_range_array_; + ::google::protobuf::internal::ArenaStringPtr table_name_; + ::google::protobuf::int64 topk_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class SearchVectorInFilesInfos final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.SearchVectorInFilesInfos) */ { + public: + SearchVectorInFilesInfos(); + virtual ~SearchVectorInFilesInfos(); + + SearchVectorInFilesInfos(const SearchVectorInFilesInfos& from); + + inline SearchVectorInFilesInfos& operator=(const SearchVectorInFilesInfos& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SearchVectorInFilesInfos(SearchVectorInFilesInfos&& from) noexcept + : SearchVectorInFilesInfos() { + *this = ::std::move(from); + } + + inline SearchVectorInFilesInfos& operator=(SearchVectorInFilesInfos&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const SearchVectorInFilesInfos& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SearchVectorInFilesInfos* internal_default_instance() { + return reinterpret_cast( + &_SearchVectorInFilesInfos_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void Swap(SearchVectorInFilesInfos* other); + friend void swap(SearchVectorInFilesInfos& a, SearchVectorInFilesInfos& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SearchVectorInFilesInfos* New() const final { + return CreateMaybeMessage(nullptr); + } + + SearchVectorInFilesInfos* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SearchVectorInFilesInfos& from); + void MergeFrom(const SearchVectorInFilesInfos& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SearchVectorInFilesInfos* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated string file_id_array = 1; + int file_id_array_size() const; + void clear_file_id_array(); + static const int kFileIdArrayFieldNumber = 1; + const ::std::string& file_id_array(int index) const; + ::std::string* mutable_file_id_array(int index); + void set_file_id_array(int index, const ::std::string& value); + #if LANG_CXX11 + void set_file_id_array(int index, ::std::string&& value); + #endif + void set_file_id_array(int index, const char* value); + void set_file_id_array(int index, const char* value, size_t size); + ::std::string* add_file_id_array(); + void add_file_id_array(const ::std::string& value); + #if LANG_CXX11 + void add_file_id_array(::std::string&& value); + #endif + void add_file_id_array(const char* value); + void add_file_id_array(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField<::std::string>& file_id_array() const; + ::google::protobuf::RepeatedPtrField<::std::string>* mutable_file_id_array(); + + // .milvus.grpc.SearchVectorInfos search_vector_infos = 2; + bool has_search_vector_infos() const; + void clear_search_vector_infos(); + static const int kSearchVectorInfosFieldNumber = 2; + const ::milvus::grpc::SearchVectorInfos& search_vector_infos() const; + ::milvus::grpc::SearchVectorInfos* release_search_vector_infos(); + ::milvus::grpc::SearchVectorInfos* mutable_search_vector_infos(); + void set_allocated_search_vector_infos(::milvus::grpc::SearchVectorInfos* search_vector_infos); + + // @@protoc_insertion_point(class_scope:milvus.grpc.SearchVectorInFilesInfos) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField<::std::string> file_id_array_; + ::milvus::grpc::SearchVectorInfos* search_vector_infos_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class QueryResult final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.QueryResult) */ { + public: + QueryResult(); + virtual ~QueryResult(); + + QueryResult(const QueryResult& from); + + inline QueryResult& operator=(const QueryResult& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + QueryResult(QueryResult&& from) noexcept + : QueryResult() { + *this = ::std::move(from); + } + + inline QueryResult& operator=(QueryResult&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + 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 = + 8; + + void Swap(QueryResult* other); + friend void swap(QueryResult& a, QueryResult& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline QueryResult* New() const final { + return CreateMaybeMessage(nullptr); + } + + QueryResult* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::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 + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(QueryResult* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 id = 1; + void clear_id(); + static const int kIdFieldNumber = 1; + ::google::protobuf::int64 id() const; + void set_id(::google::protobuf::int64 value); + + // double distance = 2; + void clear_distance(); + static const int kDistanceFieldNumber = 2; + double distance() const; + void set_distance(double value); + + // @@protoc_insertion_point(class_scope:milvus.grpc.QueryResult) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::int64 id_; + double distance_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class TopKQueryResult final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.TopKQueryResult) */ { + public: + TopKQueryResult(); + virtual ~TopKQueryResult(); + + TopKQueryResult(const TopKQueryResult& from); + + inline TopKQueryResult& operator=(const TopKQueryResult& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TopKQueryResult(TopKQueryResult&& from) noexcept + : TopKQueryResult() { + *this = ::std::move(from); + } + + inline TopKQueryResult& operator=(TopKQueryResult&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const TopKQueryResult& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TopKQueryResult* internal_default_instance() { + return reinterpret_cast( + &_TopKQueryResult_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + void Swap(TopKQueryResult* other); + friend void swap(TopKQueryResult& a, TopKQueryResult& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TopKQueryResult* New() const final { + return CreateMaybeMessage(nullptr); + } + + TopKQueryResult* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TopKQueryResult& from); + void MergeFrom(const TopKQueryResult& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TopKQueryResult* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .milvus.grpc.QueryResult query_result_arrays = 2; + int query_result_arrays_size() const; + void clear_query_result_arrays(); + static const int kQueryResultArraysFieldNumber = 2; + ::milvus::grpc::QueryResult* mutable_query_result_arrays(int index); + ::google::protobuf::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 ::google::protobuf::RepeatedPtrField< ::milvus::grpc::QueryResult >& + query_result_arrays() const; + + // .milvus.Status status = 1; + bool has_status() const; + void clear_status(); + static const int kStatusFieldNumber = 1; + const ::milvus::Status& status() const; + ::milvus::Status* release_status(); + ::milvus::Status* mutable_status(); + void set_allocated_status(::milvus::Status* status); + + // @@protoc_insertion_point(class_scope:milvus.grpc.TopKQueryResult) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::milvus::grpc::QueryResult > query_result_arrays_; + ::milvus::Status* status_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class StringReply final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.StringReply) */ { + public: + StringReply(); + virtual ~StringReply(); + + StringReply(const StringReply& from); + + inline StringReply& operator=(const StringReply& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + StringReply(StringReply&& from) noexcept + : StringReply() { + *this = ::std::move(from); + } + + inline StringReply& operator=(StringReply&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const StringReply& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StringReply* internal_default_instance() { + return reinterpret_cast( + &_StringReply_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + void Swap(StringReply* other); + friend void swap(StringReply& a, StringReply& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline StringReply* New() const final { + return CreateMaybeMessage(nullptr); + } + + StringReply* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const StringReply& from); + void MergeFrom(const StringReply& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StringReply* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string string_reply = 2; + void clear_string_reply(); + static const int kStringReplyFieldNumber = 2; + const ::std::string& string_reply() const; + void set_string_reply(const ::std::string& value); + #if LANG_CXX11 + void set_string_reply(::std::string&& value); + #endif + void set_string_reply(const char* value); + void set_string_reply(const char* value, size_t size); + ::std::string* mutable_string_reply(); + ::std::string* release_string_reply(); + void set_allocated_string_reply(::std::string* string_reply); + + // .milvus.Status status = 1; + bool has_status() const; + void clear_status(); + static const int kStatusFieldNumber = 1; + const ::milvus::Status& status() const; + ::milvus::Status* release_status(); + ::milvus::Status* mutable_status(); + void set_allocated_status(::milvus::Status* status); + + // @@protoc_insertion_point(class_scope:milvus.grpc.StringReply) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr string_reply_; + ::milvus::Status* status_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class BoolReply final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.BoolReply) */ { + public: + BoolReply(); + virtual ~BoolReply(); + + BoolReply(const BoolReply& from); + + inline BoolReply& operator=(const BoolReply& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + BoolReply(BoolReply&& from) noexcept + : BoolReply() { + *this = ::std::move(from); + } + + inline BoolReply& operator=(BoolReply&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const BoolReply& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const BoolReply* internal_default_instance() { + return reinterpret_cast( + &_BoolReply_default_instance_); + } + static constexpr int kIndexInFileMessages = + 11; + + void Swap(BoolReply* other); + friend void swap(BoolReply& a, BoolReply& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline BoolReply* New() const final { + return CreateMaybeMessage(nullptr); + } + + BoolReply* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const BoolReply& from); + void MergeFrom(const BoolReply& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BoolReply* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .milvus.Status status = 1; + bool has_status() const; + void clear_status(); + static const int kStatusFieldNumber = 1; + const ::milvus::Status& status() const; + ::milvus::Status* release_status(); + ::milvus::Status* mutable_status(); + void set_allocated_status(::milvus::Status* status); + + // bool bool_reply = 2; + void clear_bool_reply(); + static const int kBoolReplyFieldNumber = 2; + bool bool_reply() const; + void set_bool_reply(bool value); + + // @@protoc_insertion_point(class_scope:milvus.grpc.BoolReply) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::milvus::Status* status_; + bool bool_reply_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class TableRowCount final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.TableRowCount) */ { + public: + TableRowCount(); + virtual ~TableRowCount(); + + TableRowCount(const TableRowCount& from); + + inline TableRowCount& operator=(const TableRowCount& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TableRowCount(TableRowCount&& from) noexcept + : TableRowCount() { + *this = ::std::move(from); + } + + inline TableRowCount& operator=(TableRowCount&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const TableRowCount& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TableRowCount* internal_default_instance() { + return reinterpret_cast( + &_TableRowCount_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + void Swap(TableRowCount* other); + friend void swap(TableRowCount& a, TableRowCount& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TableRowCount* New() const final { + return CreateMaybeMessage(nullptr); + } + + TableRowCount* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TableRowCount& from); + void MergeFrom(const TableRowCount& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TableRowCount* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .milvus.Status status = 1; + bool has_status() const; + void clear_status(); + static const int kStatusFieldNumber = 1; + const ::milvus::Status& status() const; + ::milvus::Status* release_status(); + ::milvus::Status* mutable_status(); + void set_allocated_status(::milvus::Status* status); + + // int64 table_row_count = 2; + void clear_table_row_count(); + static const int kTableRowCountFieldNumber = 2; + ::google::protobuf::int64 table_row_count() const; + void set_table_row_count(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:milvus.grpc.TableRowCount) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::milvus::Status* status_; + ::google::protobuf::int64 table_row_count_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class Command final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.Command) */ { + public: + Command(); + virtual ~Command(); + + Command(const Command& from); + + inline Command& operator=(const Command& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Command(Command&& from) noexcept + : Command() { + *this = ::std::move(from); + } + + inline Command& operator=(Command&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const Command& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Command* internal_default_instance() { + return reinterpret_cast( + &_Command_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + void Swap(Command* other); + friend void swap(Command& a, Command& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Command* New() const final { + return CreateMaybeMessage(nullptr); + } + + Command* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Command& from); + void MergeFrom(const Command& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Command* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string cmd = 1; + void clear_cmd(); + static const int kCmdFieldNumber = 1; + const ::std::string& cmd() const; + void set_cmd(const ::std::string& value); + #if LANG_CXX11 + void set_cmd(::std::string&& value); + #endif + void set_cmd(const char* value); + void set_cmd(const char* value, size_t size); + ::std::string* mutable_cmd(); + ::std::string* release_cmd(); + void set_allocated_cmd(::std::string* cmd); + + // @@protoc_insertion_point(class_scope:milvus.grpc.Command) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr cmd_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// ------------------------------------------------------------------- + +class ServerStatus final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.ServerStatus) */ { + public: + ServerStatus(); + virtual ~ServerStatus(); + + ServerStatus(const ServerStatus& from); + + inline ServerStatus& operator=(const ServerStatus& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ServerStatus(ServerStatus&& from) noexcept + : ServerStatus() { + *this = ::std::move(from); + } + + inline ServerStatus& operator=(ServerStatus&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const ServerStatus& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ServerStatus* internal_default_instance() { + return reinterpret_cast( + &_ServerStatus_default_instance_); + } + static constexpr int kIndexInFileMessages = + 14; + + void Swap(ServerStatus* other); + friend void swap(ServerStatus& a, ServerStatus& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ServerStatus* New() const final { + return CreateMaybeMessage(nullptr); + } + + ServerStatus* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ServerStatus& from); + void MergeFrom(const ServerStatus& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ServerStatus* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string info = 2; + void clear_info(); + static const int kInfoFieldNumber = 2; + const ::std::string& info() const; + void set_info(const ::std::string& value); + #if LANG_CXX11 + void set_info(::std::string&& value); + #endif + void set_info(const char* value); + void set_info(const char* value, size_t size); + ::std::string* mutable_info(); + ::std::string* release_info(); + void set_allocated_info(::std::string* info); + + // .milvus.Status status = 1; + bool has_status() const; + void clear_status(); + static const int kStatusFieldNumber = 1; + const ::milvus::Status& status() const; + ::milvus::Status* release_status(); + ::milvus::Status* mutable_status(); + void set_allocated_status(::milvus::Status* status); + + // @@protoc_insertion_point(class_scope:milvus.grpc.ServerStatus) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr info_; + ::milvus::Status* status_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_milvus_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TableName + +// .milvus.Status status = 1; +inline bool TableName::has_status() const { + return this != internal_default_instance() && status_ != nullptr; +} +inline const ::milvus::Status& TableName::status() const { + const ::milvus::Status* p = status_; + // @@protoc_insertion_point(field_get:milvus.grpc.TableName.status) + return p != nullptr ? *p : *reinterpret_cast( + &::milvus::_Status_default_instance_); +} +inline ::milvus::Status* TableName::release_status() { + // @@protoc_insertion_point(field_release:milvus.grpc.TableName.status) + + ::milvus::Status* temp = status_; + status_ = nullptr; + return temp; +} +inline ::milvus::Status* TableName::mutable_status() { + + if (status_ == nullptr) { + auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual()); + status_ = p; + } + // @@protoc_insertion_point(field_mutable:milvus.grpc.TableName.status) + return status_; +} +inline void TableName::set_allocated_status(::milvus::Status* status) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_); + } + if (status) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + status = ::google::protobuf::internal::GetOwnedMessage( + message_arena, status, submessage_arena); + } + + } else { + + } + status_ = status; + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.TableName.status) +} + +// string table_name = 2; +inline void TableName::clear_table_name() { + table_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& TableName::table_name() const { + // @@protoc_insertion_point(field_get:milvus.grpc.TableName.table_name) + return table_name_.GetNoArena(); +} +inline void TableName::set_table_name(const ::std::string& value) { + + table_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.grpc.TableName.table_name) +} +#if LANG_CXX11 +inline void TableName::set_table_name(::std::string&& value) { + + table_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.TableName.table_name) +} +#endif +inline void TableName::set_table_name(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + table_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.grpc.TableName.table_name) +} +inline void TableName::set_table_name(const char* value, size_t size) { + + table_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.TableName.table_name) +} +inline ::std::string* TableName::mutable_table_name() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.TableName.table_name) + return table_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* TableName::release_table_name() { + // @@protoc_insertion_point(field_release:milvus.grpc.TableName.table_name) + + return table_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void TableName::set_allocated_table_name(::std::string* table_name) { + if (table_name != nullptr) { + + } else { + + } + table_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), table_name); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.TableName.table_name) +} + +// ------------------------------------------------------------------- + +// TableSchema + +// .milvus.grpc.TableName table_name = 1; +inline bool TableSchema::has_table_name() const { + return this != internal_default_instance() && table_name_ != nullptr; +} +inline void TableSchema::clear_table_name() { + if (GetArenaNoVirtual() == nullptr && table_name_ != nullptr) { + delete table_name_; + } + table_name_ = nullptr; +} +inline const ::milvus::grpc::TableName& TableSchema::table_name() const { + const ::milvus::grpc::TableName* p = table_name_; + // @@protoc_insertion_point(field_get:milvus.grpc.TableSchema.table_name) + return p != nullptr ? *p : *reinterpret_cast( + &::milvus::grpc::_TableName_default_instance_); +} +inline ::milvus::grpc::TableName* TableSchema::release_table_name() { + // @@protoc_insertion_point(field_release:milvus.grpc.TableSchema.table_name) + + ::milvus::grpc::TableName* temp = table_name_; + table_name_ = nullptr; + return temp; +} +inline ::milvus::grpc::TableName* TableSchema::mutable_table_name() { + + if (table_name_ == nullptr) { + auto* p = CreateMaybeMessage<::milvus::grpc::TableName>(GetArenaNoVirtual()); + table_name_ = p; + } + // @@protoc_insertion_point(field_mutable:milvus.grpc.TableSchema.table_name) + return table_name_; +} +inline void TableSchema::set_allocated_table_name(::milvus::grpc::TableName* table_name) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete table_name_; + } + if (table_name) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + table_name = ::google::protobuf::internal::GetOwnedMessage( + message_arena, table_name, submessage_arena); + } + + } else { + + } + table_name_ = table_name; + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.TableSchema.table_name) +} + +// int32 index_type = 2; +inline void TableSchema::clear_index_type() { + index_type_ = 0; +} +inline ::google::protobuf::int32 TableSchema::index_type() const { + // @@protoc_insertion_point(field_get:milvus.grpc.TableSchema.index_type) + return index_type_; +} +inline void TableSchema::set_index_type(::google::protobuf::int32 value) { + + index_type_ = value; + // @@protoc_insertion_point(field_set:milvus.grpc.TableSchema.index_type) +} + +// int64 dimension = 3; +inline void TableSchema::clear_dimension() { + dimension_ = PROTOBUF_LONGLONG(0); +} +inline ::google::protobuf::int64 TableSchema::dimension() const { + // @@protoc_insertion_point(field_get:milvus.grpc.TableSchema.dimension) + return dimension_; +} +inline void TableSchema::set_dimension(::google::protobuf::int64 value) { + + dimension_ = value; + // @@protoc_insertion_point(field_set:milvus.grpc.TableSchema.dimension) +} + +// bool store_raw_vector = 4; +inline void TableSchema::clear_store_raw_vector() { + store_raw_vector_ = false; +} +inline bool TableSchema::store_raw_vector() const { + // @@protoc_insertion_point(field_get:milvus.grpc.TableSchema.store_raw_vector) + return store_raw_vector_; +} +inline void TableSchema::set_store_raw_vector(bool value) { + + store_raw_vector_ = value; + // @@protoc_insertion_point(field_set:milvus.grpc.TableSchema.store_raw_vector) +} + +// ------------------------------------------------------------------- + +// Range + +// string start_value = 1; +inline void Range::clear_start_value() { + start_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Range::start_value() const { + // @@protoc_insertion_point(field_get:milvus.grpc.Range.start_value) + return start_value_.GetNoArena(); +} +inline void Range::set_start_value(const ::std::string& value) { + + start_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.grpc.Range.start_value) +} +#if LANG_CXX11 +inline void Range::set_start_value(::std::string&& value) { + + start_value_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.Range.start_value) +} +#endif +inline void Range::set_start_value(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + start_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.grpc.Range.start_value) +} +inline void Range::set_start_value(const char* value, size_t size) { + + start_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.Range.start_value) +} +inline ::std::string* Range::mutable_start_value() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.Range.start_value) + return start_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Range::release_start_value() { + // @@protoc_insertion_point(field_release:milvus.grpc.Range.start_value) + + return start_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Range::set_allocated_start_value(::std::string* start_value) { + if (start_value != nullptr) { + + } else { + + } + start_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), start_value); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.Range.start_value) +} + +// string end_value = 2; +inline void Range::clear_end_value() { + end_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Range::end_value() const { + // @@protoc_insertion_point(field_get:milvus.grpc.Range.end_value) + return end_value_.GetNoArena(); +} +inline void Range::set_end_value(const ::std::string& value) { + + end_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.grpc.Range.end_value) +} +#if LANG_CXX11 +inline void Range::set_end_value(::std::string&& value) { + + end_value_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.Range.end_value) +} +#endif +inline void Range::set_end_value(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + end_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.grpc.Range.end_value) +} +inline void Range::set_end_value(const char* value, size_t size) { + + end_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.Range.end_value) +} +inline ::std::string* Range::mutable_end_value() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.Range.end_value) + return end_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Range::release_end_value() { + // @@protoc_insertion_point(field_release:milvus.grpc.Range.end_value) + + return end_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Range::set_allocated_end_value(::std::string* end_value) { + if (end_value != nullptr) { + + } else { + + } + end_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), end_value); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.Range.end_value) +} + +// ------------------------------------------------------------------- + +// RowRecord + +// repeated float vector_data = 1; +inline int RowRecord::vector_data_size() const { + return vector_data_.size(); +} +inline void RowRecord::clear_vector_data() { + vector_data_.Clear(); +} +inline float RowRecord::vector_data(int index) const { + // @@protoc_insertion_point(field_get:milvus.grpc.RowRecord.vector_data) + return vector_data_.Get(index); +} +inline void RowRecord::set_vector_data(int index, float value) { + vector_data_.Set(index, value); + // @@protoc_insertion_point(field_set:milvus.grpc.RowRecord.vector_data) +} +inline void RowRecord::add_vector_data(float value) { + vector_data_.Add(value); + // @@protoc_insertion_point(field_add:milvus.grpc.RowRecord.vector_data) +} +inline const ::google::protobuf::RepeatedField< float >& +RowRecord::vector_data() const { + // @@protoc_insertion_point(field_list:milvus.grpc.RowRecord.vector_data) + return vector_data_; +} +inline ::google::protobuf::RepeatedField< float >* +RowRecord::mutable_vector_data() { + // @@protoc_insertion_point(field_mutable_list:milvus.grpc.RowRecord.vector_data) + return &vector_data_; +} + +// ------------------------------------------------------------------- + +// InsertInfos + +// string table_name = 1; +inline void InsertInfos::clear_table_name() { + table_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& InsertInfos::table_name() const { + // @@protoc_insertion_point(field_get:milvus.grpc.InsertInfos.table_name) + return table_name_.GetNoArena(); +} +inline void InsertInfos::set_table_name(const ::std::string& value) { + + table_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.grpc.InsertInfos.table_name) +} +#if LANG_CXX11 +inline void InsertInfos::set_table_name(::std::string&& value) { + + table_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.InsertInfos.table_name) +} +#endif +inline void InsertInfos::set_table_name(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + table_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.grpc.InsertInfos.table_name) +} +inline void InsertInfos::set_table_name(const char* value, size_t size) { + + table_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.InsertInfos.table_name) +} +inline ::std::string* InsertInfos::mutable_table_name() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertInfos.table_name) + return table_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* InsertInfos::release_table_name() { + // @@protoc_insertion_point(field_release:milvus.grpc.InsertInfos.table_name) + + return table_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void InsertInfos::set_allocated_table_name(::std::string* table_name) { + if (table_name != nullptr) { + + } else { + + } + table_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), table_name); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.InsertInfos.table_name) +} + +// repeated .milvus.grpc.RowRecord row_record_array = 2; +inline int InsertInfos::row_record_array_size() const { + return row_record_array_.size(); +} +inline void InsertInfos::clear_row_record_array() { + row_record_array_.Clear(); +} +inline ::milvus::grpc::RowRecord* InsertInfos::mutable_row_record_array(int index) { + // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertInfos.row_record_array) + return row_record_array_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::milvus::grpc::RowRecord >* +InsertInfos::mutable_row_record_array() { + // @@protoc_insertion_point(field_mutable_list:milvus.grpc.InsertInfos.row_record_array) + return &row_record_array_; +} +inline const ::milvus::grpc::RowRecord& InsertInfos::row_record_array(int index) const { + // @@protoc_insertion_point(field_get:milvus.grpc.InsertInfos.row_record_array) + return row_record_array_.Get(index); +} +inline ::milvus::grpc::RowRecord* InsertInfos::add_row_record_array() { + // @@protoc_insertion_point(field_add:milvus.grpc.InsertInfos.row_record_array) + return row_record_array_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::milvus::grpc::RowRecord >& +InsertInfos::row_record_array() const { + // @@protoc_insertion_point(field_list:milvus.grpc.InsertInfos.row_record_array) + return row_record_array_; +} + +// ------------------------------------------------------------------- + +// VectorIds + +// .milvus.Status status = 1; +inline bool VectorIds::has_status() const { + return this != internal_default_instance() && status_ != nullptr; +} +inline const ::milvus::Status& VectorIds::status() const { + const ::milvus::Status* p = status_; + // @@protoc_insertion_point(field_get:milvus.grpc.VectorIds.status) + return p != nullptr ? *p : *reinterpret_cast( + &::milvus::_Status_default_instance_); +} +inline ::milvus::Status* VectorIds::release_status() { + // @@protoc_insertion_point(field_release:milvus.grpc.VectorIds.status) + + ::milvus::Status* temp = status_; + status_ = nullptr; + return temp; +} +inline ::milvus::Status* VectorIds::mutable_status() { + + if (status_ == nullptr) { + auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual()); + status_ = p; + } + // @@protoc_insertion_point(field_mutable:milvus.grpc.VectorIds.status) + return status_; +} +inline void VectorIds::set_allocated_status(::milvus::Status* status) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_); + } + if (status) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + status = ::google::protobuf::internal::GetOwnedMessage( + message_arena, status, submessage_arena); + } + + } else { + + } + status_ = status; + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.VectorIds.status) +} + +// repeated int64 vector_id_array = 2; +inline int VectorIds::vector_id_array_size() const { + return vector_id_array_.size(); +} +inline void VectorIds::clear_vector_id_array() { + vector_id_array_.Clear(); +} +inline ::google::protobuf::int64 VectorIds::vector_id_array(int index) const { + // @@protoc_insertion_point(field_get:milvus.grpc.VectorIds.vector_id_array) + return vector_id_array_.Get(index); +} +inline void VectorIds::set_vector_id_array(int index, ::google::protobuf::int64 value) { + vector_id_array_.Set(index, value); + // @@protoc_insertion_point(field_set:milvus.grpc.VectorIds.vector_id_array) +} +inline void VectorIds::add_vector_id_array(::google::protobuf::int64 value) { + vector_id_array_.Add(value); + // @@protoc_insertion_point(field_add:milvus.grpc.VectorIds.vector_id_array) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +VectorIds::vector_id_array() const { + // @@protoc_insertion_point(field_list:milvus.grpc.VectorIds.vector_id_array) + return vector_id_array_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +VectorIds::mutable_vector_id_array() { + // @@protoc_insertion_point(field_mutable_list:milvus.grpc.VectorIds.vector_id_array) + return &vector_id_array_; +} + +// ------------------------------------------------------------------- + +// SearchVectorInfos + +// string table_name = 1; +inline void SearchVectorInfos::clear_table_name() { + table_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& SearchVectorInfos::table_name() const { + // @@protoc_insertion_point(field_get:milvus.grpc.SearchVectorInfos.table_name) + return table_name_.GetNoArena(); +} +inline void SearchVectorInfos::set_table_name(const ::std::string& value) { + + table_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.grpc.SearchVectorInfos.table_name) +} +#if LANG_CXX11 +inline void SearchVectorInfos::set_table_name(::std::string&& value) { + + table_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.SearchVectorInfos.table_name) +} +#endif +inline void SearchVectorInfos::set_table_name(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + table_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchVectorInfos.table_name) +} +inline void SearchVectorInfos::set_table_name(const char* value, size_t size) { + + table_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchVectorInfos.table_name) +} +inline ::std::string* SearchVectorInfos::mutable_table_name() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchVectorInfos.table_name) + return table_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SearchVectorInfos::release_table_name() { + // @@protoc_insertion_point(field_release:milvus.grpc.SearchVectorInfos.table_name) + + return table_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SearchVectorInfos::set_allocated_table_name(::std::string* table_name) { + if (table_name != nullptr) { + + } else { + + } + table_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), table_name); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchVectorInfos.table_name) +} + +// repeated .milvus.grpc.RowRecord query_record_array = 2; +inline int SearchVectorInfos::query_record_array_size() const { + return query_record_array_.size(); +} +inline void SearchVectorInfos::clear_query_record_array() { + query_record_array_.Clear(); +} +inline ::milvus::grpc::RowRecord* SearchVectorInfos::mutable_query_record_array(int index) { + // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchVectorInfos.query_record_array) + return query_record_array_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::milvus::grpc::RowRecord >* +SearchVectorInfos::mutable_query_record_array() { + // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchVectorInfos.query_record_array) + return &query_record_array_; +} +inline const ::milvus::grpc::RowRecord& SearchVectorInfos::query_record_array(int index) const { + // @@protoc_insertion_point(field_get:milvus.grpc.SearchVectorInfos.query_record_array) + return query_record_array_.Get(index); +} +inline ::milvus::grpc::RowRecord* SearchVectorInfos::add_query_record_array() { + // @@protoc_insertion_point(field_add:milvus.grpc.SearchVectorInfos.query_record_array) + return query_record_array_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::milvus::grpc::RowRecord >& +SearchVectorInfos::query_record_array() const { + // @@protoc_insertion_point(field_list:milvus.grpc.SearchVectorInfos.query_record_array) + return query_record_array_; +} + +// repeated .milvus.grpc.Range query_range_array = 3; +inline int SearchVectorInfos::query_range_array_size() const { + return query_range_array_.size(); +} +inline void SearchVectorInfos::clear_query_range_array() { + query_range_array_.Clear(); +} +inline ::milvus::grpc::Range* SearchVectorInfos::mutable_query_range_array(int index) { + // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchVectorInfos.query_range_array) + return query_range_array_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::milvus::grpc::Range >* +SearchVectorInfos::mutable_query_range_array() { + // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchVectorInfos.query_range_array) + return &query_range_array_; +} +inline const ::milvus::grpc::Range& SearchVectorInfos::query_range_array(int index) const { + // @@protoc_insertion_point(field_get:milvus.grpc.SearchVectorInfos.query_range_array) + return query_range_array_.Get(index); +} +inline ::milvus::grpc::Range* SearchVectorInfos::add_query_range_array() { + // @@protoc_insertion_point(field_add:milvus.grpc.SearchVectorInfos.query_range_array) + return query_range_array_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::milvus::grpc::Range >& +SearchVectorInfos::query_range_array() const { + // @@protoc_insertion_point(field_list:milvus.grpc.SearchVectorInfos.query_range_array) + return query_range_array_; +} + +// int64 topk = 4; +inline void SearchVectorInfos::clear_topk() { + topk_ = PROTOBUF_LONGLONG(0); +} +inline ::google::protobuf::int64 SearchVectorInfos::topk() const { + // @@protoc_insertion_point(field_get:milvus.grpc.SearchVectorInfos.topk) + return topk_; +} +inline void SearchVectorInfos::set_topk(::google::protobuf::int64 value) { + + topk_ = value; + // @@protoc_insertion_point(field_set:milvus.grpc.SearchVectorInfos.topk) +} + +// ------------------------------------------------------------------- + +// SearchVectorInFilesInfos + +// repeated string file_id_array = 1; +inline int SearchVectorInFilesInfos::file_id_array_size() const { + return file_id_array_.size(); +} +inline void SearchVectorInFilesInfos::clear_file_id_array() { + file_id_array_.Clear(); +} +inline const ::std::string& SearchVectorInFilesInfos::file_id_array(int index) const { + // @@protoc_insertion_point(field_get:milvus.grpc.SearchVectorInFilesInfos.file_id_array) + return file_id_array_.Get(index); +} +inline ::std::string* SearchVectorInFilesInfos::mutable_file_id_array(int index) { + // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchVectorInFilesInfos.file_id_array) + return file_id_array_.Mutable(index); +} +inline void SearchVectorInFilesInfos::set_file_id_array(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:milvus.grpc.SearchVectorInFilesInfos.file_id_array) + file_id_array_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void SearchVectorInFilesInfos::set_file_id_array(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:milvus.grpc.SearchVectorInFilesInfos.file_id_array) + file_id_array_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void SearchVectorInFilesInfos::set_file_id_array(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + file_id_array_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchVectorInFilesInfos.file_id_array) +} +inline void SearchVectorInFilesInfos::set_file_id_array(int index, const char* value, size_t size) { + file_id_array_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchVectorInFilesInfos.file_id_array) +} +inline ::std::string* SearchVectorInFilesInfos::add_file_id_array() { + // @@protoc_insertion_point(field_add_mutable:milvus.grpc.SearchVectorInFilesInfos.file_id_array) + return file_id_array_.Add(); +} +inline void SearchVectorInFilesInfos::add_file_id_array(const ::std::string& value) { + file_id_array_.Add()->assign(value); + // @@protoc_insertion_point(field_add:milvus.grpc.SearchVectorInFilesInfos.file_id_array) +} +#if LANG_CXX11 +inline void SearchVectorInFilesInfos::add_file_id_array(::std::string&& value) { + file_id_array_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:milvus.grpc.SearchVectorInFilesInfos.file_id_array) +} +#endif +inline void SearchVectorInFilesInfos::add_file_id_array(const char* value) { + GOOGLE_DCHECK(value != nullptr); + file_id_array_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:milvus.grpc.SearchVectorInFilesInfos.file_id_array) +} +inline void SearchVectorInFilesInfos::add_file_id_array(const char* value, size_t size) { + file_id_array_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:milvus.grpc.SearchVectorInFilesInfos.file_id_array) +} +inline const ::google::protobuf::RepeatedPtrField<::std::string>& +SearchVectorInFilesInfos::file_id_array() const { + // @@protoc_insertion_point(field_list:milvus.grpc.SearchVectorInFilesInfos.file_id_array) + return file_id_array_; +} +inline ::google::protobuf::RepeatedPtrField<::std::string>* +SearchVectorInFilesInfos::mutable_file_id_array() { + // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchVectorInFilesInfos.file_id_array) + return &file_id_array_; +} + +// .milvus.grpc.SearchVectorInfos search_vector_infos = 2; +inline bool SearchVectorInFilesInfos::has_search_vector_infos() const { + return this != internal_default_instance() && search_vector_infos_ != nullptr; +} +inline void SearchVectorInFilesInfos::clear_search_vector_infos() { + if (GetArenaNoVirtual() == nullptr && search_vector_infos_ != nullptr) { + delete search_vector_infos_; + } + search_vector_infos_ = nullptr; +} +inline const ::milvus::grpc::SearchVectorInfos& SearchVectorInFilesInfos::search_vector_infos() const { + const ::milvus::grpc::SearchVectorInfos* p = search_vector_infos_; + // @@protoc_insertion_point(field_get:milvus.grpc.SearchVectorInFilesInfos.search_vector_infos) + return p != nullptr ? *p : *reinterpret_cast( + &::milvus::grpc::_SearchVectorInfos_default_instance_); +} +inline ::milvus::grpc::SearchVectorInfos* SearchVectorInFilesInfos::release_search_vector_infos() { + // @@protoc_insertion_point(field_release:milvus.grpc.SearchVectorInFilesInfos.search_vector_infos) + + ::milvus::grpc::SearchVectorInfos* temp = search_vector_infos_; + search_vector_infos_ = nullptr; + return temp; +} +inline ::milvus::grpc::SearchVectorInfos* SearchVectorInFilesInfos::mutable_search_vector_infos() { + + if (search_vector_infos_ == nullptr) { + auto* p = CreateMaybeMessage<::milvus::grpc::SearchVectorInfos>(GetArenaNoVirtual()); + search_vector_infos_ = p; + } + // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchVectorInFilesInfos.search_vector_infos) + return search_vector_infos_; +} +inline void SearchVectorInFilesInfos::set_allocated_search_vector_infos(::milvus::grpc::SearchVectorInfos* search_vector_infos) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete search_vector_infos_; + } + if (search_vector_infos) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + search_vector_infos = ::google::protobuf::internal::GetOwnedMessage( + message_arena, search_vector_infos, submessage_arena); + } + + } else { + + } + search_vector_infos_ = search_vector_infos; + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchVectorInFilesInfos.search_vector_infos) +} + +// ------------------------------------------------------------------- + +// QueryResult + +// int64 id = 1; +inline void QueryResult::clear_id() { + id_ = PROTOBUF_LONGLONG(0); +} +inline ::google::protobuf::int64 QueryResult::id() const { + // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.id) + return id_; +} +inline void QueryResult::set_id(::google::protobuf::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 + +// .milvus.Status status = 1; +inline bool TopKQueryResult::has_status() const { + return this != internal_default_instance() && status_ != nullptr; +} +inline const ::milvus::Status& TopKQueryResult::status() const { + const ::milvus::Status* p = status_; + // @@protoc_insertion_point(field_get:milvus.grpc.TopKQueryResult.status) + return p != nullptr ? *p : *reinterpret_cast( + &::milvus::_Status_default_instance_); +} +inline ::milvus::Status* TopKQueryResult::release_status() { + // @@protoc_insertion_point(field_release:milvus.grpc.TopKQueryResult.status) + + ::milvus::Status* temp = status_; + status_ = nullptr; + return temp; +} +inline ::milvus::Status* TopKQueryResult::mutable_status() { + + if (status_ == nullptr) { + auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual()); + status_ = p; + } + // @@protoc_insertion_point(field_mutable:milvus.grpc.TopKQueryResult.status) + return status_; +} +inline void TopKQueryResult::set_allocated_status(::milvus::Status* status) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_); + } + if (status) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + status = ::google::protobuf::internal::GetOwnedMessage( + message_arena, status, submessage_arena); + } + + } else { + + } + status_ = status; + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.TopKQueryResult.status) +} + +// repeated .milvus.grpc.QueryResult query_result_arrays = 2; +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 ::google::protobuf::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 ::google::protobuf::RepeatedPtrField< ::milvus::grpc::QueryResult >& +TopKQueryResult::query_result_arrays() const { + // @@protoc_insertion_point(field_list:milvus.grpc.TopKQueryResult.query_result_arrays) + return query_result_arrays_; +} + +// ------------------------------------------------------------------- + +// StringReply + +// .milvus.Status status = 1; +inline bool StringReply::has_status() const { + return this != internal_default_instance() && status_ != nullptr; +} +inline const ::milvus::Status& StringReply::status() const { + const ::milvus::Status* p = status_; + // @@protoc_insertion_point(field_get:milvus.grpc.StringReply.status) + return p != nullptr ? *p : *reinterpret_cast( + &::milvus::_Status_default_instance_); +} +inline ::milvus::Status* StringReply::release_status() { + // @@protoc_insertion_point(field_release:milvus.grpc.StringReply.status) + + ::milvus::Status* temp = status_; + status_ = nullptr; + return temp; +} +inline ::milvus::Status* StringReply::mutable_status() { + + if (status_ == nullptr) { + auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual()); + status_ = p; + } + // @@protoc_insertion_point(field_mutable:milvus.grpc.StringReply.status) + return status_; +} +inline void StringReply::set_allocated_status(::milvus::Status* status) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_); + } + if (status) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + status = ::google::protobuf::internal::GetOwnedMessage( + message_arena, status, submessage_arena); + } + + } else { + + } + status_ = status; + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.StringReply.status) +} + +// string string_reply = 2; +inline void StringReply::clear_string_reply() { + string_reply_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& StringReply::string_reply() const { + // @@protoc_insertion_point(field_get:milvus.grpc.StringReply.string_reply) + return string_reply_.GetNoArena(); +} +inline void StringReply::set_string_reply(const ::std::string& value) { + + string_reply_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.grpc.StringReply.string_reply) +} +#if LANG_CXX11 +inline void StringReply::set_string_reply(::std::string&& value) { + + string_reply_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.StringReply.string_reply) +} +#endif +inline void StringReply::set_string_reply(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + string_reply_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.grpc.StringReply.string_reply) +} +inline void StringReply::set_string_reply(const char* value, size_t size) { + + string_reply_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.StringReply.string_reply) +} +inline ::std::string* StringReply::mutable_string_reply() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.StringReply.string_reply) + return string_reply_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* StringReply::release_string_reply() { + // @@protoc_insertion_point(field_release:milvus.grpc.StringReply.string_reply) + + return string_reply_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void StringReply::set_allocated_string_reply(::std::string* string_reply) { + if (string_reply != nullptr) { + + } else { + + } + string_reply_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_reply); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.StringReply.string_reply) +} + +// ------------------------------------------------------------------- + +// BoolReply + +// .milvus.Status status = 1; +inline bool BoolReply::has_status() const { + return this != internal_default_instance() && status_ != nullptr; +} +inline const ::milvus::Status& BoolReply::status() const { + const ::milvus::Status* p = status_; + // @@protoc_insertion_point(field_get:milvus.grpc.BoolReply.status) + return p != nullptr ? *p : *reinterpret_cast( + &::milvus::_Status_default_instance_); +} +inline ::milvus::Status* BoolReply::release_status() { + // @@protoc_insertion_point(field_release:milvus.grpc.BoolReply.status) + + ::milvus::Status* temp = status_; + status_ = nullptr; + return temp; +} +inline ::milvus::Status* BoolReply::mutable_status() { + + if (status_ == nullptr) { + auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual()); + status_ = p; + } + // @@protoc_insertion_point(field_mutable:milvus.grpc.BoolReply.status) + return status_; +} +inline void BoolReply::set_allocated_status(::milvus::Status* status) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_); + } + if (status) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + status = ::google::protobuf::internal::GetOwnedMessage( + message_arena, status, submessage_arena); + } + + } else { + + } + status_ = status; + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.BoolReply.status) +} + +// bool bool_reply = 2; +inline void BoolReply::clear_bool_reply() { + bool_reply_ = false; +} +inline bool BoolReply::bool_reply() const { + // @@protoc_insertion_point(field_get:milvus.grpc.BoolReply.bool_reply) + return bool_reply_; +} +inline void BoolReply::set_bool_reply(bool value) { + + bool_reply_ = value; + // @@protoc_insertion_point(field_set:milvus.grpc.BoolReply.bool_reply) +} + +// ------------------------------------------------------------------- + +// TableRowCount + +// .milvus.Status status = 1; +inline bool TableRowCount::has_status() const { + return this != internal_default_instance() && status_ != nullptr; +} +inline const ::milvus::Status& TableRowCount::status() const { + const ::milvus::Status* p = status_; + // @@protoc_insertion_point(field_get:milvus.grpc.TableRowCount.status) + return p != nullptr ? *p : *reinterpret_cast( + &::milvus::_Status_default_instance_); +} +inline ::milvus::Status* TableRowCount::release_status() { + // @@protoc_insertion_point(field_release:milvus.grpc.TableRowCount.status) + + ::milvus::Status* temp = status_; + status_ = nullptr; + return temp; +} +inline ::milvus::Status* TableRowCount::mutable_status() { + + if (status_ == nullptr) { + auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual()); + status_ = p; + } + // @@protoc_insertion_point(field_mutable:milvus.grpc.TableRowCount.status) + return status_; +} +inline void TableRowCount::set_allocated_status(::milvus::Status* status) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_); + } + if (status) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + status = ::google::protobuf::internal::GetOwnedMessage( + message_arena, status, submessage_arena); + } + + } else { + + } + status_ = status; + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.TableRowCount.status) +} + +// int64 table_row_count = 2; +inline void TableRowCount::clear_table_row_count() { + table_row_count_ = PROTOBUF_LONGLONG(0); +} +inline ::google::protobuf::int64 TableRowCount::table_row_count() const { + // @@protoc_insertion_point(field_get:milvus.grpc.TableRowCount.table_row_count) + return table_row_count_; +} +inline void TableRowCount::set_table_row_count(::google::protobuf::int64 value) { + + table_row_count_ = value; + // @@protoc_insertion_point(field_set:milvus.grpc.TableRowCount.table_row_count) +} + +// ------------------------------------------------------------------- + +// Command + +// string cmd = 1; +inline void Command::clear_cmd() { + cmd_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Command::cmd() const { + // @@protoc_insertion_point(field_get:milvus.grpc.Command.cmd) + return cmd_.GetNoArena(); +} +inline void Command::set_cmd(const ::std::string& value) { + + cmd_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.grpc.Command.cmd) +} +#if LANG_CXX11 +inline void Command::set_cmd(::std::string&& value) { + + cmd_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.Command.cmd) +} +#endif +inline void Command::set_cmd(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + cmd_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.grpc.Command.cmd) +} +inline void Command::set_cmd(const char* value, size_t size) { + + cmd_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.Command.cmd) +} +inline ::std::string* Command::mutable_cmd() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.Command.cmd) + return cmd_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Command::release_cmd() { + // @@protoc_insertion_point(field_release:milvus.grpc.Command.cmd) + + return cmd_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Command::set_allocated_cmd(::std::string* cmd) { + if (cmd != nullptr) { + + } else { + + } + cmd_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), cmd); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.Command.cmd) +} + +// ------------------------------------------------------------------- + +// ServerStatus + +// .milvus.Status status = 1; +inline bool ServerStatus::has_status() const { + return this != internal_default_instance() && status_ != nullptr; +} +inline const ::milvus::Status& ServerStatus::status() const { + const ::milvus::Status* p = status_; + // @@protoc_insertion_point(field_get:milvus.grpc.ServerStatus.status) + return p != nullptr ? *p : *reinterpret_cast( + &::milvus::_Status_default_instance_); +} +inline ::milvus::Status* ServerStatus::release_status() { + // @@protoc_insertion_point(field_release:milvus.grpc.ServerStatus.status) + + ::milvus::Status* temp = status_; + status_ = nullptr; + return temp; +} +inline ::milvus::Status* ServerStatus::mutable_status() { + + if (status_ == nullptr) { + auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual()); + status_ = p; + } + // @@protoc_insertion_point(field_mutable:milvus.grpc.ServerStatus.status) + return status_; +} +inline void ServerStatus::set_allocated_status(::milvus::Status* status) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_); + } + if (status) { + ::google::protobuf::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + status = ::google::protobuf::internal::GetOwnedMessage( + message_arena, status, submessage_arena); + } + + } else { + + } + status_ = status; + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.ServerStatus.status) +} + +// string info = 2; +inline void ServerStatus::clear_info() { + info_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ServerStatus::info() const { + // @@protoc_insertion_point(field_get:milvus.grpc.ServerStatus.info) + return info_.GetNoArena(); +} +inline void ServerStatus::set_info(const ::std::string& value) { + + info_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.grpc.ServerStatus.info) +} +#if LANG_CXX11 +inline void ServerStatus::set_info(::std::string&& value) { + + info_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.ServerStatus.info) +} +#endif +inline void ServerStatus::set_info(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + info_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.grpc.ServerStatus.info) +} +inline void ServerStatus::set_info(const char* value, size_t size) { + + info_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.ServerStatus.info) +} +inline ::std::string* ServerStatus::mutable_info() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.ServerStatus.info) + return info_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ServerStatus::release_info() { + // @@protoc_insertion_point(field_release:milvus.grpc.ServerStatus.info) + + return info_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ServerStatus::set_allocated_info(::std::string* info) { + if (info != nullptr) { + + } else { + + } + info_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), info); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.ServerStatus.info) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace grpc +} // namespace milvus + +// @@protoc_insertion_point(global_scope) + +#include +#endif // PROTOBUF_INCLUDED_milvus_2eproto diff --git a/cpp/src/grpc/gen-status/status.grpc.pb.cc b/cpp/src/grpc/gen-status/status.grpc.pb.cc new file mode 100644 index 0000000000..2e8c230b82 --- /dev/null +++ b/cpp/src/grpc/gen-status/status.grpc.pb.cc @@ -0,0 +1,22 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: status.proto + +#include "status.pb.h" +#include "status.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace milvus { + +} // namespace milvus + diff --git a/cpp/src/grpc/gen-status/status.grpc.pb.h b/cpp/src/grpc/gen-status/status.grpc.pb.h new file mode 100644 index 0000000000..81831c6f2a --- /dev/null +++ b/cpp/src/grpc/gen-status/status.grpc.pb.h @@ -0,0 +1,35 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: status.proto +#ifndef GRPC_status_2eproto__INCLUDED +#define GRPC_status_2eproto__INCLUDED + +#include "status.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc { +class CompletionQueue; +class Channel; +class ServerCompletionQueue; +class ServerContext; +} // namespace grpc + +namespace milvus { + +} // namespace milvus + + +#endif // GRPC_status_2eproto__INCLUDED diff --git a/cpp/src/grpc/gen-status/status.pb.cc b/cpp/src/grpc/gen-status/status.pb.cc new file mode 100644 index 0000000000..b213dbb062 --- /dev/null +++ b/cpp/src/grpc/gen-status/status.pb.cc @@ -0,0 +1,494 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: status.proto + +#include "status.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +namespace milvus { +class StatusDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _Status_default_instance_; +} // namespace milvus +static void InitDefaultsStatus_status_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::_Status_default_instance_; + new (ptr) ::milvus::Status(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::Status::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Status_status_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsStatus_status_2eproto}, {}}; + +void InitDefaults_status_2eproto() { + ::google::protobuf::internal::InitSCC(&scc_info_Status_status_2eproto.base); +} + +::google::protobuf::Metadata file_level_metadata_status_2eproto[1]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors_status_2eproto[1]; +constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_status_2eproto = nullptr; + +const ::google::protobuf::uint32 TableStruct_status_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::Status, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::Status, error_code_), + PROTOBUF_FIELD_OFFSET(::milvus::Status, reason_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::milvus::Status)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::milvus::_Status_default_instance_), +}; + +::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_status_2eproto = { + {}, AddDescriptors_status_2eproto, "status.proto", schemas, + file_default_instances, TableStruct_status_2eproto::offsets, + file_level_metadata_status_2eproto, 1, file_level_enum_descriptors_status_2eproto, file_level_service_descriptors_status_2eproto, +}; + +const char descriptor_table_protodef_status_2eproto[] = + "\n\014status.proto\022\006milvus\"\?\n\006Status\022%\n\nerro" + "r_code\030\001 \001(\0162\021.milvus.ErrorCode\022\016\n\006reaso" + "n\030\002 \001(\t*\354\003\n\tErrorCode\022\013\n\007SUCCESS\020\000\022\024\n\020UN" + "EXPECTED_ERROR\020\001\022\022\n\016CONNECT_FAILED\020\002\022\025\n\021" + "PERMISSION_DENIED\020\003\022\024\n\020TABLE_NOT_EXISTS\020" + "\004\022\024\n\020ILLEGAL_ARGUMENT\020\005\022\021\n\rILLEGAL_RANGE" + "\020\006\022\025\n\021ILLEGAL_DIMENSION\020\007\022\026\n\022ILLEGAL_IND" + "EX_TYPE\020\010\022\026\n\022ILLEGAL_TABLE_NAME\020\t\022\020\n\014ILL" + "EGAL_TOPK\020\n\022\025\n\021ILLEGAL_ROWRECORD\020\013\022\025\n\021IL" + "LEGAL_VECTOR_ID\020\014\022\031\n\025ILLEGAL_SEARCH_RESU" + "LT\020\r\022\022\n\016FILE_NOT_FOUND\020\016\022\017\n\013META_FAILED\020" + "\017\022\020\n\014CACHE_FAILED\020\020\022\030\n\024CANNOT_CREATE_FOL" + "DER\020\021\022\026\n\022CANNOT_CREATE_FILE\020\022\022\030\n\024CANNOT_" + "DELETE_FOLDER\020\023\022\026\n\022CANNOT_DELETE_FILE\020\024\022" + "\025\n\021BUILD_INDEX_ERROR\020\025b\006proto3" + ; +::google::protobuf::internal::DescriptorTable descriptor_table_status_2eproto = { + false, InitDefaults_status_2eproto, + descriptor_table_protodef_status_2eproto, + "status.proto", &assign_descriptors_table_status_2eproto, 590, +}; + +void AddDescriptors_status_2eproto() { + static constexpr ::google::protobuf::internal::InitFunc deps[1] = + { + }; + ::google::protobuf::internal::AddDescriptors(&descriptor_table_status_2eproto, deps, 0); +} + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_status_2eproto = []() { AddDescriptors_status_2eproto(); return true; }(); +namespace milvus { +const ::google::protobuf::EnumDescriptor* ErrorCode_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&assign_descriptors_table_status_2eproto); + return file_level_enum_descriptors_status_2eproto[0]; +} +bool ErrorCode_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + return true; + default: + return false; + } +} + + +// =================================================================== + +void Status::InitAsDefaultInstance() { +} +class Status::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Status::kErrorCodeFieldNumber; +const int Status::kReasonFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Status::Status() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.Status) +} +Status::Status(const Status& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + reason_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.reason().size() > 0) { + reason_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.reason_); + } + error_code_ = from.error_code_; + // @@protoc_insertion_point(copy_constructor:milvus.Status) +} + +void Status::SharedCtor() { + ::google::protobuf::internal::InitSCC( + &scc_info_Status_status_2eproto.base); + reason_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + error_code_ = 0; +} + +Status::~Status() { + // @@protoc_insertion_point(destructor:milvus.Status) + SharedDtor(); +} + +void Status::SharedDtor() { + reason_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Status::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Status& Status::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_Status_status_2eproto.base); + return *internal_default_instance(); +} + + +void Status::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.Status) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + reason_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + error_code_ = 0; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Status::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // .milvus.ErrorCode error_code = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 8) goto handle_unusual; + ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr); + msg->set_error_code(static_cast<::milvus::ErrorCode>(val)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // string reason = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual; + ptr = ::google::protobuf::io::ReadSize(ptr, &size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ctx->extra_parse_data().SetFieldName("milvus.Status.reason"); + object = msg->mutable_reason(); + if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) { + parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8; + goto string_till_end; + } + GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx)); + ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx); + ptr += size; + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +string_till_end: + static_cast<::std::string*>(object)->clear(); + static_cast<::std::string*>(object)->reserve(size); + goto len_delim_till_end; +len_delim_till_end: + return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, + {parser_till_end, object}, size); +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool Status::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.Status) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .milvus.ErrorCode error_code = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (8 & 0xFF)) { + int value = 0; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_error_code(static_cast< ::milvus::ErrorCode >(value)); + } else { + goto handle_unusual; + } + break; + } + + // string reason = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_reason())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->reason().data(), static_cast(this->reason().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "milvus.Status.reason")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.Status) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.Status) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Status::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.Status) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.ErrorCode error_code = 1; + if (this->error_code() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->error_code(), output); + } + + // string reason = 2; + if (this->reason().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->reason().data(), static_cast(this->reason().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.Status.reason"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->reason(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.Status) +} + +::google::protobuf::uint8* Status::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.Status) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .milvus.ErrorCode error_code = 1; + if (this->error_code() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->error_code(), target); + } + + // string reason = 2; + if (this->reason().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->reason().data(), static_cast(this->reason().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "milvus.Status.reason"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->reason(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.Status) + return target; +} + +size_t Status::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.Status) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string reason = 2; + if (this->reason().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->reason()); + } + + // .milvus.ErrorCode error_code = 1; + if (this->error_code() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->error_code()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Status::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.Status) + GOOGLE_DCHECK_NE(&from, this); + const Status* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.Status) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.Status) + MergeFrom(*source); + } +} + +void Status::MergeFrom(const Status& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.Status) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.reason().size() > 0) { + + reason_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.reason_); + } + if (from.error_code() != 0) { + set_error_code(from.error_code()); + } +} + +void Status::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.Status) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Status::CopyFrom(const Status& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.Status) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Status::IsInitialized() const { + return true; +} + +void Status::Swap(Status* other) { + if (other == this) return; + InternalSwap(other); +} +void Status::InternalSwap(Status* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + reason_.Swap(&other->reason_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(error_code_, other->error_code_); +} + +::google::protobuf::Metadata Status::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_status_2eproto); + return ::file_level_metadata_status_2eproto[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace milvus +namespace google { +namespace protobuf { +template<> PROTOBUF_NOINLINE ::milvus::Status* Arena::CreateMaybeMessage< ::milvus::Status >(Arena* arena) { + return Arena::CreateInternal< ::milvus::Status >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) +#include diff --git a/cpp/src/grpc/gen-status/status.pb.h b/cpp/src/grpc/gen-status/status.pb.h new file mode 100644 index 0000000000..5ff3d740c4 --- /dev/null +++ b/cpp/src/grpc/gen-status/status.pb.h @@ -0,0 +1,333 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: status.proto + +#ifndef PROTOBUF_INCLUDED_status_2eproto +#define PROTOBUF_INCLUDED_status_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3007000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_status_2eproto + +// Internal implementation detail -- do not use these members. +struct TableStruct_status_2eproto { + static const ::google::protobuf::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::ParseTable schema[1] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors_status_2eproto(); +namespace milvus { +class Status; +class StatusDefaultTypeInternal; +extern StatusDefaultTypeInternal _Status_default_instance_; +} // namespace milvus +namespace google { +namespace protobuf { +template<> ::milvus::Status* Arena::CreateMaybeMessage<::milvus::Status>(Arena*); +} // namespace protobuf +} // namespace google +namespace milvus { + +enum ErrorCode { + SUCCESS = 0, + UNEXPECTED_ERROR = 1, + CONNECT_FAILED = 2, + PERMISSION_DENIED = 3, + TABLE_NOT_EXISTS = 4, + ILLEGAL_ARGUMENT = 5, + ILLEGAL_RANGE = 6, + ILLEGAL_DIMENSION = 7, + ILLEGAL_INDEX_TYPE = 8, + ILLEGAL_TABLE_NAME = 9, + ILLEGAL_TOPK = 10, + ILLEGAL_ROWRECORD = 11, + ILLEGAL_VECTOR_ID = 12, + ILLEGAL_SEARCH_RESULT = 13, + FILE_NOT_FOUND = 14, + META_FAILED = 15, + CACHE_FAILED = 16, + CANNOT_CREATE_FOLDER = 17, + CANNOT_CREATE_FILE = 18, + CANNOT_DELETE_FOLDER = 19, + CANNOT_DELETE_FILE = 20, + BUILD_INDEX_ERROR = 21, + ErrorCode_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::min(), + ErrorCode_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::max() +}; +bool ErrorCode_IsValid(int value); +const ErrorCode ErrorCode_MIN = SUCCESS; +const ErrorCode ErrorCode_MAX = BUILD_INDEX_ERROR; +const int ErrorCode_ARRAYSIZE = ErrorCode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* ErrorCode_descriptor(); +inline const ::std::string& ErrorCode_Name(ErrorCode value) { + return ::google::protobuf::internal::NameOfEnum( + ErrorCode_descriptor(), value); +} +inline bool ErrorCode_Parse( + const ::std::string& name, ErrorCode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + ErrorCode_descriptor(), name, value); +} +// =================================================================== + +class Status final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.Status) */ { + public: + Status(); + virtual ~Status(); + + Status(const Status& from); + + inline Status& operator=(const Status& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Status(Status&& from) noexcept + : Status() { + *this = ::std::move(from); + } + + inline Status& operator=(Status&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const Status& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Status* internal_default_instance() { + return reinterpret_cast( + &_Status_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Status* other); + friend void swap(Status& a, Status& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Status* New() const final { + return CreateMaybeMessage(nullptr); + } + + Status* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Status& from); + void MergeFrom(const Status& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Status* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string reason = 2; + void clear_reason(); + static const int kReasonFieldNumber = 2; + const ::std::string& reason() const; + void set_reason(const ::std::string& value); + #if LANG_CXX11 + void set_reason(::std::string&& value); + #endif + void set_reason(const char* value); + void set_reason(const char* value, size_t size); + ::std::string* mutable_reason(); + ::std::string* release_reason(); + void set_allocated_reason(::std::string* reason); + + // .milvus.ErrorCode error_code = 1; + void clear_error_code(); + static const int kErrorCodeFieldNumber = 1; + ::milvus::ErrorCode error_code() const; + void set_error_code(::milvus::ErrorCode value); + + // @@protoc_insertion_point(class_scope:milvus.Status) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr reason_; + int error_code_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_status_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Status + +// .milvus.ErrorCode error_code = 1; +inline void Status::clear_error_code() { + error_code_ = 0; +} +inline ::milvus::ErrorCode Status::error_code() const { + // @@protoc_insertion_point(field_get:milvus.Status.error_code) + return static_cast< ::milvus::ErrorCode >(error_code_); +} +inline void Status::set_error_code(::milvus::ErrorCode value) { + + error_code_ = value; + // @@protoc_insertion_point(field_set:milvus.Status.error_code) +} + +// string reason = 2; +inline void Status::clear_reason() { + reason_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Status::reason() const { + // @@protoc_insertion_point(field_get:milvus.Status.reason) + return reason_.GetNoArena(); +} +inline void Status::set_reason(const ::std::string& value) { + + reason_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.Status.reason) +} +#if LANG_CXX11 +inline void Status::set_reason(::std::string&& value) { + + reason_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.Status.reason) +} +#endif +inline void Status::set_reason(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + reason_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.Status.reason) +} +inline void Status::set_reason(const char* value, size_t size) { + + reason_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.Status.reason) +} +inline ::std::string* Status::mutable_reason() { + + // @@protoc_insertion_point(field_mutable:milvus.Status.reason) + return reason_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Status::release_reason() { + // @@protoc_insertion_point(field_release:milvus.Status.reason) + + return reason_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Status::set_allocated_reason(::std::string* reason) { + if (reason != nullptr) { + + } else { + + } + reason_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), reason); + // @@protoc_insertion_point(field_set_allocated:milvus.Status.reason) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace milvus + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::milvus::ErrorCode> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::milvus::ErrorCode>() { + return ::milvus::ErrorCode_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#include +#endif // PROTOBUF_INCLUDED_status_2eproto diff --git a/cpp/src/grpc/milvus.proto b/cpp/src/grpc/milvus.proto new file mode 100644 index 0000000000..d81a286789 --- /dev/null +++ b/cpp/src/grpc/milvus.proto @@ -0,0 +1,250 @@ +syntax = "proto3"; + +import "status.proto"; + +package milvus.grpc; + +/** + * @brief Table Name + */ +message TableName { + milvus.Status status = 1; + string table_name = 2; +} + +/** + * @brief Table Schema + */ +message TableSchema { + TableName table_name = 1; + int32 index_type = 2; + int64 dimension = 3; + bool store_raw_vector = 4; +} + +/** + * @brief Range Schema + */ +message Range { + string start_value = 1; + string end_value = 2; +} + +/** + * @brief Record inserted + */ +message RowRecord { + repeated float vector_data = 1; //binary in thrift +} + +/** + * @brief Infos to be inserted + */ +message InsertInfos { + string table_name = 1; + repeated RowRecord row_record_array = 2; +} + +/** + * @brief Vector ids + */ +message VectorIds { + milvus.Status status = 1; + repeated int64 vector_id_array = 2; +} + +/** + * @brief Infos for searching vector + */ +message SearchVectorInfos { + string table_name = 1; + repeated RowRecord query_record_array = 2; + repeated Range query_range_array = 3; + int64 topk = 4; +} + +/** + * @brief Infos for searching vector in files + */ +message SearchVectorInFilesInfos { + repeated string file_id_array = 1; + SearchVectorInfos search_vector_infos = 2; +} + +/** + * @brief Query result infos + */ +message QueryResult { + int64 id = 1; + double distance = 2; +} + +/** + * @brief TopK query result + */ +message TopKQueryResult { + milvus.Status status = 1; + repeated QueryResult query_result_arrays = 2; +} + +/** + * @brief Server String Reply + */ +message StringReply { + milvus.Status status = 1; + string string_reply = 2; +} + +/** + * @brief Server bool Reply + */ +message BoolReply { + milvus.Status status = 1; + bool bool_reply = 2; +} + +/** + * @brief Return table row count + */ +message TableRowCount { + milvus.Status status = 1; + int64 table_row_count = 2; +} + +/** + * @brief Give Server Command + */ +message Command { + string cmd = 1; +} + +/** + * @brief Give Server Command + */ +message ServerStatus{ + milvus.Status status = 1; + string info = 2; +} + +service MilvusService { + /** + * @brief Create table method + * + * This method is used to create table + * + * @param param, use to provide table information to be created. + * + */ + rpc CreateTable(TableSchema) returns (milvus.Status){} + + /** + * @brief Test table existence method + * + * This method is used to test table existence. + * + * @param table_name, table name is going to be tested. + * + */ + rpc HasTable(TableName) returns (BoolReply) {} + + /** + * @brief Delete table method + * + * This method is used to delete table. + * + * @param table_name, table name is going to be deleted. + * + */ + rpc DropTable(TableName) returns (milvus.Status) {} + + /** + * @brief Build index by table method + * + * This method is used to build index by table in sync mode. + * + * @param table_name, table is going to be built index. + * + */ + rpc BuildIndex(TableName) returns (milvus.Status) {} + + /** + * @brief Add vector array to table + * + * This method is used to add vector array to table. + * + * @param table_name, table_name is inserted. + * @param record_array, vector array is inserted. + * + * @return vector id array + */ + rpc InsertVector(InsertInfos) returns (VectorIds) {} + + /** + * @brief Query vector + * + * This method is used to query vector in table. + * + * @param table_name, table_name is queried. + * @param query_record_array, all vector are going to be queried. + * @param query_range_array, optional ranges for conditional search. If not specified, search whole table + * @param topk, how many similarity vectors will be searched. + * + * @return query result array. + */ + rpc SearchVector(SearchVectorInfos) returns (stream TopKQueryResult) {} + + /** + * @brief Internal use query interface + * + * This method is used to query vector in specified files. + * + * @param file_id_array, specified files id array, queried. + * @param query_record_array, all vector are going to be queried. + * @param query_range_array, optional ranges for conditional search. If not specified, search whole table + * @param topk, how many similarity vectors will be searched. + * + * @return query result array. + */ + rpc SearchVectorInFiles(SearchVectorInFilesInfos) returns (stream TopKQueryResult) {} + + /** + * @brief Get table schema + * + * This method is used to get table schema. + * + * @param table_name, target table name. + * + * @return table schema + */ + rpc DescribeTable(TableName) returns (TableSchema) {} + + /** + * @brief Get table schema + * + * This method is used to get table schema. + * + * @param table_name, target table name. + * + * @return table schema + */ + rpc GetTableRowCount(TableName) returns (TableRowCount) {} + + /** + * @brief List all tables in database + * + * This method is used to list all tables. + * + * + * @return table names. + */ + rpc ShowTables(Command) returns (stream TableName) {} + + /** + * @brief Give the server status + * + * This method is used to give the server status. + * + * @return Server status. + */ + rpc Ping(Command) returns (ServerStatus) {} +} diff --git a/cpp/src/grpc/status.proto b/cpp/src/grpc/status.proto new file mode 100644 index 0000000000..6502f841b9 --- /dev/null +++ b/cpp/src/grpc/status.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package milvus; + +enum ErrorCode { + SUCCESS = 0; + UNEXPECTED_ERROR = 1; + CONNECT_FAILED = 2; + PERMISSION_DENIED = 3; + TABLE_NOT_EXISTS = 4; + ILLEGAL_ARGUMENT = 5; + ILLEGAL_RANGE = 6; + ILLEGAL_DIMENSION = 7; + ILLEGAL_INDEX_TYPE = 8; + ILLEGAL_TABLE_NAME = 9; + ILLEGAL_TOPK = 10; + ILLEGAL_ROWRECORD = 11; + ILLEGAL_VECTOR_ID = 12; + ILLEGAL_SEARCH_RESULT = 13; + FILE_NOT_FOUND = 14; + META_FAILED = 15; + CACHE_FAILED = 16; + CANNOT_CREATE_FOLDER = 17; + CANNOT_CREATE_FILE = 18; + CANNOT_DELETE_FOLDER = 19; + CANNOT_DELETE_FILE = 20; + BUILD_INDEX_ERROR = 21; +} + +message Status { + ErrorCode error_code = 1; + string reason = 2; +} \ No newline at end of file diff --git a/cpp/src/grpcsdk/CMakeLists.txt b/cpp/src/grpcsdk/CMakeLists.txt new file mode 100644 index 0000000000..2facdf28fa --- /dev/null +++ b/cpp/src/grpcsdk/CMakeLists.txt @@ -0,0 +1,38 @@ +#------------------------------------------------------------------------------- +# Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +# Unauthorized copying of this file, via any medium is strictly prohibited. +# Proprietary and confidential. +#------------------------------------------------------------------------------- + +aux_source_directory(src/interface interface_files) +aux_source_directory(src/client client_files) +aux_source_directory(src/util util_files) + +include_directories(src) +include_directories(include) +include_directories(/usr/include) +include_directories(${CMAKE_SOURCE_DIR}/src/grpc/gen-milvus) +include_directories(${CMAKE_SOURCE_DIR}/src/grpc/gen-status) +include_directories(/usr/local/include) + +set(service_files + ${CMAKE_SOURCE_DIR}/src/grpc/gen-milvus/milvus.grpc.pb.cc + ${CMAKE_SOURCE_DIR}/src/grpc/gen-milvus/milvus.pb.cc + ${CMAKE_SOURCE_DIR}/src/grpc/gen-status/status.grpc.pb.cc + ${CMAKE_SOURCE_DIR}/src/grpc/gen-status/status.pb.cc + ) + +add_library(milvus_grpc_sdk STATIC + ${interface_files} + ${client_files} + ${util_files} + ${service_files} + ) + +target_link_libraries(milvus_grpc_sdk + ${third_party_libs} + ) + +add_subdirectory(examples) + +install(TARGETS milvus_grpc_sdk DESTINATION lib) diff --git a/cpp/src/grpcsdk/examples/CMakeLists.txt b/cpp/src/grpcsdk/examples/CMakeLists.txt new file mode 100644 index 0000000000..6c4b9f0912 --- /dev/null +++ b/cpp/src/grpcsdk/examples/CMakeLists.txt @@ -0,0 +1,24 @@ +#------------------------------------------------------------------------------- +# Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +# Unauthorized copying of this file, via any medium is strictly prohibited. +# Proprietary and confidential. +#------------------------------------------------------------------------------- + +aux_source_directory(src src_files) + +include_directories(src) +include_directories(../include) + +link_directories(${CMAKE_BINARY_DIR}) + +add_executable(grpc_sdk_simple + ./main.cpp + ${src_files} + ) + +target_link_libraries(grpc_sdk_simple + milvus_grpc_sdk + pthread + ) + +install(TARGETS grpc_sdk_simple DESTINATION bin) diff --git a/cpp/src/grpcsdk/examples/main.cpp b/cpp/src/grpcsdk/examples/main.cpp new file mode 100644 index 0000000000..499b8a9935 --- /dev/null +++ b/cpp/src/grpcsdk/examples/main.cpp @@ -0,0 +1,68 @@ +//////////////////////////////////////////////////////////////////////////////// +// Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +// Unauthorized copying of this file, via any medium is strictly prohibited. +// Proprietary and confidential. +//////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include + +#include "src/ClientTest.h" + +void print_help(const std::string &app_name); + + +int +main(int argc, char *argv[]) { + printf("Client start...\n"); + + std::string app_name = basename(argv[0]); + static struct option long_options[] = {{"server", optional_argument, 0, 's'}, + {"port", optional_argument, 0, 'p'}, + {"help", no_argument, 0, 'h'}, + {NULL, 0, 0, 0}}; + + int option_index = 0; + std::string address = "127.0.0.1", port = "19530"; + app_name = argv[0]; + + int value; + while ((value = getopt_long(argc, argv, "s:p:h", long_options, &option_index)) != -1) { + switch (value) { + case 's': { + char *address_ptr = strdup(optarg); + address = address_ptr; + free(address_ptr); + break; + } + case 'p': { + char *port_ptr = strdup(optarg); + port = port_ptr; + free(port_ptr); + break; + } + case 'h': + default: + print_help(app_name); + return EXIT_SUCCESS; + } + } + + ClientTest test; + test.Test(address, port); + + printf("Client stop...\n"); + return 0; +} + +void +print_help(const std::string &app_name) { + printf("\n Usage: %s [OPTIONS]\n\n", app_name.c_str()); + printf(" Options:\n"); + printf(" -s --server Server address, default 127.0.0.1\n"); + printf(" -p --port Server port, default 19530\n"); + printf(" -h --help Print help information\n"); + printf("\n"); +} \ No newline at end of file diff --git a/cpp/src/grpcsdk/examples/src/ClientTest.cpp b/cpp/src/grpcsdk/examples/src/ClientTest.cpp new file mode 100644 index 0000000000..0038894ecf --- /dev/null +++ b/cpp/src/grpcsdk/examples/src/ClientTest.cpp @@ -0,0 +1,291 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#include "ClientTest.h" +#include "MilvusApi.h" + +#include +#include +#include +#include +#include + +using namespace ::zilliz::milvus; + +namespace { + std::string GetTableName(); + + static const std::string TABLE_NAME = GetTableName(); + static constexpr int64_t TABLE_DIMENSION = 512; + static constexpr int64_t BATCH_ROW_COUNT = 100000; + static constexpr int64_t NQ = 10; + static constexpr int64_t TOP_K = 10; + static constexpr int64_t SEARCH_TARGET = 5000; //change this value, result is different + static constexpr int64_t ADD_VECTOR_LOOP = 5; + static constexpr int64_t SECONDS_EACH_HOUR = 3600; + +#define BLOCK_SPLITER std::cout << "===========================================" << std::endl; + + void PrintTableSchema(const TableSchema& tb_schema) { + BLOCK_SPLITER + std::cout << "Table name: " << tb_schema.table_name.table_name << std::endl; + std::cout << "Table index type: " << (int)tb_schema.index_type << std::endl; + std::cout << "Table dimension: " << tb_schema.dimension << std::endl; + std::cout << "Table store raw data: " << (tb_schema.store_raw_vector ? "true" : "false") << std::endl; + BLOCK_SPLITER + } + + void PrintSearchResult(const std::vector>& search_record_array, + const std::vector& topk_query_result_array) { + BLOCK_SPLITER + std::cout << "Returned result count: " << topk_query_result_array.size() << std::endl; + + int32_t index = 0; + for(auto& result : topk_query_result_array) { + 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; + } + } + + BLOCK_SPLITER + } + + std::string CurrentTime() { + time_t tt; + time( &tt ); + tt = tt + 8*SECONDS_EACH_HOUR; + tm* t= gmtime( &tt ); + + std::string str = std::to_string(t->tm_year + 1900) + "_" + std::to_string(t->tm_mon + 1) + + "_" + std::to_string(t->tm_mday) + "_" + std::to_string(t->tm_hour) + + "_" + std::to_string(t->tm_min) + "_" + std::to_string(t->tm_sec); + + return str; + } + + std::string CurrentTmDate(int64_t offset_day = 0) { + time_t tt; + time( &tt ); + tt = tt + 8*SECONDS_EACH_HOUR; + tt = tt + 24*SECONDS_EACH_HOUR*offset_day; + tm* t= gmtime( &tt ); + + std::string str = std::to_string(t->tm_year + 1900) + "-" + std::to_string(t->tm_mon + 1) + + "-" + std::to_string(t->tm_mday); + + return str; + } + + std::string GetTableName() { + static std::string s_id(CurrentTime()); + return "tbl_" + s_id; + } + + TableSchema BuildTableSchema() { + TableSchema tb_schema; + tb_schema.table_name.table_name = TABLE_NAME; + tb_schema.index_type = IndexType::gpu_ivfflat; + tb_schema.dimension = TABLE_DIMENSION; + tb_schema.store_raw_vector = true; + + return tb_schema; + } + + void BuildVectors(int64_t from, int64_t to, + std::vector& vector_record_array) { + if(to <= from){ + return; + } + + vector_record_array.clear(); + for (int64_t k = from; k < to; k++) { + RowRecord record; + record.data.resize(TABLE_DIMENSION); + for(int64_t i = 0; i < TABLE_DIMENSION; i++) { + record.data[i] = (float)(k%(i+1)); + } + + vector_record_array.emplace_back(record); + } + } + + void Sleep(int seconds) { + std::cout << "Waiting " << seconds << " seconds ..." << std::endl; + sleep(seconds); + } + + class TimeRecorder { + public: + TimeRecorder(const std::string& title) + : title_(title) { + start_ = std::chrono::system_clock::now(); + } + + ~TimeRecorder() { + std::chrono::system_clock::time_point end = std::chrono::system_clock::now(); + long span = (std::chrono::duration_cast (end - start_)).count(); + std::cout << title_ << " totally cost: " << span << " ms" << std::endl; + } + + private: + std::string title_; + std::chrono::system_clock::time_point start_; + }; + + void CheckResult(const std::vector>& search_record_array, + const std::vector& topk_query_result_array) { + BLOCK_SPLITER + int64_t index = 0; + for(auto& result : topk_query_result_array) { + auto result_id = result.query_result_arrays[0].id; + 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; + } else { + std::cout << "Check result sucessfully" << std::endl; + } + } + BLOCK_SPLITER + } + + void DoSearch(std::shared_ptr conn, + const std::vector>& search_record_array, + const std::string& phase_name) { + std::vector query_range_array; + Range rg; + rg.start_value = CurrentTmDate(); + rg.end_value = CurrentTmDate(1); + query_range_array.emplace_back(rg); + + std::vector record_array; + for(auto& pair : search_record_array) { + record_array.push_back(pair.second); + } + + std::vector topk_query_result_array; + { + TimeRecorder rc(phase_name); + Status stat = conn->SearchVector(TABLE_NAME, record_array, query_range_array, TOP_K, topk_query_result_array); + std::cout << "SearchVector function call status: " << stat.ToString() << std::endl; + } + + PrintSearchResult(search_record_array, topk_query_result_array); + CheckResult(search_record_array, topk_query_result_array); + } +} + +void +ClientTest::Test(const std::string& address, const std::string& port) { + std::shared_ptr conn = Connection::Create(); + + {//connect server + ConnectParam param = {address, port}; + Status stat = conn->Connect(param); + std::cout << "Connect function call status: " << stat.ToString() << std::endl; + } + + {//server version + std::string version = conn->ServerVersion(); + std::cout << "Server version: " << version << std::endl; + } + + {//sdk version + std::string version = conn->ClientVersion(); + std::cout << "SDK version: " << version << std::endl; + } + + { + std::vector tables; + Status stat = conn->ShowTables(tables); + std::cout << "ShowTables function call status: " << stat.ToString() << std::endl; + std::cout << "All tables: " << std::endl; + for(auto& table : tables) { + int64_t row_count = 0; + stat = conn->GetTableRowCount(table, row_count); + std::cout << "\t" << table << "(" << row_count << " rows)" << std::endl; + } + } + + {//create table + TableSchema tb_schema = BuildTableSchema(); + Status stat = conn->CreateTable(tb_schema); + std::cout << "CreateTable function call status: " << stat.ToString() << std::endl; + PrintTableSchema(tb_schema); + + bool has_table = conn->HasTable(tb_schema.table_name.table_name); + if(has_table) { + std::cout << "Table is created" << std::endl; + } + } + + {//describe table + TableSchema tb_schema; + Status stat = conn->DescribeTable(TABLE_NAME, tb_schema); + std::cout << "DescribeTable function call status: " << stat.ToString() << std::endl; + PrintTableSchema(tb_schema); + } + + std::vector> search_record_array; + {//insert vectors + for (int i = 0; i < ADD_VECTOR_LOOP; i++) {//add vectors + std::vector record_array; + int64_t begin_index = i * BATCH_ROW_COUNT; + BuildVectors(begin_index, begin_index + BATCH_ROW_COUNT, record_array); + std::vector record_ids; + + auto start = std::chrono::high_resolution_clock::now(); + Status stat = conn->InsertVector(TABLE_NAME, record_array, record_ids); + auto finish = std::chrono::high_resolution_clock::now(); + std::cout << "InsertVector cost: " << std::chrono::duration_cast>(finish - start).count() << "s\n"; + + + std::cout << "InsertVector function call status: " << stat.ToString() << std::endl; + std::cout << "Returned id array count: " << record_ids.size() << std::endl; + + if(search_record_array.size() < NQ) { + search_record_array.push_back( + std::make_pair(record_ids[SEARCH_TARGET], record_array[SEARCH_TARGET])); + } + } + } + + {//search vectors without index + Sleep(2); + DoSearch(conn, search_record_array, "Search without index"); + } + + {//wait unit build index finish + std::cout << "Wait until build all index done" << std::endl; + Status stat = conn->BuildIndex(TABLE_NAME); + std::cout << "BuildIndex function call status: " << stat.ToString() << std::endl; + } + + {//search vectors after build index finish + DoSearch(conn, search_record_array, "Search after build index finish"); + } + + {//delete table + Status stat = conn->DropTable(TABLE_NAME); + std::cout << "DeleteTable function call status: " << stat.ToString() << std::endl; + } + + {//server status + std::string status = conn->ServerStatus(); + std::cout << "Server status before disconnect: " << status << std::endl; + } +// Connection::Destroy(conn); + conn->Disconnect(); + {//server status + std::string status = conn->ServerStatus(); + std::cout << "Server status after disconnect: " << status << std::endl; + } +} \ No newline at end of file diff --git a/cpp/src/grpcsdk/examples/src/ClientTest.h b/cpp/src/grpcsdk/examples/src/ClientTest.h new file mode 100644 index 0000000000..0f42577ad1 --- /dev/null +++ b/cpp/src/grpcsdk/examples/src/ClientTest.h @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#pragma once + +#include + +class ClientTest { +public: + void Test(const std::string& address, const std::string& port); +}; \ No newline at end of file diff --git a/cpp/src/grpcsdk/include/MilvusApi.h b/cpp/src/grpcsdk/include/MilvusApi.h new file mode 100644 index 0000000000..69db9b79b5 --- /dev/null +++ b/cpp/src/grpcsdk/include/MilvusApi.h @@ -0,0 +1,384 @@ +#pragma onceinclude_directories(/usr/include) + + +#include "Status.h" + +#include +#include +#include +#include + +/** \brief Milvus SDK namespace +*/ +namespace zilliz { +namespace milvus { + +//enum Error_Code { +// SUCCESS = 0, +// UNEXPECTED_ERROR = 1, +// CONNECT_FAILED = 2, +// PERMISSION_DENIED = 3, +// TABLE_NOT_EXISTS = 4, +// ILLEGAL_ARGUMENT = 5, +// ILLEGAL_RANGE = 6, +// ILLEGAL_DIMENSION = 7, +// ILLEGAL_INDEX_TYPE = 8, +// ILLEGAL_TABLE_NAME = 9, +// ILLEGAL_TOPK = 10, +// ILLEGAL_ROWRECORD = 11, +// ILLEGAL_VECTOR_ID = 12, +// ILLEGAL_SEARCH_RESULT = 13, +// FILE_NOT_FOUND = 14, +// META_FAILED = 15, +// CACHE_FAILED = 16, +// CANNOT_CREATE_FOLDER = 17, +// CANNOT_CREATE_FILE = 18, +// CANNOT_DELETE_FOLDER = 19, +// CANNOT_DELETE_FILE = 20, +//}; + +/** +* @brief Index Type +*/ + enum class IndexType { + invalid = 0, + cpu_idmap, + gpu_ivfflat, + gpu_ivfsq8, + }; + +/** +* @brief Connect API parameter +*/ + struct ConnectParam { + std::string ip_address; ///< Server IP address + std::string port; ///< Server PORT + }; + +/** +* @brief Status for return +*/ + struct StatusMsg { +// Error_Code errorCode; + std::string reason; + }; + +/** +* @brief Table Name +*/ + struct TableName { + StatusMsg status; + std::string table_name; + }; + +/** +* @brief Table Schema +*/ + struct TableSchema { + TableName table_name; ///< Table name + IndexType index_type = IndexType::invalid; ///< Index type + int64_t dimension = 0; ///< Vector dimension, must be a positive value + bool store_raw_vector = false; ///< Is vector raw data stored in the table + }; + +/** +* @brief Range information +* for DATE partition, the format is like: 'year-month-day' +*/ + struct Range { + std::string start_value; ///< Range start + std::string end_value; ///< Range stop + }; + +/** +* @brief Record inserted +*/ + struct RowRecord { + std::vector data; ///< Vector raw data + }; + + +//struct InsertInfos { +// std::string table_name; +// std::vector row_record_array; +//}; + +/** +* @brief Vector ids for return +*/ + struct VectorIds { + StatusMsg status; + std::vector vector_id_array; + }; + +/** +* @brief Infos for searching vector +*/ + struct SearchVectorInfos { + std::string table_name; + std::vector query_record_array; + std::vector query_range_array; + int64_t topk; + }; + +/** +* @brief Infos for searching vector in files +*/ + struct SearchVectorInFilesInfos { + std::vector file_id_array; + SearchVectorInfos search_vector_infos; + }; + +/** +* @brief Query result +*/ + struct QueryResult { + int64_t id; ///< Output result + double distance; ///< Vector similarity distance + }; + +/** +* @brief TopK query result +*/ + struct TopKQueryResult { + StatusMsg status; + std::vector query_result_arrays; ///< TopK query result + }; + +/** +* @brief Server bool Reply +*/ + struct BoolReply { + StatusMsg status; + bool bool_reply; + }; + +/** +* @brief Return table row count +*/ + struct TableRowCount { + StatusMsg status; + int64_t table_row_count; + }; + +/** +* @brief SDK main class +*/ + class Connection { + public: + + /** + * @brief CreateConnection + * + * Create a connection instance and return it's shared pointer + * + * @return Connection instance pointer + */ + + static std::shared_ptr + Create(); + + /** + * @brief DestroyConnection + * + * Destroy the connection instance + * + * @param connection, the shared pointer to the instance to be destroyed + * + * @return if destroy is successful + */ + + static Status + Destroy(std::shared_ptr connection_ptr); + + /** + * @brief Connect + * + * Connect function should be called before any operations + * Server will be connected after Connect return OK + * + * @param param, use to provide server information + * + * @return Indicate if connect is successful + */ + + virtual Status Connect(const ConnectParam ¶m) = 0; + + /** + * @brief Connect + * + * Connect function should be called before any operations + * Server will be connected after Connect return OK + * + * @param uri, use to provide server information, example: milvus://ipaddress:port + * + * @return Indicate if connect is successful + */ + virtual Status Connect(const std::string &uri) = 0; + + /** + * @brief connected + * + * Connection status. + * + * @return Indicate if connection status + */ + virtual Status Connected() const = 0; + + /** + * @brief Disconnect + * + * Server will be disconnected after Disconnect return OK + * + * @return Indicate if disconnect is successful + */ + virtual Status Disconnect() = 0; + + + /** + * @brief Create table method + * + * This method is used to create table + * + * @param param, use to provide table information to be created. + * + * @return Indicate if table is created successfully + */ + virtual Status CreateTable(const TableSchema ¶m) = 0; + + + /** + * @brief Test table existence method + * + * This method is used to create table + * + * @param table_name, table name is going to be tested. + * + * @return Indicate if table is cexist + */ + virtual bool HasTable(const std::string &table_name) = 0; + + + /** + * @brief Drop table method + * + * This method is used to drop table. + * + * @param table_name, table name is going to be dropped. + * + * @return Indicate if table is drop successfully. + */ + virtual Status DropTable(const std::string &table_name) = 0; + + + /** + * @brief Build index method + * + * This method is used to build index for whole table + * + * @param table_name, table name is going to be build index. + * + * @return Indicate if build index successfully. + */ + virtual Status BuildIndex(const std::string &table_name) = 0; + + /** + * @brief Add vector to table + * + * This method is used to add vector array to table. + * + * @param table_name, table_name is inserted. + * @param record_array, vector array is inserted. + * @param id_array, after inserted every vector is given a id. + * + * @return Indicate if vector array are inserted successfully + */ + virtual Status InsertVector(const std::string &table_name, + const std::vector &record_array, + std::vector &id_array) = 0; + + + /** + * @brief Search vector + * + * This method is used to query vector in table. + * + * @param table_name, table_name is queried. + * @param query_record_array, all vector are going to be queried. + * @param query_range_array, time ranges, if not specified, will search in whole table + * @param topk, how many similarity vectors will be searched. + * @param topk_query_result_array, result array. + * + * @return Indicate if query is successful. + */ + virtual Status SearchVector(const std::string &table_name, + const std::vector &query_record_array, + const std::vector &query_range_array, + int64_t topk, + std::vector &topk_query_result_array) = 0; + + /** + * @brief Show table description + * + * This method is used to show table information. + * + * @param table_name, which table is show. + * @param table_schema, table_schema is given when operation is successful. + * + * @return Indicate if this operation is successful. + */ + virtual Status DescribeTable(const std::string &table_name, TableSchema &table_schema) = 0; + + /** + * @brief Get table row count + * + * This method is used to get table row count. + * + * @param table_name, table's name. + * @param row_count, table total row count. + * + * @return Indicate if this operation is successful. + */ + virtual Status GetTableRowCount(const std::string &table_name, int64_t &row_count) = 0; + + /** + * @brief Show all tables in database + * + * This method is used to list all tables. + * + * @param table_array, all tables are push into the array. + * + * @return Indicate if this operation is successful. + */ + virtual Status ShowTables(std::vector &table_array) = 0; + + /** + * @brief Give the client version + * + * This method is used to give the client version. + * + * @return Client version. + */ + virtual std::string ClientVersion() const = 0; + + /** + * @brief Give the server version + * + * This method is used to give the server version. + * + * @return Server version. + */ + virtual std::string ServerVersion() const = 0; + + /** + * @brief Give the server status + * + * This method is used to give the server status. + * + * @return Server status. + */ + virtual std::string ServerStatus() const = 0; + }; + +} +} \ No newline at end of file diff --git a/cpp/src/grpcsdk/include/Status.h b/cpp/src/grpcsdk/include/Status.h new file mode 100644 index 0000000000..df94373491 --- /dev/null +++ b/cpp/src/grpcsdk/include/Status.h @@ -0,0 +1,330 @@ +#pragma once + +#include +#include + +/** \brief Milvus SDK namespace +*/ +namespace zilliz { +namespace milvus { + +/** +* @brief Status Code for SDK interface return +*/ +enum class StatusCode { +OK = 0, +// system error section + UnknownError = 1, +NotSupported, +NotConnected, + +// function error section + InvalidAgument = 1000, +}; + +/** +* @brief Status for SDK interface return +*/ +class Status { +public: +/** + * @brief Status + * + * Default constructor. + * + */ +Status() = default; + +/** + * @brief Status + * + * Destructor. + * + */ +~Status() noexcept; + +/** + * @brief Status + * + * Constructor + * + * @param code, status code. + * @param message, status message. + * + */ +Status(StatusCode code, const std::string &message); + +/** + * @brief Status + * + * Copy constructor + * + * @param status, status to be copied. + * + */ +inline Status(const Status &status); + +/** + * @brief Status + * + * Assignment operator + * + * @param status, status to be copied. + * @return, the status is assigned. + * + */ +Status &operator=(const Status &s); + +/** + * @brief Status + * + * Move constructor + * + * @param status, status to be moved. + * + */ +inline Status(Status &&s) noexcept : state_(s.state_) {}; + +/** + * @brief Status + * + * Move assignment operator + * + * @param status, status to be moved. + * @return, the status is moved. + * + */ +Status &operator=(Status &&s) noexcept; + +/** + * @brief Status + * + * AND operator + * + * @param status, status to be AND. + * @return, the status after AND operation. + * + */ +inline Status operator&(const Status &s) const noexcept; + +/** + * @brief Status + * + * AND operator + * + * @param status, status to be AND. + * @return, the status after AND operation. + * + */ +inline Status operator&(Status &&s) const noexcept; + +/** + * @brief Status + * + * AND operator + * + * @param status, status to be AND. + * @return, the status after AND operation. + * + */ +inline Status &operator&=(const Status &s) noexcept; + +/** + * @brief Status + * + * AND operator + * + * @param status, status to be AND. + * @return, the status after AND operation. + * + */ +inline Status &operator&=(Status &&s) noexcept; + +/** + * @brief OK + * + * static OK status constructor + * + * @return, the status with OK. + * + */ +static Status OK() { return Status(); } + +/** + * @brief OK + * + * static OK status constructor with a specific message + * + * @param, serveral specific messages + * @return, the status with OK. + * + */ +template +static Status OK(Args &&... args) { + return Status(StatusCode::OK, MessageBuilder(std::forward(args)...)); +} + +/** + * @brief Invalid + * + * static Invalid status constructor with a specific message + * + * @param, serveral specific messages + * @return, the status with Invalid. + * + */ +template +static Status Invalid(Args &&... args) { + return Status(StatusCode::InvalidAgument, + MessageBuilder(std::forward(args)...)); +} + +/** + * @brief Unknown Error + * + * static unknown error status constructor with a specific message + * + * @param, serveral specific messages + * @return, the status with unknown error. + * + */ +template +static Status UnknownError(Args &&... args) { + return Status(StatusCode::UnknownError, MessageBuilder(std::forward(args)...)); +} + +/** + * @brief not supported Error + * + * static not supported status constructor with a specific message + * + * @param, serveral specific messages + * @return, the status with not supported error. + * + */ +template +static Status NotSupported(Args &&... args) { + return Status(StatusCode::NotSupported, MessageBuilder(std::forward(args)...)); +} + +/** + * @brief ok + * + * Return true iff the status indicates success. + * + * @return, if the status indicates success. + * + */ +bool ok() const { return (state_ == nullptr); } + +/** + * @brief IsInvalid + * + * Return true iff the status indicates invalid. + * + * @return, if the status indicates invalid. + * + */ +bool IsInvalid() const { return code() == StatusCode::InvalidAgument; } + +/** + * @brief IsUnknownError + * + * Return true iff the status indicates unknown error. + * + * @return, if the status indicates unknown error. + * + */ +bool IsUnknownError() const { return code() == StatusCode::UnknownError; } + +/** + * @brief IsNotSupported + * + * Return true iff the status indicates not supported. + * + * @return, if the status indicates not supported. + * + */ +bool IsNotSupported() const { return code() == StatusCode::NotSupported; } + +/** + * @brief ToString + * + * Return error message string. + * + * @return, error message string. + * + */ +std::string ToString() const; + +/** + * @brief CodeAsString + * + * Return a string representation of the status code. + * + * @return, a string representation of the status code. + * + */ +std::string CodeAsString() const; + +/** + * @brief code + * + * Return the StatusCode value attached to this status. + * + * @return, the status code value attached to this status. + * + */ +StatusCode code() const { return ok() ? StatusCode::OK : state_->code; } + +/** + * @brief message + * + * Return the specific error message attached to this status. + * + * @return, the specific error message attached to this status. + * + */ +std::string message() const { return ok() ? "" : state_->message; } + +private: +struct State { + StatusCode code; + std::string message; +}; + +// OK status has a `nullptr` state_. Otherwise, `state_` points to +// a `State` structure containing the error code and message. +State *state_ = nullptr; + +void DeleteState() { + delete state_; + state_ = nullptr; +} + +void CopyFrom(const Status &s); + +inline void MoveFrom(Status &s); + +template +static void MessageBuilderRecursive(std::stringstream &stream, Head &&head) { + stream << head; +} + +template +static void MessageBuilderRecursive(std::stringstream &stream, Head &&head, Tail &&... tail) { + MessageBuilderRecursive(stream, std::forward(head)); + MessageBuilderRecursive(stream, std::forward(tail)...); +} + +template +static std::string MessageBuilder(Args &&... args) { + std::stringstream stream; + + MessageBuilderRecursive(stream, std::forward(args)...); + + return stream.str(); +} +}; +} +} \ No newline at end of file diff --git a/cpp/src/grpcsdk/src/client/ClientProxy.cpp b/cpp/src/grpcsdk/src/client/ClientProxy.cpp new file mode 100644 index 0000000000..d3c9585fda --- /dev/null +++ b/cpp/src/grpcsdk/src/client/ClientProxy.cpp @@ -0,0 +1,313 @@ +/******************************************************************************* +* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +* Unauthorized copying of this file, via any medium is strictly prohibited. +* Proprietary and confidential. +******************************************************************************/ +#include "ClientProxy.h" +#include "milvus.grpc.pb.h" + +namespace zilliz { +namespace milvus { + +Status +ClientProxy::Connect(const ConnectParam ¶m) { +// Disconnect(); + + std::string uri = param.ip_address + ":" + param.port; + + channel_ = ::grpc::CreateChannel(uri, ::grpc::InsecureChannelCredentials()); + client_ptr = new grpcClient(channel_); + + if (channel_ != nullptr) { + connected_ = true; + } + return Status::OK(); +} + +Status +ClientProxy::Connect(const std::string &uri) { +// Disconnect(); + + size_t index = uri.find_first_of(":", 0); + if ((index == std::string::npos)) { + return Status::Invalid("Invalid uri"); + } + + ConnectParam param; + param.ip_address = uri.substr(0, index); + param.port = uri.substr(index + 1); + + return Connect(param); +} + +Status +ClientProxy::Connected() const { + try { + std::string info; + client_ptr->Ping(info, ""); + } catch (std::exception &ex) { + return Status(StatusCode::NotConnected, "connection lost: " + std::string(ex.what())); + } + + return Status::OK(); +} + +Status +ClientProxy::Disconnect() { + connected_ = false; +// delete client_ptr; + return Status::OK(); +} + +std::string +ClientProxy::ClientVersion() const { + return ""; +} + +Status +ClientProxy::CreateTable(const TableSchema ¶m) { + try { + ::milvus::grpc::TableSchema schema; +// ::milvus::grpc::TableName *grpc_tablename = new ::milvus::grpc::TableName; +// grpc_tablename->set_table_name(param.table_name.table_name); +// schema.set_allocated_table_name(grpc_tablename); + + schema.mutable_table_name()->set_table_name(param.table_name.table_name); + schema.set_index_type((int) param.index_type); + schema.set_dimension(param.dimension); + schema.set_store_raw_vector(param.store_raw_vector); + + client_ptr->CreateTable(schema);//stub call + } catch (std::exception &ex) { + return Status(StatusCode::UnknownError, "failed to create table: " + std::string(ex.what())); + } + return Status::OK(); +} + +bool +ClientProxy::HasTable(const std::string &table_name) { + ::milvus::grpc::TableName grpc_table_name; + grpc_table_name.set_table_name(table_name); + return client_ptr->HasTable(grpc_table_name); +} + +Status +ClientProxy::DropTable(const std::string &table_name) { + try { + ::milvus::grpc::TableName grpc_table_name; + grpc_table_name.set_table_name(table_name); + client_ptr->DropTable(grpc_table_name); + + } catch (std::exception &ex) { + return Status(StatusCode::UnknownError, "failed to drop table: " + std::string(ex.what())); + } + + return Status::OK(); +} + +Status +ClientProxy::BuildIndex(const std::string &table_name) { + try { + ::milvus::grpc::TableName grpc_table_name; + grpc_table_name.set_table_name(table_name); + client_ptr->BuildIndex(grpc_table_name); + + } catch (std::exception &ex) { + return Status(StatusCode::UnknownError, "failed to build index: " + std::string(ex.what())); + } + + return Status::OK(); +} + +Status +ClientProxy::InsertVector(const std::string &table_name, + const std::vector &record_array, + std::vector &id_array) { + try { +// ::milvus::grpc::InsertInfos insert_infos; +// insert_infos.set_table_name(table_name); +// +// for (auto &record : record_array) { +// ::milvus::grpc::RowRecord *grpc_record = insert_infos.add_row_record_array(); +// for (size_t i = 0; i < record.data.size(); i++) { +// grpc_record->add_vector_data(record.data[i]); +// } +// } +// +// ::milvus::grpc::VectorIds vector_ids; +// +// std::cout << "*****************************************************\n"; +// auto start = std::chrono::high_resolution_clock::now(); +// //Single thread +// client_ptr->InsertVector(vector_ids, insert_infos); +// auto finish = std::chrono::high_resolution_clock::now(); +// std::cout << "InsertVector cost: " << std::chrono::duration_cast>(finish - start).count() << "s\n"; +// std::cout << "*****************************************************\n"; +// +// for (size_t i = 0; i < vector_ids.vector_id_array_size(); i++) { +// id_array.push_back(vector_ids.vector_id_array(i)); +// } + +//////////////////////////////////////////////////////////////////////////// + //multithread + std::vector threads; +// int thread_count = std::thread::hardware_concurrency(); + int thread_count = 10; + + ::milvus::grpc::InsertInfos *insert_info_array = new ::milvus::grpc::InsertInfos[thread_count]; + ::milvus::grpc::VectorIds *vector_ids_array = new ::milvus::grpc::VectorIds[thread_count]; + int64_t record_count = record_array.size() / thread_count; + + for (size_t i = 0; i < thread_count; i++) { + insert_info_array[i].set_table_name(table_name); + for (size_t j = i * record_count; j < record_count * (i + 1); j++) { + ::milvus::grpc::RowRecord *grpc_record = insert_info_array[i].add_row_record_array(); + for (size_t k = 0; k < record_array[j].data.size(); k++) { + grpc_record->add_vector_data(record_array[j].data[k]); + } + } + } + + std::cout << "*****************************************************\n"; + auto start = std::chrono::high_resolution_clock::now(); + for (size_t j = 0; j < thread_count; j++) { + threads.push_back( + std::thread(&grpcClient::InsertVector, client_ptr, std::ref(vector_ids_array[j]), insert_info_array[j])); + } + std::for_each(threads.begin(), threads.end(), std::mem_fn(&std::thread::join)); + auto finish = std::chrono::high_resolution_clock::now(); + std::cout << "InsertVector cost: " << std::chrono::duration_cast>(finish - start).count() << "s\n"; + std::cout << "*****************************************************\n"; + + for (size_t i = 0; i < thread_count; i++) { + for (size_t j = 0; j < vector_ids_array[i].vector_id_array_size(); j++) { + id_array.push_back(vector_ids_array[i].vector_id_array(j)); + } + } + + } catch (std::exception &ex) { + return Status(StatusCode::UnknownError, "failed to add vector: " + std::string(ex.what())); + } + + return Status::OK(); +} + +Status +ClientProxy::SearchVector(const std::string &table_name, + const std::vector &query_record_array, + const std::vector &query_range_array, + int64_t topk, + std::vector &topk_query_result_array) { + try { + //step 1: convert vectors data + ::milvus::grpc::SearchVectorInfos search_vector_infos; + search_vector_infos.set_table_name(table_name); + search_vector_infos.set_topk(topk); + for (auto &record : query_record_array) { + ::milvus::grpc::RowRecord *row_record = search_vector_infos.add_query_record_array(); + for (size_t i = 0; i < record.data.size(); i++) { + row_record->add_vector_data(record.data[i]); + } + } + + //step 2: convert range array + for (auto &range : query_range_array) { + ::milvus::grpc::Range *grpc_range = search_vector_infos.add_query_range_array(); + grpc_range->set_start_value(range.start_value); + grpc_range->set_end_value(range.end_value); + } + + //step 3: search vectors + std::vector<::milvus::grpc::TopKQueryResult> result_array; + client_ptr->SearchVector(result_array, search_vector_infos); + + //step 4: convert result array + for (auto &grpc_topk_result : result_array) { + TopKQueryResult result; + for (size_t i = 0; i < grpc_topk_result.query_result_arrays_size(); i++) { + QueryResult query_result; + query_result.id = grpc_topk_result.query_result_arrays(i).id(); + query_result.distance = grpc_topk_result.query_result_arrays(i).distance(); + result.query_result_arrays.emplace_back(query_result); + } + + topk_query_result_array.emplace_back(result); + } + + } catch (std::exception &ex) { + return Status(StatusCode::UnknownError, "failed to search vectors: " + std::string(ex.what())); + } + + return Status::OK(); +} + +Status +ClientProxy::DescribeTable(const std::string &table_name, TableSchema &table_schema) { + try { + ::milvus::grpc::TableSchema grpc_schema; + + client_ptr->DescribeTable(grpc_schema, table_name); + + table_schema.table_name.table_name = grpc_schema.table_name().table_name(); + table_schema.index_type = (IndexType) grpc_schema.index_type(); + table_schema.dimension = grpc_schema.dimension(); + table_schema.store_raw_vector = grpc_schema.store_raw_vector(); + } catch (std::exception &ex) { + return Status(StatusCode::UnknownError, "failed to describe table: " + std::string(ex.what())); + } + + return Status::OK(); +} + +Status +ClientProxy::GetTableRowCount(const std::string &table_name, int64_t &row_count) { + try { + row_count = client_ptr->GetTableRowCount(table_name); + + } catch (std::exception &ex) { + return Status(StatusCode::UnknownError, "failed to show tables: " + std::string(ex.what())); + } + + return Status::OK(); +} + +Status +ClientProxy::ShowTables(std::vector &table_array) { + try { + client_ptr->ShowTables(table_array); + + } catch (std::exception &ex) { + return Status(StatusCode::UnknownError, "failed to show tables: " + std::string(ex.what())); + } + + return Status::OK(); +} + +std::string +ClientProxy::ServerVersion() const { + try { + std::string version; + client_ptr->Ping(version, "version"); + return version; + } catch (std::exception &ex) { + return ""; + } +} + +std::string +ClientProxy::ServerStatus() const { + if (connected_ == false) { + return "not connected to server"; + } + + try { + std::string dummy; + client_ptr->Ping(dummy, ""); + return "server alive"; + } catch (std::exception &ex) { + return "connection lost"; + } +} + +} +} diff --git a/cpp/src/grpcsdk/src/client/ClientProxy.h b/cpp/src/grpcsdk/src/client/ClientProxy.h new file mode 100644 index 0000000000..7b1d24248b --- /dev/null +++ b/cpp/src/grpcsdk/src/client/ClientProxy.h @@ -0,0 +1,66 @@ +/******************************************************************************* +* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +* Unauthorized copying of this file, via any medium is strictly prohibited. +* Proprietary and confidential. +******************************************************************************/ +#pragma once + +#include "MilvusApi.h" +#include "grpcClient.h" + +namespace zilliz { +namespace milvus { + +class ClientProxy : public Connection { +public: + // Implementations of the Connection interface + virtual Status Connect(const ConnectParam ¶m) override; + + virtual Status Connect(const std::string &uri) override; + + virtual Status Connected() const override; + + virtual Status Disconnect() override; + + virtual Status CreateTable(const TableSchema ¶m) override; + + virtual bool HasTable(const std::string &table_name) override; + + virtual Status DropTable(const std::string &table_name) override; + + virtual Status BuildIndex(const std::string &table_name) override; + + virtual Status InsertVector(const std::string &table_name, + const std::vector &record_array, + std::vector &id_array) override; + + virtual Status SearchVector(const std::string &table_name, + const std::vector &query_record_array, + const std::vector &query_range_array, + int64_t topk, + std::vector &topk_query_result_array) override; + + virtual Status DescribeTable(const std::string &table_name, TableSchema &table_schema) override; + + virtual Status GetTableRowCount(const std::string &table_name, int64_t &row_count) override; + + virtual Status ShowTables(std::vector &table_array) override; + + virtual std::string ClientVersion() const override; + + virtual std::string ServerVersion() const override; + + virtual std::string ServerStatus() const override; + +private: + + std::shared_ptr<::grpc::Channel> channel_; + +private: + grpcClient *client_ptr; +// std::shared_ptr client_ptr; + bool connected_ = false; +}; + +} +} diff --git a/cpp/src/grpcsdk/src/client/grpcClient.cpp b/cpp/src/grpcsdk/src/client/grpcClient.cpp new file mode 100644 index 0000000000..8014e1410f --- /dev/null +++ b/cpp/src/grpcsdk/src/client/grpcClient.cpp @@ -0,0 +1,168 @@ +/******************************************************************************* +* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +* Unauthorized copying of this file, via any medium is strictly prohibited. +* Proprietary and confidential. +******************************************************************************/ +#include +#include +#include +#include +#include + +#include "grpcClient.h" + +using grpc::Channel; +using grpc::ClientContext; +using grpc::ClientReader; +using grpc::ClientReaderWriter; +using grpc::ClientWriter; +using grpc::Status; + +namespace zilliz { +namespace milvus { +grpcClient::grpcClient(std::shared_ptr<::grpc::Channel> channel) + : stub_(::milvus::grpc::MilvusService::NewStub(channel)) { + +} + +grpcClient::~grpcClient() { + +} + +void +grpcClient::CreateTable(const ::milvus::grpc::TableSchema table_schema) { + ClientContext context; + ::milvus::Status response; + ::grpc::Status status = stub_->CreateTable(&context, table_schema, &response); + + if (!status.ok()) { + std::cout << "CreateTable rpc failed!\n"; + } +} + +bool +grpcClient::HasTable(const ::milvus::grpc::TableName table_name) { + ClientContext context; + ::milvus::grpc::BoolReply response; + ::grpc::Status status = stub_->HasTable(&context, table_name, &response); + + if (!status.ok()) { + std::cout << "HasTable rpc failed!\n"; + } + return response.bool_reply(); +} + +void +grpcClient::DropTable(const ::milvus::grpc::TableName table_name) { + ClientContext context; + ::milvus::Status response; + ::grpc::Status status = stub_->DropTable(&context, table_name, &response); + + if (!status.ok()) { + std::cout << "DropTable rpc failed!\n"; + } +} + +void +grpcClient::BuildIndex(const ::milvus::grpc::TableName table_name) { + ClientContext context; + ::milvus::Status response; + ::grpc::Status status = stub_->BuildIndex(&context, table_name, &response); + + if (!status.ok()) { + std::cout << "BuildIndex rpc failed!\n"; + } +} + +void +grpcClient::InsertVector(::milvus::grpc::VectorIds& vector_ids, const ::milvus::grpc::InsertInfos insert_infos) { + ClientContext context; + ::grpc::Status status = stub_->InsertVector(&context, insert_infos, &vector_ids); +// std::cout << vector_ids.vector_id_array_size(); + if (!status.ok()) { + std::cout << "InsertVector rpc failed!\n"; + } +} + +void +grpcClient::SearchVector(std::vector<::milvus::grpc::TopKQueryResult>& result_array, + const ::milvus::grpc::SearchVectorInfos search_vector_infos) { + ::milvus::grpc::TopKQueryResult query_result; + ClientContext context; + std::unique_ptr > reader( + stub_->SearchVector(&context, search_vector_infos)); + + while (reader->Read(&query_result)) { + result_array.emplace_back(query_result); + } + + ::grpc::Status status = reader->Finish(); + + if (!status.ok()) { + std::cout << "SearchVector rpc failed!\n"; + } +} + +void +grpcClient::DescribeTable(::milvus::grpc::TableSchema &grpc_schema, const std::string table_name) { + ClientContext context; + ::milvus::grpc::TableName grpc_tablename; + grpc_tablename.set_table_name(table_name); + ::grpc::Status status = stub_->DescribeTable(&context, grpc_tablename, &grpc_schema); + + if (!status.ok()) { + std::cout << "DescribeTable rpc failed!\n"; + } +} + +int64_t +grpcClient::GetTableRowCount(const std::string table_name) { + ClientContext context; + ::milvus::grpc::TableRowCount response; + ::milvus::grpc::TableName grpc_tablename; + ::grpc::Status status = stub_->GetTableRowCount(&context, grpc_tablename, &response); + + if (!status.ok()) { + std::cout << "DescribeTable rpc failed!\n"; + } + return response.table_row_count(); +} + +void +grpcClient::ShowTables(std::vector &table_array) { + ClientContext context; + ::milvus::grpc::Command command; + std::unique_ptr > reader( + stub_->ShowTables(&context, command)); + + ::milvus::grpc::TableName table_name; + while (reader->Read(&table_name)) { + table_array.emplace_back(table_name.table_name()); + } + ::grpc::Status status = reader->Finish(); + + if (!status.ok()) { + std::cout << "ShowTables rpc failed!\n"; + } +} + +void +grpcClient::Ping(std::string &result, const std::string cmd) { + ClientContext context; + ::milvus::grpc::ServerStatus response; + ::milvus::grpc::Command command; + command.set_cmd(cmd); + ::grpc::Status status = stub_->Ping(&context, command, &response); + + result = response.info(); + if (!status.ok()) { + std::cout << "Ping rpc failed!\n"; + } +} + +void +grpcClient::Disconnect() { +} + +} +} \ No newline at end of file diff --git a/cpp/src/grpcsdk/src/client/grpcClient.h b/cpp/src/grpcsdk/src/client/grpcClient.h new file mode 100644 index 0000000000..738c6d0a02 --- /dev/null +++ b/cpp/src/grpcsdk/src/client/grpcClient.h @@ -0,0 +1,62 @@ +/******************************************************************************* +* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +* Unauthorized copying of this file, via any medium is strictly prohibited. +* Proprietary and confidential. +******************************************************************************/ +#pragma once +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "Status.h" +#include "milvus.grpc.pb.h" +#include "status.grpc.pb.h" + +#include + +namespace zilliz { +namespace milvus { +class grpcClient { +public: + grpcClient(std::shared_ptr<::grpc::Channel> channel); + + virtual ~grpcClient(); + + void CreateTable(const ::milvus::grpc::TableSchema table_schema); + + bool HasTable(const ::milvus::grpc::TableName table_name); + + void DropTable(const ::milvus::grpc::TableName table_name); + + void BuildIndex(const ::milvus::grpc::TableName table_name); + + void InsertVector(::milvus::grpc::VectorIds& vector_ids, const ::milvus::grpc::InsertInfos insert_infos); + + void SearchVector(std::vector<::milvus::grpc::TopKQueryResult>& result_array, + const ::milvus::grpc::SearchVectorInfos search_vector_infos); + + void DescribeTable(::milvus::grpc::TableSchema& grpc_schema, const std::string table_name); + + int64_t GetTableRowCount(const std::string table_name); + + void ShowTables(std::vector &table_array); + + void Ping(std::string &result, const std::string cmd); + + void Disconnect(); + +private: + std::unique_ptr<::milvus::grpc::MilvusService::Stub> stub_; +}; + +} +} \ No newline at end of file diff --git a/cpp/src/grpcsdk/src/interface/ConnectionImpl.cpp b/cpp/src/grpcsdk/src/interface/ConnectionImpl.cpp new file mode 100644 index 0000000000..61556f93aa --- /dev/null +++ b/cpp/src/grpcsdk/src/interface/ConnectionImpl.cpp @@ -0,0 +1,118 @@ +/******************************************************************************* +* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +* Unauthorized copying of this file, via any medium is strictly prohibited. +* Proprietary and confidential. +******************************************************************************/ +#include "ConnectionImpl.h" +#include "version.h" + +namespace zilliz { +namespace milvus { + +std::shared_ptr +Connection::Create() { + return std::shared_ptr(new ConnectionImpl()); +} + +Status +Connection::Destroy(std::shared_ptr connection_ptr) { +// if (connection_ptr != nullptr) { +// return connection_ptr->Disconnect(); +// } + return Status::OK(); +} + +////////////////////////////////////////////////////////////////////////////////////////////// +ConnectionImpl::ConnectionImpl() { + client_proxy_ = std::make_shared(); +} + +Status +ConnectionImpl::Connect(const ConnectParam ¶m) { + return client_proxy_->Connect(param); +} + +Status +ConnectionImpl::Connect(const std::string &uri) { + return client_proxy_->Connect(uri); +} + +Status +ConnectionImpl::Connected() const { + return client_proxy_->Connected(); +} + +Status +ConnectionImpl::Disconnect() { + return client_proxy_->Disconnect(); +} + +std::string +ConnectionImpl::ClientVersion() const { + return MILVUS_VERSION; +} + +Status +ConnectionImpl::CreateTable(const TableSchema ¶m) { + return client_proxy_->CreateTable(param); +} + +bool +ConnectionImpl::HasTable(const std::string &table_name) { + return client_proxy_->HasTable(table_name); +} + +Status +ConnectionImpl::DropTable(const std::string &table_name) { + return client_proxy_->DropTable(table_name); +} + +Status +ConnectionImpl::BuildIndex(const std::string &table_name) { + return client_proxy_->BuildIndex(table_name); +} + +Status +ConnectionImpl::InsertVector(const std::string &table_name, + const std::vector &record_array, + std::vector &id_array) { + return client_proxy_->InsertVector(table_name, record_array, id_array); +} + +Status +ConnectionImpl::SearchVector(const std::string &table_name, + const std::vector &query_record_array, + const std::vector &query_range_array, + int64_t topk, + std::vector &topk_query_result_array) { + return client_proxy_->SearchVector(table_name, query_record_array, query_range_array, topk, + topk_query_result_array); +} + +Status +ConnectionImpl::DescribeTable(const std::string &table_name, TableSchema &table_schema) { + return client_proxy_->DescribeTable(table_name, table_schema); +} + +Status +ConnectionImpl::GetTableRowCount(const std::string &table_name, int64_t &row_count) { + return client_proxy_->GetTableRowCount(table_name, row_count); +} + +Status +ConnectionImpl::ShowTables(std::vector &table_array) { + return client_proxy_->ShowTables(table_array); +} + +std::string +ConnectionImpl::ServerVersion() const { + return client_proxy_->ServerVersion(); +} + +std::string +ConnectionImpl::ServerStatus() const { + return client_proxy_->ServerStatus(); +} + +} +} diff --git a/cpp/src/grpcsdk/src/interface/ConnectionImpl.h b/cpp/src/grpcsdk/src/interface/ConnectionImpl.h new file mode 100644 index 0000000000..1262e9783d --- /dev/null +++ b/cpp/src/grpcsdk/src/interface/ConnectionImpl.h @@ -0,0 +1,62 @@ +/******************************************************************************* +* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +* Unauthorized copying of this file, via any medium is strictly prohibited. +* Proprietary and confidential. +******************************************************************************/ +#pragma once + +//#include "MilvusApi.h" +#include "client/ClientProxy.h" + +namespace zilliz { +namespace milvus { + +class ConnectionImpl : public Connection { +public: + ConnectionImpl(); + + // Implementations of the Connection interface + virtual Status Connect(const ConnectParam ¶m) override; + + virtual Status Connect(const std::string &uri) override; + + virtual Status Connected() const override; + + virtual Status Disconnect() override; + + virtual Status CreateTable(const TableSchema ¶m) override; + + virtual bool HasTable(const std::string &table_name) override; + + virtual Status DropTable(const std::string &table_name) override; + + virtual Status BuildIndex(const std::string &table_name) override; + + virtual Status InsertVector(const std::string &table_name, + const std::vector &record_array, + std::vector &id_array) override; + + virtual Status SearchVector(const std::string &table_name, + const std::vector &query_record_array, + const std::vector &query_range_array, + int64_t topk, + std::vector &topk_query_result_array) override; + + virtual Status DescribeTable(const std::string &table_name, TableSchema &table_schema) override; + + virtual Status GetTableRowCount(const std::string &table_name, int64_t &row_count) override; + + virtual Status ShowTables(std::vector &table_array) override; + + virtual std::string ClientVersion() const override; + + virtual std::string ServerVersion() const override; + + virtual std::string ServerStatus() const override; + +private: + std::shared_ptr client_proxy_; +}; + +} +} diff --git a/cpp/src/grpcsdk/src/interface/Status.cpp b/cpp/src/grpcsdk/src/interface/Status.cpp new file mode 100644 index 0000000000..51fd7cc3fc --- /dev/null +++ b/cpp/src/grpcsdk/src/interface/Status.cpp @@ -0,0 +1,129 @@ +/******************************************************************************* +* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +* Unauthorized copying of this file, via any medium is strictly prohibited. +* Proprietary and confidential. +******************************************************************************/ +#include "Status.h" + +namespace zilliz { +namespace milvus { + +Status::~Status() noexcept { + if (state_ != nullptr) { + delete state_; + state_ = nullptr; + } +} + +static inline std::ostream &operator<<(std::ostream &os, const Status &x) { + os << x.ToString(); + return os; +} + +void Status::MoveFrom(Status &s) { + delete state_; + state_ = s.state_; + s.state_ = nullptr; +} + +Status::Status(const Status &s) + : state_((s.state_ == nullptr) ? nullptr : new State(*s.state_)) {} + +Status &Status::operator=(const Status &s) { + if (state_ != s.state_) { + CopyFrom(s); + } + return *this; +} + +Status &Status::operator=(Status &&s) noexcept { + MoveFrom(s); + return *this; +} + +Status Status::operator&(const Status &status) const noexcept { + if (ok()) { + return status; + } else { + return *this; + } +} + +Status Status::operator&(Status &&s) const noexcept { + if (ok()) { + return std::move(s); + } else { + return *this; + } +} + +Status &Status::operator&=(const Status &s) noexcept { + if (ok() && !s.ok()) { + CopyFrom(s); + } + return *this; +} + +Status &Status::operator&=(Status &&s) noexcept { + if (ok() && !s.ok()) { + MoveFrom(s); + } + return *this; +} + +Status::Status(StatusCode code, const std::string &message) { + state_ = new State; + state_->code = code; + state_->message = message; +} + +void Status::CopyFrom(const Status &status) { + delete state_; + if (status.state_ == nullptr) { + state_ = nullptr; + } else { + state_ = new State(*status.state_); + } +} + +std::string Status::CodeAsString() const { + if (state_ == nullptr) { + return "OK"; + } + + const char *type = nullptr; + switch (code()) { + case StatusCode::OK: + type = "OK"; + break; + case StatusCode::InvalidAgument: + type = "Invalid agument"; + break; + case StatusCode::UnknownError: + type = "Unknown error"; + break; + case StatusCode::NotSupported: + type = "Not Supported"; + break; + case StatusCode::NotConnected: + type = "Not Connected"; + break; + default: + type = "Unknown"; + break; + } + return std::string(type); +} + +std::string Status::ToString() const { + std::string result(CodeAsString()); + if (state_ == nullptr) { + return result; + } + result += ": "; + result += state_->message; + return result; +} + +} +} diff --git a/cpp/src/grpcsdk/src/util/Exception.h b/cpp/src/grpcsdk/src/util/Exception.h new file mode 100644 index 0000000000..bb7fc09241 --- /dev/null +++ b/cpp/src/grpcsdk/src/util/Exception.h @@ -0,0 +1,34 @@ +/******************************************************************************* +* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +* Unauthorized copying of this file, via any medium is strictly prohibited. +* Proprietary and confidential. +******************************************************************************/ +#pragma once + +#include "Status.h" + +#include + +namespace zilliz { +namespace milvus { +class Exception : public std::exception { +public: + Exception(StatusCode error_code, + const std::string &message = std::string()) + : error_code_(error_code), message_(message) {} + +public: + StatusCode error_code() const { + return error_code_; + } + + virtual const char *what() const noexcept { + return message_.c_str(); + } + +private: + StatusCode error_code_; + std::string message_; +}; +} +} \ No newline at end of file diff --git a/cpp/src/grpcserver/DBWrapper.cpp b/cpp/src/grpcserver/DBWrapper.cpp new file mode 100644 index 0000000000..6c67176571 --- /dev/null +++ b/cpp/src/grpcserver/DBWrapper.cpp @@ -0,0 +1,102 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ + +#include "DBWrapper.h" +#include "ServerConfig.h" +#include "utils/CommonUtil.h" +#include "utils/Log.h" +#include "utils/StringHelpFunctions.h" + +namespace zilliz { +namespace milvus { +namespace server { + +DBWrapper::DBWrapper() { + zilliz::milvus::engine::Options opt; + ConfigNode& config = ServerConfig::GetInstance().GetConfig(CONFIG_DB); + opt.meta.backend_uri = config.GetValue(CONFIG_DB_URL); + std::string db_path = config.GetValue(CONFIG_DB_PATH); + opt.meta.path = db_path + "/db"; + + std::string db_slave_path = config.GetValue(CONFIG_DB_SLAVE_PATH); + StringHelpFunctions::SplitStringByDelimeter(db_slave_path, ";", opt.meta.slave_paths); + + int64_t index_size = config.GetInt64Value(CONFIG_DB_INDEX_TRIGGER_SIZE); + if(index_size > 0) {//ensure larger than zero, unit is MB + opt.index_trigger_size = (size_t)index_size * engine::ONE_MB; + } + int64_t insert_buffer_size = config.GetInt64Value(CONFIG_DB_INSERT_BUFFER_SIZE, 4); + if (insert_buffer_size >= 1) { + opt.insert_buffer_size = insert_buffer_size * engine::ONE_GB; + } + else { + std::cout << "ERROR: insert_buffer_size should be at least 1 GB" << std::endl; + kill(0, SIGUSR1); + } + + ConfigNode& serverConfig = ServerConfig::GetInstance().GetConfig(CONFIG_SERVER); + std::string mode = serverConfig.GetValue(CONFIG_CLUSTER_MODE, "single"); + if (mode == "single") { + opt.mode = zilliz::milvus::engine::Options::MODE::SINGLE; + } + else if (mode == "cluster") { + opt.mode = zilliz::milvus::engine::Options::MODE::CLUSTER; + } + else if (mode == "read_only") { + opt.mode = zilliz::milvus::engine::Options::MODE::READ_ONLY; + } + else { + std::cout << "ERROR: mode specified in server_config is not one of ['single', 'cluster', 'read_only']" << std::endl; + kill(0, SIGUSR1); + } + + //set archive config + engine::ArchiveConf::CriteriaT criterial; + int64_t disk = config.GetInt64Value(CONFIG_DB_ARCHIVE_DISK, 0); + int64_t days = config.GetInt64Value(CONFIG_DB_ARCHIVE_DAYS, 0); + if(disk > 0) { + criterial[engine::ARCHIVE_CONF_DISK] = disk; + } + if(days > 0) { + criterial[engine::ARCHIVE_CONF_DAYS] = days; + } + opt.meta.archive_conf.SetCriterias(criterial); + + //create db root folder + ServerError err = CommonUtil::CreateDirectory(opt.meta.path); + if(err != SERVER_SUCCESS) { + std::cout << "ERROR! Failed to create database root path: " << opt.meta.path << std::endl; + kill(0, SIGUSR1); + } + + for(auto& path : opt.meta.slave_paths) { + err = CommonUtil::CreateDirectory(path); + if(err != SERVER_SUCCESS) { + std::cout << "ERROR! Failed to create database slave path: " << path << std::endl; + kill(0, SIGUSR1); + } + } + + std::string msg = opt.meta.path; + try { + zilliz::milvus::engine::DB::Open(opt, &db_); + } catch(std::exception& ex) { + msg = ex.what(); + } + + if(db_ == nullptr) { + std::cout << "ERROR! Failed to open database: " << msg << std::endl; + kill(0, SIGUSR1); + } +} + +DBWrapper::~DBWrapper() { + delete db_; +} + +} +} +} \ No newline at end of file diff --git a/cpp/src/grpcserver/DBWrapper.h b/cpp/src/grpcserver/DBWrapper.h new file mode 100644 index 0000000000..5bd09bd0f4 --- /dev/null +++ b/cpp/src/grpcserver/DBWrapper.h @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#pragma once + +#include "db/DB.h" +#include "db/Meta.h" + +namespace zilliz { +namespace milvus { +namespace server { + +class DBWrapper { +private: + DBWrapper(); + ~DBWrapper(); + +public: + static zilliz::milvus::engine::DB* DB() { + static DBWrapper db_wrapper; + return db_wrapper.db(); + } + + zilliz::milvus::engine::DB* db() { return db_; } + +private: + zilliz::milvus::engine::DB* db_ = nullptr; +}; + +} +} +} diff --git a/cpp/src/grpcserver/MilvusServer.cpp b/cpp/src/grpcserver/MilvusServer.cpp new file mode 100644 index 0000000000..781521ea79 --- /dev/null +++ b/cpp/src/grpcserver/MilvusServer.cpp @@ -0,0 +1,101 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#include "milvus.grpc.pb.h" +#include "MilvusServer.h" +#include "ServerConfig.h" +#include "DBWrapper.h" +#include "utils/Log.h" +#include "faiss/utils.h" +#include "RequestHandler.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace zilliz { +namespace milvus { +namespace server { +using grpc::Server; +using grpc::ServerBuilder; +using grpc::ServerContext; +using grpc::ServerReader; +using grpc::ServerReaderWriter; +using grpc::ServerWriter; +using grpc::Status; + +static std::unique_ptr server; + +void +MilvusServer::StartService() { + if (server != nullptr){ + std::cout << "stopservice!\n"; + StopService(); + } + + ServerConfig &config = ServerConfig::GetInstance(); + ConfigNode server_config = config.GetConfig(CONFIG_SERVER); + ConfigNode engine_config = config.GetConfig(CONFIG_ENGINE); + std::string address = server_config.GetValue(CONFIG_SERVER_ADDRESS, "127.0.0.1"); + int32_t port = server_config.GetInt32Value(CONFIG_SERVER_PORT, 19530); + + faiss::distance_compute_blas_threshold = engine_config.GetInt32Value(CONFIG_DCBT, 20); + //TODO:add exception handle + DBWrapper::DB();//initialize db + + std::string server_address("127.0.0.1:19530"); + + ServerBuilder builder; + builder.SetMaxReceiveMessageSize(400 * 1024 * 1024); //default 4 * 1024 * 1024 + builder.SetMaxSendMessageSize(400 * 1024 * 1024); + + builder.SetCompressionAlgorithmSupportStatus(GRPC_COMPRESS_STREAM_GZIP, true); + +// builder.SetDefaultCompressionAlgorithm(GRPC_COMPRESS_DEFLATE); +// builder.SetDefaultCompressionAlgorithm(GRPC_COMPRESS_GZIP); + builder.SetDefaultCompressionAlgorithm(GRPC_COMPRESS_STREAM_GZIP); +// builder.SetDefaultCompressionAlgorithm(GRPC_COMPRESS_ALGORITHMS_COUNT); + builder.SetDefaultCompressionLevel(GRPC_COMPRESS_LEVEL_HIGH); + + RequestHandler service; + + builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); + + builder.RegisterService(&service); + + builder.SetSyncServerOption(builder.MIN_POLLERS, 10); + builder.SetSyncServerOption(builder.MAX_POLLERS, 10); + + server = builder.BuildAndStart(); + + server->Wait(); + +} + +void +MilvusServer::StopService() { + auto stop_server_worker = [&]{ + if (server != nullptr) { + server->Shutdown(); + } + }; + + std::shared_ptr stop_thread = std::make_shared(stop_server_worker); + stop_thread->join(); +} + +} +} +} \ No newline at end of file diff --git a/cpp/src/grpcserver/MilvusServer.h b/cpp/src/grpcserver/MilvusServer.h new file mode 100644 index 0000000000..10966300e4 --- /dev/null +++ b/cpp/src/grpcserver/MilvusServer.h @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +using grpc::Channel; +using grpc::ClientContext; +using grpc::ClientReader; +using grpc::ClientReaderWriter; +using grpc::ClientWriter; + +namespace zilliz { +namespace milvus { +namespace server { +class MilvusServer { +public: + static void StartService(); + static void StopService(); +}; + +} +} +} diff --git a/cpp/src/grpcserver/RequestHandler.cpp b/cpp/src/grpcserver/RequestHandler.cpp new file mode 100644 index 0000000000..37f7d2f780 --- /dev/null +++ b/cpp/src/grpcserver/RequestHandler.cpp @@ -0,0 +1,120 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ + +#include "RequestHandler.h" +#include "RequestTask.h" +#include "utils/TimeRecorder.h" + +namespace zilliz { +namespace milvus { +namespace server { + +::grpc::Status +RequestHandler::CreateTable(::grpc::ServerContext *context, const ::milvus::grpc::TableSchema *request, ::milvus::Status *response) { + BaseTaskPtr task_ptr = CreateTableTask::Create(*request); + RequestScheduler::ExecTask(task_ptr, response); + return ::grpc::Status::OK; +} + +//TODO: handle Response +::grpc::Status +RequestHandler::HasTable(::grpc::ServerContext *context, const ::milvus::grpc::TableName *request, ::milvus::grpc::BoolReply *response) { + bool has_table = false; + BaseTaskPtr task_ptr = HasTableTask::Create(request->table_name(), has_table); + ::milvus::Status grpc_status; + RequestScheduler::ExecTask(task_ptr, &grpc_status); + response->set_bool_reply(has_table); + response->mutable_status()->set_reason(grpc_status.reason()); + response->mutable_status()->set_error_code(grpc_status.error_code()); + return ::grpc::Status::OK; +} + +::grpc::Status +RequestHandler::DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) { + BaseTaskPtr task_ptr = DropTableTask::Create(request->table_name()); + RequestScheduler::ExecTask(task_ptr, response); + return ::grpc::Status::OK; +} + +::grpc::Status +RequestHandler::BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) { + BaseTaskPtr task_ptr = BuildIndexTask::Create(request->table_name()); + RequestScheduler::ExecTask(task_ptr, response); + return ::grpc::Status::OK; +} + +::grpc::Status +RequestHandler::InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response) { + BaseTaskPtr task_ptr = InsertVectorTask::Create(*request, *response); + ::milvus::Status grpc_status; + RequestScheduler::ExecTask(task_ptr, &grpc_status); + response->mutable_status()->set_reason(grpc_status.reason()); + response->mutable_status()->set_error_code(grpc_status.error_code()); + return ::grpc::Status::OK; +} + +::grpc::Status +RequestHandler::SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer) { + std::vector file_id_array; + //TODO: handle status + BaseTaskPtr task_ptr = SearchVectorTask::Create(*request, file_id_array, *writer); + RequestScheduler::ExecTask(task_ptr, nullptr); + return ::grpc::Status::OK; +} + +::grpc::Status +RequestHandler::SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer) { + std::vector file_id_array; + BaseTaskPtr task_ptr = SearchVectorTask::Create(request->search_vector_infos(), file_id_array, *writer); + RequestScheduler::ExecTask(task_ptr, nullptr); + return ::grpc::Status::OK; +} + +::grpc::Status +RequestHandler::DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) { + BaseTaskPtr task_ptr = DescribeTableTask::Create(request->table_name(), response); + ::milvus::Status grpc_status; + RequestScheduler::ExecTask(task_ptr, &grpc_status); + response->mutable_table_name()->mutable_status()->set_error_code(grpc_status.error_code()); + response->mutable_table_name()->mutable_status()->set_reason(grpc_status.reason()); + return ::grpc::Status::OK; +} + +::grpc::Status +RequestHandler::GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) { + int64_t row_count = 0; + BaseTaskPtr task_ptr = GetTableRowCountTask::Create(request->table_name(), row_count); + ::milvus::Status grpc_status; + RequestScheduler::ExecTask(task_ptr, &grpc_status); + response->set_table_row_count(row_count); + response->mutable_status()->set_reason(grpc_status.reason()); + response->mutable_status()->set_error_code(grpc_status.error_code()); + return ::grpc::Status::OK; +} + +::grpc::Status +RequestHandler::ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer) { + BaseTaskPtr task_ptr = ShowTablesTask::Create(*writer); + RequestScheduler::ExecTask(task_ptr, nullptr); + return ::grpc::Status::OK; +} + +::grpc::Status +RequestHandler::Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response) { + std::string result; + BaseTaskPtr task_ptr = PingTask::Create(request->cmd(), result); + ::milvus::Status grpc_status; + RequestScheduler::ExecTask(task_ptr, &grpc_status); + response->set_info(result); + response->mutable_status()->set_reason(grpc_status.reason()); + response->mutable_status()->set_error_code(grpc_status.error_code()); + return ::grpc::Status::OK; +} + + +} +} +} \ No newline at end of file diff --git a/cpp/src/grpcserver/RequestHandler.h b/cpp/src/grpcserver/RequestHandler.h new file mode 100644 index 0000000000..abc8ad574b --- /dev/null +++ b/cpp/src/grpcserver/RequestHandler.h @@ -0,0 +1,175 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#pragma once + +#include +#include + +#include "milvus.grpc.pb.h" +#include "status.pb.h" + +namespace zilliz { +namespace milvus { +namespace server { +class RequestHandler final : public ::milvus::grpc::MilvusService::Service { +public: + /** + * @brief Create table method + * + * This method is used to create table + * + * @param param, use to provide table information to be created. + * + * + * @param param + */ + ::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response); + + /** + * @brief Test table existence method + * + * This method is used to test table existence. + * + * @param table_name, table name is going to be tested. + * + * + * @param table_name + */ + ::grpc::Status HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response); + + /** + * @brief Drop table method + * + * This method is used to drop table. + * + * @param table_name, table name is going to be deleted. + * + * + * @param table_name + */ + ::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response); + + /** + * @brief build index by table method + * + * This method is used to build index by table in sync. + * + * @param table_name, table name is going to be built index. + * + * + * @param table_name + */ + ::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response); + + + /** + * @brief Insert vector array to table + * + * This method is used to insert vector array to table. + * + * @param table_name, table_name is inserted. + * @param record_array, vector array is inserted. + * + * @return vector id array + * + * @param table_name + * @param record_array + */ + ::grpc::Status InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response); + + /** + * @brief Query vector + * + * This method is used to query vector in table. + * + * @param table_name, table_name is queried. + * @param query_record_array, all vector are going to be queried. + * @param query_range_array, optional ranges for conditional search. If not specified, search whole table + * @param topk, how many similarity vectors will be searched. + * + * @return query result array. + * + * @param table_name + * @param query_record_array + * @param query_range_array + * @param topk + */ + ::grpc::Status SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer); + + /** + * @brief Internal use query interface + * + * This method is used to query vector in specified files. + * + * @param file_id_array, specified files id array, queried. + * @param query_record_array, all vector are going to be queried. + * @param query_range_array, optional ranges for conditional search. If not specified, search whole table + * @param topk, how many similarity vectors will be searched. + * + * @return query result array. + * + * @param file_id_array + * @param query_record_array + * @param query_range_array + * @param topk + */ + ::grpc::Status SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer); + + /** + * @brief Get table schema + * + * This method is used to get table schema. + * + * @param table_name, target table name. + * + * @return table schema + * + * @param table_name + */ + ::grpc::Status DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response); + + /** + * @brief Get table row count + * + * This method is used to get table row count. + * + * @param table_name, target table name. + * + * @return table row count + * + * @param table_name + */ + ::grpc::Status GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response); + + /** + * @brief List all tables in database + * + * This method is used to list all tables. + * + * + * @return table names. + */ + ::grpc::Status ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer); + + /** + * @brief Give the server status + * + * + * This method is used to give the server status. + * + * @return Server status. + * + * @param cmd + */ + ::grpc::Status Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response); + +}; +} +} +} + + + diff --git a/cpp/src/grpcserver/RequestScheduler.cpp b/cpp/src/grpcserver/RequestScheduler.cpp new file mode 100644 index 0000000000..c290d95b9f --- /dev/null +++ b/cpp/src/grpcserver/RequestScheduler.cpp @@ -0,0 +1,221 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#include "RequestScheduler.h" +#include "utils/Log.h" + +#include "../grpc/gen-status/status.pb.h" + +namespace zilliz { +namespace milvus { +namespace server { + +using namespace ::milvus; + +namespace { + const std::map &ErrorMap() { + static const std::map code_map = { + {SERVER_UNEXPECTED_ERROR, ErrorCode::UNEXPECTED_ERROR}, + {SERVER_UNSUPPORTED_ERROR, ErrorCode::UNEXPECTED_ERROR}, + {SERVER_NULL_POINTER, ErrorCode::UNEXPECTED_ERROR}, + {SERVER_INVALID_ARGUMENT, ErrorCode::ILLEGAL_ARGUMENT}, + {SERVER_FILE_NOT_FOUND, ErrorCode::FILE_NOT_FOUND}, + {SERVER_NOT_IMPLEMENT, ErrorCode::UNEXPECTED_ERROR}, + {SERVER_BLOCKING_QUEUE_EMPTY, ErrorCode::UNEXPECTED_ERROR}, + {SERVER_CANNOT_CREATE_FOLDER, ErrorCode::CANNOT_CREATE_FOLDER}, + {SERVER_CANNOT_CREATE_FILE, ErrorCode::CANNOT_CREATE_FILE}, + {SERVER_CANNOT_DELETE_FOLDER, ErrorCode::CANNOT_DELETE_FOLDER}, + {SERVER_CANNOT_DELETE_FILE, ErrorCode::CANNOT_DELETE_FILE}, + {SERVER_TABLE_NOT_EXIST, ErrorCode::TABLE_NOT_EXISTS}, + {SERVER_INVALID_TABLE_NAME, ErrorCode::ILLEGAL_TABLE_NAME}, + {SERVER_INVALID_TABLE_DIMENSION, ErrorCode::ILLEGAL_DIMENSION}, + {SERVER_INVALID_TIME_RANGE, ErrorCode::ILLEGAL_RANGE}, + {SERVER_INVALID_VECTOR_DIMENSION, ErrorCode::ILLEGAL_DIMENSION}, + + {SERVER_INVALID_INDEX_TYPE, ErrorCode::ILLEGAL_INDEX_TYPE}, + {SERVER_INVALID_ROWRECORD, ErrorCode::ILLEGAL_ROWRECORD}, + {SERVER_INVALID_ROWRECORD_ARRAY, ErrorCode::ILLEGAL_ROWRECORD}, + {SERVER_INVALID_TOPK, ErrorCode::ILLEGAL_TOPK}, + {SERVER_ILLEGAL_VECTOR_ID, ErrorCode::ILLEGAL_VECTOR_ID}, + {SERVER_ILLEGAL_SEARCH_RESULT, ErrorCode::ILLEGAL_SEARCH_RESULT}, + {SERVER_CACHE_ERROR, ErrorCode::CACHE_FAILED}, + {DB_META_TRANSACTION_FAILED, ErrorCode::META_FAILED}, + {SERVER_BUILD_INDEX_ERROR, ErrorCode::BUILD_INDEX_ERROR}, + }; + + return code_map; + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +BaseTask::BaseTask(const std::string& task_group, bool async) + : task_group_(task_group), + async_(async), + done_(false), + error_code_(SERVER_SUCCESS) { + +} + +BaseTask::~BaseTask() { + WaitToFinish(); +} + +ServerError BaseTask::Execute() { + error_code_ = OnExecute(); + done_ = true; + finish_cond_.notify_all(); + return error_code_; +} + +ServerError BaseTask::SetError(ServerError error_code, const std::string& error_msg) { + error_code_ = error_code; + error_msg_ = error_msg; + + SERVER_LOG_ERROR << error_msg_; + return error_code_; +} + +ServerError BaseTask::WaitToFinish() { + std::unique_lock lock(finish_mtx_); + finish_cond_.wait(lock, [this] { return done_; }); + + return error_code_; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +RequestScheduler::RequestScheduler() + : stopped_(false) { + Start(); +} + +RequestScheduler::~RequestScheduler() { + Stop(); +} + +void RequestScheduler::ExecTask(BaseTaskPtr& task_ptr, ::milvus::Status *grpc_status) { + if(task_ptr == nullptr) { + return; + } + + RequestScheduler& scheduler = RequestScheduler::GetInstance(); + scheduler.ExecuteTask(task_ptr); + + if(!task_ptr->IsAsync()) { + task_ptr->WaitToFinish(); + ServerError err = task_ptr->ErrorCode(); + if (err != SERVER_SUCCESS) { + //TODO:Handle exception + grpc_status->set_reason(task_ptr->ErrorMsg()); + grpc_status->set_error_code(::milvus::ErrorCode((int) err)); +// grpc_status.set_error_code(err); +// Exception ex; +// ex.__set_code(ErrorMap().at(err)); +// std::string msg = task_ptr->ErrorMsg(); +// if(msg.empty()){ +// msg = "Error message not set"; +// } +// ex.__set_reason(msg); +// throw ex; + } + } +} + +void RequestScheduler::Start() { + if(!stopped_) { + return; + } + + stopped_ = false; +} + +void RequestScheduler::Stop() { + if(stopped_) { + return; + } + + SERVER_LOG_INFO << "Scheduler gonna stop..."; + { + std::lock_guard lock(queue_mtx_); + for(auto iter : task_groups_) { + if(iter.second != nullptr) { + iter.second->Put(nullptr); + } + } + } + + for(auto iter : execute_threads_) { + if(iter == nullptr) + continue; + + iter->join(); + } + stopped_ = true; + SERVER_LOG_INFO << "Scheduler stopped"; +} + +ServerError RequestScheduler::ExecuteTask(const BaseTaskPtr& task_ptr) { + if(task_ptr == nullptr) { + return SERVER_NULL_POINTER; + } + + ServerError err = PutTaskToQueue(task_ptr); + if(err != SERVER_SUCCESS) { + return err; + } + + if(task_ptr->IsAsync()) { + return SERVER_SUCCESS;//async execution, caller need to call WaitToFinish at somewhere + } + + return task_ptr->WaitToFinish();//sync execution +} + +namespace { + void TakeTaskToExecute(TaskQueuePtr task_queue) { + if(task_queue == nullptr) { + return; + } + + while(true) { + BaseTaskPtr task = task_queue->Take(); + if (task == nullptr) { + break;//stop the thread + } + + try { + ServerError err = task->Execute(); + if(err != SERVER_SUCCESS) { + SERVER_LOG_ERROR << "Task failed with code: " << err; + } + } catch (std::exception& ex) { + SERVER_LOG_ERROR << "Task failed to execute: " << ex.what(); + } + } + } +} + +ServerError RequestScheduler::PutTaskToQueue(const BaseTaskPtr& task_ptr) { + std::lock_guard lock(queue_mtx_); + + std::string group_name = task_ptr->TaskGroup(); + if(task_groups_.count(group_name) > 0) { + task_groups_[group_name]->Put(task_ptr); + } else { + TaskQueuePtr queue = std::make_shared(); + queue->Put(task_ptr); + task_groups_.insert(std::make_pair(group_name, queue)); + + //start a thread + ThreadPtr thread = std::make_shared(&TakeTaskToExecute, queue); + execute_threads_.push_back(thread); + SERVER_LOG_INFO << "Create new thread for task group: " << group_name; + } + + return SERVER_SUCCESS; +} + +} +} +} diff --git a/cpp/src/grpcserver/RequestScheduler.h b/cpp/src/grpcserver/RequestScheduler.h new file mode 100644 index 0000000000..c4440cdffe --- /dev/null +++ b/cpp/src/grpcserver/RequestScheduler.h @@ -0,0 +1,90 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#pragma once + +#include "utils/BlockingQueue.h" +#include "status.grpc.pb.h" +#include "status.pb.h" + +#include +#include +#include + +namespace zilliz { +namespace milvus { +namespace server { + +class BaseTask { +protected: + BaseTask(const std::string& task_group, bool async = false); + virtual ~BaseTask(); + +public: + ServerError Execute(); + ServerError WaitToFinish(); + + std::string TaskGroup() const { return task_group_; } + + ServerError ErrorCode() const { return error_code_; } + std::string ErrorMsg() const { return error_msg_; } + + bool IsAsync() const { return async_; } + +protected: + virtual ServerError OnExecute() = 0; + + ServerError SetError(ServerError error_code, const std::string& msg); + +protected: + mutable std::mutex finish_mtx_; + std::condition_variable finish_cond_; + + std::string task_group_; + bool async_; + bool done_; + ServerError error_code_; + std::string error_msg_; +}; + +using BaseTaskPtr = std::shared_ptr; +using TaskQueue = BlockingQueue; +using TaskQueuePtr = std::shared_ptr; +using ThreadPtr = std::shared_ptr; + +class RequestScheduler { +public: + static RequestScheduler& GetInstance() { + static RequestScheduler scheduler; + return scheduler; + } + + void Start(); + void Stop(); + + ServerError ExecuteTask(const BaseTaskPtr& task_ptr); + + static void ExecTask(BaseTaskPtr& task_ptr, ::milvus::Status* grpc_status); + +protected: + RequestScheduler(); + virtual ~RequestScheduler(); + + ServerError PutTaskToQueue(const BaseTaskPtr& task_ptr); + +private: + mutable std::mutex queue_mtx_; + + std::map task_groups_; + + std::vector execute_threads_; + + bool stopped_; +}; + + +} +} +} diff --git a/cpp/src/grpcserver/RequestTask.cpp b/cpp/src/grpcserver/RequestTask.cpp new file mode 100644 index 0000000000..06b2218b4c --- /dev/null +++ b/cpp/src/grpcserver/RequestTask.cpp @@ -0,0 +1,649 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#include "RequestTask.h" +#include "ServerConfig.h" +#include "utils/CommonUtil.h" +#include "utils/Log.h" +#include "utils/TimeRecorder.h" +#include "utils/ValidationUtil.h" +#include "DBWrapper.h" +#include "version.h" +#include "MilvusServer.h" + +#include "Server.h" + +namespace zilliz { +namespace milvus { +namespace server { +static const std::string DQL_TASK_GROUP = "dql"; +static const std::string DDL_DML_TASK_GROUP = "ddl_dml"; +static const std::string PING_TASK_GROUP = "ping"; + +using DB_META = zilliz::milvus::engine::meta::Meta; +using DB_DATE = zilliz::milvus::engine::meta::DateT; + +namespace { + engine::EngineType EngineType(int type) { + static std::map map_type = { + {0, engine::EngineType::INVALID}, + {1, engine::EngineType::FAISS_IDMAP}, + {2, engine::EngineType::FAISS_IVFFLAT}, + {3, engine::EngineType::FAISS_IVFSQ8}, + }; + + if(map_type.find(type) == map_type.end()) { + return engine::EngineType::INVALID; + } + + return map_type[type]; + } + + int IndexType(engine::EngineType type) { + static std::map map_type = { + {engine::EngineType::INVALID, 0}, + {engine::EngineType::FAISS_IDMAP, 1}, + {engine::EngineType::FAISS_IVFFLAT, 2}, + {engine::EngineType::FAISS_IVFSQ8, 3}, + }; + + if(map_type.find(type) == map_type.end()) { + return 0; + } + + return map_type[type]; + } + + void + ConvertRowRecordToFloatArray(const ::milvus::grpc::InsertInfos insert_infos, + uint64_t dimension, + std::vector& float_array) { + uint64_t vec_count = insert_infos.row_record_array_size(); + float_array.resize(vec_count * dimension);//allocate enough memory + for(uint64_t i = 0; i < vec_count; i++) { + for (uint64_t j = 0; j < dimension; j++) { + float_array[i * dimension + j] = insert_infos.row_record_array(i).vector_data(j); + } + } + } + + static constexpr long DAY_SECONDS = 86400; + + void + ConvertTimeRangeToDBDates(const std::vector<::milvus::grpc::Range> &range_array, + std::vector& dates, + ServerError& error_code, + std::string& error_msg) { + dates.clear(); + for(auto& range : range_array) { + time_t tt_start, tt_end; + tm tm_start, tm_end; + if(!CommonUtil::TimeStrToTime(range.start_value(), tt_start, tm_start)){ + error_code = SERVER_INVALID_TIME_RANGE; + error_msg = "Invalid time range: " + range.start_value(); + return; + } + + if(!CommonUtil::TimeStrToTime(range.end_value(), tt_end, tm_end)){ + error_code = SERVER_INVALID_TIME_RANGE; + error_msg = "Invalid time range: " + range.start_value(); + return; + } + + long days = (tt_end > tt_start) ? (tt_end - tt_start)/DAY_SECONDS : (tt_start - tt_end)/DAY_SECONDS; + if(days == 0) { + error_code = SERVER_INVALID_TIME_RANGE; + error_msg = "Invalid time range: " + range.start_value() + " to " + range.end_value(); + return ; + } + + for(long i = 0; i < days; i++) { + time_t tt_day = tt_start + DAY_SECONDS*i; + tm tm_day; + CommonUtil::ConvertTime(tt_day, tm_day); + + long date = tm_day.tm_year*10000 + tm_day.tm_mon*100 + tm_day.tm_mday;//according to db logic + dates.push_back(date); + } + } + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +CreateTableTask::CreateTableTask(const ::milvus::grpc::TableSchema schema) + : BaseTask(DDL_DML_TASK_GROUP), + schema_(schema) { + +} + +BaseTaskPtr CreateTableTask::Create(const ::milvus::grpc::TableSchema schema) { + return std::shared_ptr(new CreateTableTask(schema)); +} + +ServerError CreateTableTask::OnExecute() { + TimeRecorder rc("CreateTableTask"); + + try { + //step 1: check arguments + ServerError res = SERVER_SUCCESS; + res = ValidateTableName(schema_.table_name().table_name()); + if(res != SERVER_SUCCESS) { + return SetError(res, "Invalid table name: " + schema_.table_name().table_name()); + } + + res = ValidateTableDimension(schema_.dimension()); + if(res != SERVER_SUCCESS) { + return SetError(res, "Invalid table dimension: " + std::to_string(schema_.dimension())); + } + + res = ValidateTableIndexType(schema_.index_type()); + if(res != SERVER_SUCCESS) { + return SetError(res, "Invalid index type: " + std::to_string(schema_.index_type())); + } + + //step 2: construct table schema + engine::meta::TableSchema table_info; + table_info.dimension_ = (uint16_t)schema_.dimension(); + table_info.table_id_ = schema_.table_name().table_name(); + table_info.engine_type_ = (int)EngineType(schema_.index_type()); + table_info.store_raw_data_ = schema_.store_raw_vector(); + + //step 3: create table + engine::Status stat = DBWrapper::DB()->CreateTable(table_info); + if(!stat.ok()) {//table could exist + return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString()); + } + + } catch (std::exception& ex) { + return SetError(SERVER_UNEXPECTED_ERROR, ex.what()); + } + + rc.Record("done"); + + return SERVER_SUCCESS; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +DescribeTableTask::DescribeTableTask(const std::string &table_name, ::milvus::grpc::TableSchema *schema) + : BaseTask(DDL_DML_TASK_GROUP), + table_name_(table_name), + schema_(schema) { +} + +BaseTaskPtr DescribeTableTask::Create(const std::string& table_name, ::milvus::grpc::TableSchema *schema) { + return std::shared_ptr(new DescribeTableTask(table_name, schema)); +} + +ServerError DescribeTableTask::OnExecute() { + TimeRecorder rc("DescribeTableTask"); + + try { + //step 1: check arguments + ServerError res = SERVER_SUCCESS; + res = ValidateTableName(table_name_); + if(res != SERVER_SUCCESS) { + return SetError(res, "Invalid table name: " + table_name_); + } + + //step 2: get table info + engine::meta::TableSchema table_info; + table_info.table_id_ = table_name_; + engine::Status stat = DBWrapper::DB()->DescribeTable(table_info); + if(!stat.ok()) { + return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString()); + } + + schema_->mutable_table_name()->set_table_name(table_info.table_id_); + + schema_->set_index_type(IndexType((engine::EngineType)table_info.engine_type_)); + schema_->set_dimension(table_info.dimension_); + schema_->set_store_raw_vector(table_info.store_raw_data_); + + } catch (std::exception& ex) { + return SetError(SERVER_UNEXPECTED_ERROR, ex.what()); + } + + rc.Record("done"); + + return SERVER_SUCCESS; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +BuildIndexTask::BuildIndexTask(const std::string& table_name) + : BaseTask(DDL_DML_TASK_GROUP), + table_name_(table_name) { +} + +BaseTaskPtr BuildIndexTask::Create(const std::string& table_name) { + return std::shared_ptr(new BuildIndexTask(table_name)); +} + +ServerError BuildIndexTask::OnExecute() { + try { + TimeRecorder rc("BuildIndexTask"); + + //step 1: check arguments + ServerError res = SERVER_SUCCESS; + res = ValidateTableName(table_name_); + if(res != SERVER_SUCCESS) { + return SetError(res, "Invalid table name: " + table_name_); + } + + bool has_table = false; + engine::Status stat = DBWrapper::DB()->HasTable(table_name_, has_table); + if(!has_table) { + return SetError(SERVER_TABLE_NOT_EXIST, "Table " + table_name_ + " not exists"); + } + + //step 2: check table existence + stat = DBWrapper::DB()->BuildIndex(table_name_); + if(!stat.ok()) { + return SetError(SERVER_BUILD_INDEX_ERROR, "Engine failed: " + stat.ToString()); + } + + rc.Elapse("totally cost"); + } catch (std::exception& ex) { + return SetError(SERVER_UNEXPECTED_ERROR, ex.what()); + } + + return SERVER_SUCCESS; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +HasTableTask::HasTableTask(const std::string table_name, bool& has_table) + : BaseTask(DDL_DML_TASK_GROUP), + table_name_(table_name), + has_table_(has_table) { + +} + +BaseTaskPtr HasTableTask::Create(const std::string table_name, bool& has_table) { + return std::shared_ptr(new HasTableTask(table_name, has_table)); +} + +ServerError HasTableTask::OnExecute() { + try { + TimeRecorder rc("HasTableTask"); + + //step 1: check arguments + ServerError res = SERVER_SUCCESS; + res = ValidateTableName(table_name_); + if(res != SERVER_SUCCESS) { + return SetError(res, "Invalid table name: " + table_name_); + } + + //step 2: check table existence + engine::Status stat = DBWrapper::DB()->HasTable(table_name_, has_table_); + if(!stat.ok()) { + return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString()); + } + + rc.Elapse("totally cost"); + } catch (std::exception& ex) { + return SetError(SERVER_UNEXPECTED_ERROR, ex.what()); + } + + return SERVER_SUCCESS; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +DropTableTask::DropTableTask(const std::string& table_name) + : BaseTask(DDL_DML_TASK_GROUP), + table_name_(table_name) { + +} + +BaseTaskPtr DropTableTask::Create(const std::string& table_name) { + return std::shared_ptr(new DropTableTask(table_name)); +} + +ServerError DropTableTask::OnExecute() { + try { + TimeRecorder rc("DropTableTask"); + + //step 1: check arguments + ServerError res = SERVER_SUCCESS; + res = ValidateTableName(table_name_); + if(res != SERVER_SUCCESS) { + return SetError(res, "Invalid table name: " + table_name_); + } + + //step 2: check table existence + engine::meta::TableSchema table_info; + table_info.table_id_ = table_name_; + engine::Status stat = DBWrapper::DB()->DescribeTable(table_info); + if(!stat.ok()) { + if(stat.IsNotFound()) { + return SetError(SERVER_TABLE_NOT_EXIST, "Table " + table_name_ + " not exists"); + } else { + return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString()); + } + } + + rc.Record("check validation"); + + //step 3: Drop table + std::vector dates; + stat = DBWrapper::DB()->DeleteTable(table_name_, dates); + if(!stat.ok()) { + return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString()); + } + + rc.Record("drop table"); + rc.Elapse("total cost"); + } catch (std::exception& ex) { + return SetError(SERVER_UNEXPECTED_ERROR, ex.what()); + } + + return SERVER_SUCCESS; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +ShowTablesTask::ShowTablesTask(::grpc::ServerWriter< ::milvus::grpc::TableName> writer) + : BaseTask(DDL_DML_TASK_GROUP), + writer_(writer) { + +} + +BaseTaskPtr ShowTablesTask::Create(::grpc::ServerWriter< ::milvus::grpc::TableName> writer) { + return std::shared_ptr(new ShowTablesTask(writer)); +} + +ServerError ShowTablesTask::OnExecute() { + std::vector schema_array; + engine::Status stat = DBWrapper::DB()->AllTables(schema_array); + if(!stat.ok()) { + return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString()); + } + + for(auto& schema : schema_array) { + ::milvus::grpc::TableName tableName; + tableName.set_table_name(schema.table_id_); + writer_.Write(tableName); + } + return SERVER_SUCCESS; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +InsertVectorTask::InsertVectorTask(const ::milvus::grpc::InsertInfos insert_infos, + ::milvus::grpc::VectorIds& record_ids) + : BaseTask(DDL_DML_TASK_GROUP), + insert_infos_(insert_infos), + record_ids_(record_ids) { + record_ids_.Clear(); +} + +BaseTaskPtr InsertVectorTask::Create(const ::milvus::grpc::InsertInfos insert_infos, + ::milvus::grpc::VectorIds& record_ids) { + return std::shared_ptr(new InsertVectorTask(insert_infos, record_ids)); +} + +ServerError InsertVectorTask::OnExecute() { + try { + TimeRecorder rc("InsertVectorTask"); + + //step 1: check arguments + ServerError res = SERVER_SUCCESS; + res = ValidateTableName(insert_infos_.table_name()); + if(res != SERVER_SUCCESS) { + return SetError(res, "Invalid table name: " + insert_infos_.table_name()); + } + if(insert_infos_.row_record_array().empty()) { + return SetError(SERVER_INVALID_ROWRECORD_ARRAY, "Row record array is empty"); + } + + //step 2: check table existence + engine::meta::TableSchema table_info; + table_info.table_id_ = insert_infos_.table_name(); + engine::Status stat = DBWrapper::DB()->DescribeTable(table_info); + if(!stat.ok()) { + if(stat.IsNotFound()) { + return SetError(SERVER_TABLE_NOT_EXIST, "Table " + insert_infos_.table_name() + " not exists"); + } else { + return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString()); + } + } + + rc.Record("check validation"); + + //step 3: prepare float data + std::vector vec_f; + + vec_f.resize(insert_infos_.row_record_array_size() * table_info.dimension_); + for (size_t i = 0; i < insert_infos_.row_record_array_size(); i++) { + for (size_t j = 0; j < table_info.dimension_; j++) { + vec_f[i * table_info.dimension_ + j] = insert_infos_.row_record_array(i).vector_data(j); + } + } + + rc.Record("prepare vectors data"); + + //step 4: insert vectors + uint64_t vec_count = (uint64_t)insert_infos_.row_record_array_size(); + std::vector vec_ids; + vec_ids.resize(record_ids_.vector_id_array_size()); + vec_ids.clear(); + + stat = DBWrapper::DB()->InsertVectors(insert_infos_.table_name(), vec_count, vec_f.data(), vec_ids); + rc.Record("add vectors to engine"); + if(!stat.ok()) { + return SetError(SERVER_CACHE_ERROR, "Cache error: " + stat.ToString()); + } + for (size_t i = 0; i < vec_ids.size(); i++) { + record_ids_.add_vector_id_array(vec_ids.at(i)); + } + + if(record_ids_.vector_id_array_size() != vec_count) { + std::string msg = "Add " + std::to_string(vec_count) + " vectors but only return " + + std::to_string(record_ids_.vector_id_array_size()) + " id"; + return SetError(SERVER_ILLEGAL_VECTOR_ID, msg); + } + + rc.Record("do insert"); + rc.Elapse("total cost"); + + } catch (std::exception& ex) { + return SetError(SERVER_UNEXPECTED_ERROR, ex.what()); + } + + return SERVER_SUCCESS; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +SearchVectorTask::SearchVectorTask(const ::milvus::grpc::SearchVectorInfos searchVectorInfos, + const std::vector file_id_array, + ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult> writer) + : BaseTask(DQL_TASK_GROUP), + searchVector_infos_(searchVectorInfos), + file_id_array_(file_id_array), + writer_(writer) { + +} + +BaseTaskPtr SearchVectorTask::Create(const ::milvus::grpc::SearchVectorInfos searchVectorInfos, + const std::vector file_id_array, + ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult> writer) { + return std::shared_ptr(new SearchVectorTask(searchVectorInfos, file_id_array, + writer)); +} + +ServerError SearchVectorTask::OnExecute() { + try { + TimeRecorder rc("SearchVectorTask"); + + //step 1: check arguments + ServerError res = SERVER_SUCCESS; + std::string table_name_ = searchVector_infos_.table_name(); + res = ValidateTableName(table_name_); + if(res != SERVER_SUCCESS) { + return SetError(res, "Invalid table name: " + table_name_); + } + + int top_k_ = searchVector_infos_.topk(); + + if(top_k_ <= 0) { + return SetError(SERVER_INVALID_TOPK, "Invalid topk: " + std::to_string( + top_k_)); + } + if(searchVector_infos_.query_record_array().empty()) { + return SetError(SERVER_INVALID_ROWRECORD_ARRAY, "Row record array is empty"); + } + + //step 2: check table existence + engine::meta::TableSchema table_info; + table_info.table_id_ = table_name_; + engine::Status stat = DBWrapper::DB()->DescribeTable(table_info); + if(!stat.ok()) { + if(stat.IsNotFound()) { + return SetError(SERVER_TABLE_NOT_EXIST, "Table " + table_name_ + " not exists"); + } else { + return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString()); + } + } + + //step 3: check date range, and convert to db dates + std::vector dates; + ServerError error_code = SERVER_SUCCESS; + std::string error_msg; + + std::vector<::milvus::grpc::Range> range_array; + for (size_t i = 0; i < searchVector_infos_.query_range_array_size(); i++) { + range_array.emplace_back(searchVector_infos_.query_range_array(i)); + } + ConvertTimeRangeToDBDates(range_array, dates, error_code, error_msg); + if(error_code != SERVER_SUCCESS) { + return SetError(error_code, error_msg); + } + + rc.Record("check validation"); + + //step 3: prepare float data + std::vector vec_f; + vec_f.resize(searchVector_infos_.query_record_array_size() * table_info.dimension_); +// vec_f.resize(searchVector_infos_.query_range_array_size() * table_info.dimension_); + for (size_t i = 0; i < searchVector_infos_.query_record_array_size(); i++) { + for (size_t j = 0; j < table_info.dimension_; j++) { + vec_f[i * table_info.dimension_ + j] = searchVector_infos_.query_record_array(i).vector_data(j); + } + } + rc.Record("prepare vector data"); + + //step 4: search vectors + engine::QueryResults results; + uint64_t record_count = (uint64_t)searchVector_infos_.query_record_array().size(); + + if(file_id_array_.empty()) { + stat = DBWrapper::DB()->Query(table_name_, (size_t) top_k_, record_count, vec_f.data(), dates, results); + } else { + stat = DBWrapper::DB()->Query(table_name_, file_id_array_, + (size_t) top_k_, record_count, vec_f.data(), dates, results); + } + + rc.Record("search vectors from engine"); + if(!stat.ok()) { + return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString()); + } + + if(results.empty()) { + return SERVER_SUCCESS; //empty table + } + + if(results.size() != record_count) { + std::string msg = "Search " + std::to_string(record_count) + " vectors but only return " + + std::to_string(results.size()) + " results"; + return SetError(SERVER_ILLEGAL_SEARCH_RESULT, msg); + } + + rc.Record("do search"); + + //step 5: construct result array + for(uint64_t i = 0; i < record_count; i++) { + auto& result = results[i]; + const auto &record = searchVector_infos_.query_record_array(i); + ::milvus::grpc::TopKQueryResult grpc_topk_result; + for(auto& pair : result) { + ::milvus::grpc::QueryResult *grpc_result = grpc_topk_result.add_query_result_arrays(); + grpc_result->set_id(pair.first); + grpc_result->set_distance(pair.second); + } + writer_.Write(grpc_topk_result); + } + rc.Record("construct result"); + rc.Elapse("total cost"); + + } catch (std::exception& ex) { + return SetError(SERVER_UNEXPECTED_ERROR, ex.what()); + } + + return SERVER_SUCCESS; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +GetTableRowCountTask::GetTableRowCountTask(const std::string table_name, int64_t& row_count) + : BaseTask(DDL_DML_TASK_GROUP), + table_name_(table_name), + row_count_(row_count) { + +} + +BaseTaskPtr GetTableRowCountTask::Create(const std::string table_name, int64_t& row_count) { + return std::shared_ptr(new GetTableRowCountTask(table_name, row_count)); +} + +ServerError GetTableRowCountTask::OnExecute() { + try { + TimeRecorder rc("GetTableRowCountTask"); + + //step 1: check arguments + ServerError res = SERVER_SUCCESS; + res = ValidateTableName(table_name_); + if(res != SERVER_SUCCESS) { + return SetError(res, "Invalid table name: " + table_name_); + } + + //step 2: get row count + uint64_t row_count = 0; + engine::Status stat = DBWrapper::DB()->GetTableRowCount(table_name_, row_count); + if (!stat.ok()) { + return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString()); + } + + row_count_ = (int64_t) row_count; + + rc.Elapse("total cost"); + + } catch (std::exception& ex) { + return SetError(SERVER_UNEXPECTED_ERROR, ex.what()); + } + + return SERVER_SUCCESS; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +PingTask::PingTask(const std::string& cmd, std::string& result) + : BaseTask(PING_TASK_GROUP), + cmd_(cmd), + result_(result) { + +} + +BaseTaskPtr PingTask::Create(const std::string& cmd, std::string& result) { + return std::shared_ptr(new PingTask(cmd, result)); +} + +ServerError PingTask::OnExecute() { + if(cmd_ == "version") { + result_ = MILVUS_VERSION; + } else if (cmd_ == "disconnect") { + //TODO stopservice +// MilvusServer::StopService(); + } + + return SERVER_SUCCESS; +} + +} +} +} \ No newline at end of file diff --git a/cpp/src/grpcserver/RequestTask.h b/cpp/src/grpcserver/RequestTask.h new file mode 100644 index 0000000000..f7b45775d4 --- /dev/null +++ b/cpp/src/grpcserver/RequestTask.h @@ -0,0 +1,180 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#pragma once +#include "RequestScheduler.h" +#include "utils/Error.h" +#include "db/Types.h" + +#include "milvus.grpc.pb.h" +#include "status.pb.h" + +#include +#include + +namespace zilliz { +namespace milvus { +namespace server { + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +class CreateTableTask : public BaseTask { +public: + static BaseTaskPtr Create(const ::milvus::grpc::TableSchema schema); + +protected: + CreateTableTask(const ::milvus::grpc::TableSchema request); + + ServerError OnExecute() override; + +private: + const ::milvus::grpc::TableSchema schema_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +class HasTableTask : public BaseTask { +public: + static BaseTaskPtr Create(const std::string table_name, bool& has_table); + +protected: + HasTableTask(const std::string request, bool& has_table); + + ServerError OnExecute() override; + + +private: + std::string table_name_; + bool has_table_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +class DescribeTableTask : public BaseTask { +public: + static BaseTaskPtr Create(const std::string& table_name, ::milvus::grpc::TableSchema* schema); + +protected: + DescribeTableTask(const std::string& table_name, ::milvus::grpc::TableSchema* schema); + + ServerError OnExecute() override; + + +private: + std::string table_name_; + ::milvus::grpc::TableSchema* schema_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +class DropTableTask : public BaseTask { +public: + static BaseTaskPtr Create(const std::string& table_name); + +protected: + DropTableTask(const std::string& table_name); + + ServerError OnExecute() override; + + +private: + std::string table_name_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +class BuildIndexTask : public BaseTask { +public: + static BaseTaskPtr Create(const std::string& table_name); + +protected: + BuildIndexTask(const std::string& table_name); + + ServerError OnExecute() override; + + +private: + std::string table_name_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +class ShowTablesTask : public BaseTask { +public: + static BaseTaskPtr Create(::grpc::ServerWriter< ::milvus::grpc::TableName> writer); + +protected: + ShowTablesTask(::grpc::ServerWriter< ::milvus::grpc::TableName> writer); + + ServerError OnExecute() override; + +private: + ::grpc::ServerWriter< ::milvus::grpc::TableName> writer_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +class InsertVectorTask : public BaseTask { +public: + static BaseTaskPtr Create(const ::milvus::grpc::InsertInfos insert_infos, + ::milvus::grpc::VectorIds& record_ids_); + +protected: + InsertVectorTask(const ::milvus::grpc::InsertInfos insert_infos, + ::milvus::grpc::VectorIds& record_ids_); + + ServerError OnExecute() override; + +private: + const ::milvus::grpc::InsertInfos insert_infos_; + ::milvus::grpc::VectorIds& record_ids_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +class SearchVectorTask : public BaseTask { +public: + static BaseTaskPtr Create(const ::milvus::grpc::SearchVectorInfos searchVectorInfos, + const std::vector file_id_array, + ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult> writer); + +protected: + SearchVectorTask(const ::milvus::grpc::SearchVectorInfos searchVectorInfos, + const std::vector file_id_array, + ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult> writer); + + ServerError OnExecute() override; + +private: + const ::milvus::grpc::SearchVectorInfos searchVector_infos_; + std::vector file_id_array_; + ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult> writer_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +class GetTableRowCountTask : public BaseTask { +public: + static BaseTaskPtr Create(const std::string table_name, int64_t& row_count); + +protected: + GetTableRowCountTask(const std::string table_name, int64_t& row_count); + + ServerError OnExecute() override; + +private: + std::string table_name_; + int64_t row_count_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +class PingTask : public BaseTask { +public: + static BaseTaskPtr Create(const std::string& cmd, std::string& result); + +protected: + PingTask(const std::string& cmd, std::string& result); + + ServerError OnExecute() override; + +private: + std::string cmd_; + std::string& result_; +}; + +} +} +} \ No newline at end of file diff --git a/cpp/src/grpcserver/Server.cpp b/cpp/src/grpcserver/Server.cpp new file mode 100644 index 0000000000..a79a8c7357 --- /dev/null +++ b/cpp/src/grpcserver/Server.cpp @@ -0,0 +1,245 @@ +//////////////////////////////////////////////////////////////////////////////// +// Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +// Unauthorized copying of this file, via any medium is strictly prohibited. +// Proprietary and confidential. +//////////////////////////////////////////////////////////////////////////////// +#include "Server.h" +#include "ServerConfig.h" +#include "MilvusServer.h" +#include "utils/Log.h" +#include "utils/SignalUtil.h" +#include "utils/TimeRecorder.h" +#include "license/LicenseCheck.h" +#include "metrics/Metrics.h" + +#include +#include +#include +#include +//#include +#include +#include + +#include "metrics/Metrics.h" + +namespace zilliz { +namespace milvus { +namespace server { + +Server* +Server::Instance() { + static Server server; + return &server; +} + +Server::Server() { + +} +Server::~Server() { + +} + +void +Server::Init(int64_t daemonized, const std::string& pid_filename, const std::string& config_filename) { + daemonized_ = daemonized; + pid_filename_ = pid_filename; + config_filename_ = config_filename; +} + +void +Server::Daemonize() { + if (daemonized_ == 0) { + return; + } + + SERVER_LOG_INFO << "Milvus server run in daemonize mode"; + +// std::string log_path(GetLogDirFullPath()); +// log_path += "zdb_server.(INFO/WARNNING/ERROR/CRITICAL)"; +// SERVER_LOG_INFO << "Log will be exported to: " + log_path); + + pid_t pid = 0; + + // Fork off the parent process + pid = fork(); + + // An error occurred + if (pid < 0) { + exit(EXIT_FAILURE); + } + + // Success: terminate parent + if (pid > 0) { + exit(EXIT_SUCCESS); + } + + // On success: The child process becomes session leader + if (setsid() < 0) { + exit(EXIT_FAILURE); + } + + // Ignore signal sent from child to parent process + signal(SIGCHLD, SIG_IGN); + + // Fork off for the second time + pid = fork(); + + // An error occurred + if (pid < 0) { + exit(EXIT_FAILURE); + } + + // Terminate the parent + if (pid > 0) { + exit(EXIT_SUCCESS); + } + + // Set new file permissions + umask(0); + + // Change the working directory to root + int ret = chdir("/"); + if(ret != 0){ + return; + } + + // Close all open fd + for (long fd = sysconf(_SC_OPEN_MAX); fd > 0; fd--) { + close(fd); + } + + SERVER_LOG_INFO << "Redirect stdin/stdout/stderr to /dev/null"; + + // Redirect stdin/stdout/stderr to /dev/null + stdin = fopen("/dev/null", "r"); + stdout = fopen("/dev/null", "w+"); + stderr = fopen("/dev/null", "w+"); + // Try to write PID of daemon to lockfile + if (!pid_filename_.empty()) { + pid_fd = open(pid_filename_.c_str(), O_RDWR | O_CREAT, 0640); + if (pid_fd < 0) { + SERVER_LOG_INFO << "Can't open filename: " + pid_filename_ + ", Error: " + strerror(errno); + exit(EXIT_FAILURE); + } + if (lockf(pid_fd, F_TLOCK, 0) < 0) { + SERVER_LOG_INFO << "Can't lock filename: " + pid_filename_ + ", Error: " + strerror(errno); + exit(EXIT_FAILURE); + } + + std::string pid_file_context = std::to_string(getpid()); + ssize_t res = write(pid_fd, pid_file_context.c_str(), pid_file_context.size()); + if(res != 0){ + return; + } + } +} + +int +Server::Start() { + + if (daemonized_) { + Daemonize(); + } + + do { + try { + // Read config file + if(LoadConfig() != SERVER_SUCCESS) { + return 1; + } + + //log path is defined by LoadConfig, so InitLog must be called after LoadConfig + ServerConfig &config = ServerConfig::GetInstance(); + ConfigNode server_config = config.GetConfig(CONFIG_SERVER); + +#ifdef ENABLE_LICENSE + ConfigNode license_config = config.GetConfig(CONFIG_LICENSE); + std::string license_file_path = license_config.GetValue(CONFIG_LICENSE_PATH); + SERVER_LOG_INFO << "License path: " << license_file_path; + + if(server::LicenseCheck::LegalityCheck(license_file_path) != SERVER_SUCCESS) { + SERVER_LOG_ERROR << "License check failed"; + exit(1); + } + + server::LicenseCheck::GetInstance().StartCountingDown(license_file_path); +#endif + + // Handle Signal + signal(SIGINT, SignalUtil::HandleSignal); + signal(SIGHUP, SignalUtil::HandleSignal); + signal(SIGTERM, SignalUtil::HandleSignal); + server::Metrics::GetInstance().Init(); + server::SystemInfo::GetInstance().Init(); + std::cout << "Milvus server start successfully." << std::endl; + StartService(); + + } catch(std::exception& ex){ + SERVER_LOG_ERROR << "Milvus server encounter exception: " << std::string(ex.what()) + << "Is another server instance running?"; + break; + } + } while(false); + + Stop(); + return 0; +} + +void +Server::Stop() { + std::cout << "Milvus server is going to shutdown ..." << std::endl; + + // Unlock and close lockfile + if (pid_fd != -1) { + int ret = lockf(pid_fd, F_ULOCK, 0); + if(ret != 0){ + std::cout << "Can't lock file: " << strerror(errno) << std::endl; + exit(0); + } + ret = close(pid_fd); + if(ret != 0){ + std::cout << "Can't close file: " << strerror(errno) << std::endl; + exit(0); + } + } + + // Try to delete lockfile + if (!pid_filename_.empty()) { + int ret = unlink(pid_filename_.c_str()); + if(ret != 0){ + std::cout << "Can't unlink file: " << strerror(errno) << std::endl; + exit(0); + } + } + + running_ = 0; + + StopService(); + +#ifdef ENABLE_LICENSE + server::LicenseCheck::GetInstance().StopCountingDown(); +#endif + std::cout << "Milvus server is closed!" << std::endl; +} + + +ServerError +Server::LoadConfig() { + ServerConfig::GetInstance().LoadConfigFile(config_filename_); + + return SERVER_SUCCESS; +} + +void +Server::StartService() { + MilvusServer::StartService(); +} + +void +Server::StopService() { + MilvusServer::StopService(); +} + +} +} +} diff --git a/cpp/src/grpcserver/Server.h b/cpp/src/grpcserver/Server.h new file mode 100644 index 0000000000..58e676f7ff --- /dev/null +++ b/cpp/src/grpcserver/Server.h @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#pragma once + +#include "utils/Error.h" + +#include +#include + +namespace zilliz { +namespace milvus { +namespace server { + +class Server { + public: + static Server* Instance(); + + void Init(int64_t daemonized, const std::string& pid_filename, const std::string& config_filename); + int Start(); + void Stop(); + + private: + Server(); + ~Server(); + + void Daemonize(); + + static void HandleSignal(int signal); + ServerError LoadConfig(); + + void StartService(); + void StopService(); + + private: + int64_t daemonized_ = 0; + int64_t running_ = 1; + int pid_fd = -1; + std::string pid_filename_; + std::string config_filename_; +}; // Server + +} // server +} // sql +} // zilliz diff --git a/cpp/src/grpcserver/ServerConfig.cpp b/cpp/src/grpcserver/ServerConfig.cpp new file mode 100644 index 0000000000..736a249e25 --- /dev/null +++ b/cpp/src/grpcserver/ServerConfig.cpp @@ -0,0 +1,82 @@ +//////////////////////////////////////////////////////////////////////////////// +// Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved +// Unauthorized copying of this file, via any medium is strictly prohibited. +// Proprietary and confidential. +//////////////////////////////////////////////////////////////////////////////// +#include "ServerConfig.h" + +#include +#include +#include +#include +#include + +#include "config/IConfigMgr.h" + +namespace zilliz { +namespace milvus { +namespace server { + +ServerConfig& +ServerConfig::GetInstance() { + static ServerConfig config; + return config; +} + +ServerError +ServerConfig::LoadConfigFile(const std::string& config_filename) { + std::string filename = config_filename; + if(filename.empty()){ + std::cout << "ERROR: a config file is required" << std::endl; + exit(1);//directly exit program if config file not specified + } + struct stat directoryStat; + int statOK = stat(filename.c_str(), &directoryStat); + if (statOK != 0) { + std::cout << "ERROR: " << filename << " not found!" << std::endl; + exit(1);//directly exit program if config file not found + } + + try { + IConfigMgr* mgr = const_cast(IConfigMgr::GetInstance()); + ServerError err = mgr->LoadConfigFile(filename); + if(err != 0) { + std::cout << "Server failed to load config file" << std::endl; + exit(1);//directly exit program if the config file is illegal + } + } + catch (YAML::Exception& e) { + std::cout << "Server failed to load config file: " << std::endl; + return SERVER_UNEXPECTED_ERROR; + } + + return SERVER_SUCCESS; +} + +void +ServerConfig::PrintAll() const { + if(const IConfigMgr* mgr = IConfigMgr::GetInstance()) { + std::string str = mgr->DumpString(); +// SERVER_LOG_INFO << "\n" << str; + std::cout << "\n" << str << std::endl; + } +} + +ConfigNode +ServerConfig::GetConfig(const std::string& name) const { + const IConfigMgr* mgr = IConfigMgr::GetInstance(); + const ConfigNode& root_node = mgr->GetRootNode(); + return root_node.GetChild(name); +} + +ConfigNode& +ServerConfig::GetConfig(const std::string& name) { + IConfigMgr* mgr = IConfigMgr::GetInstance(); + ConfigNode& root_node = mgr->GetRootNode(); + return root_node.GetChild(name); +} + + +} +} +} diff --git a/cpp/src/grpcserver/ServerConfig.h b/cpp/src/grpcserver/ServerConfig.h new file mode 100644 index 0000000000..bc202adcf6 --- /dev/null +++ b/cpp/src/grpcserver/ServerConfig.h @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#pragma once + +#include "utils/Error.h" +#include "config/ConfigNode.h" + +#include "yaml-cpp/yaml.h" + +namespace zilliz { +namespace milvus { +namespace server { + +static const std::string CONFIG_SERVER = "server_config"; +static const std::string CONFIG_SERVER_ADDRESS = "address"; +static const std::string CONFIG_SERVER_PORT = "port"; +static const std::string CONFIG_SERVER_PROTOCOL = "transfer_protocol"; +static const std::string CONFIG_CLUSTER_MODE = "mode"; + +static const std::string CONFIG_DB = "db_config"; +static const std::string CONFIG_DB_URL = "db_backend_url"; +static const std::string CONFIG_DB_PATH = "db_path"; +static const std::string CONFIG_DB_SLAVE_PATH = "db_slave_path"; +static const std::string CONFIG_DB_INDEX_TRIGGER_SIZE = "index_building_threshold"; +static const std::string CONFIG_DB_ARCHIVE_DISK = "archive_disk_threshold"; +static const std::string CONFIG_DB_ARCHIVE_DAYS = "archive_days_threshold"; +static const std::string CONFIG_DB_INSERT_BUFFER_SIZE = "insert_buffer_size"; + +static const std::string CONFIG_LOG = "log_config"; + +static const std::string CONFIG_CACHE = "cache_config"; +static const std::string CONFIG_CPU_CACHE_CAPACITY = "cpu_cache_capacity"; +static const std::string CONFIG_GPU_CACHE_CAPACITY = "gpu_cache_capacity"; + +static const std::string CONFIG_LICENSE = "license_config"; +static const std::string CONFIG_LICENSE_PATH = "license_path"; + +static const std::string CONFIG_METRIC = "metric_config"; +static const std::string CONFIG_METRIC_IS_STARTUP = "is_startup"; +static const std::string CONFIG_METRIC_COLLECTOR = "collector"; +static const std::string CONFIG_PROMETHEUS = "prometheus_config"; +static const std::string CONFIG_METRIC_PROMETHEUS_PORT = "port"; + +static const std::string CONFIG_ENGINE = "engine_config"; +static const std::string CONFIG_NPROBE = "nprobe"; +static const std::string CONFIG_NLIST = "nlist"; +static const std::string CONFIG_DCBT = "use_blas_threshold"; +static const std::string CONFIG_METRICTYPE = "metric_type"; + +class ServerConfig { + public: + static ServerConfig &GetInstance(); + + ServerError LoadConfigFile(const std::string& config_filename); + void PrintAll() const; + + ConfigNode GetConfig(const std::string& name) const; + ConfigNode& GetConfig(const std::string& name); +}; + +} +} +} + diff --git a/cpp/src/main.cpp b/cpp/src/main.cpp index ec536c2ee2..aaff603f09 100644 --- a/cpp/src/main.cpp +++ b/cpp/src/main.cpp @@ -3,7 +3,8 @@ // Unauthorized copying of this file, via any medium is strictly prohibited. // Proprietary and confidential. //////////////////////////////////////////////////////////////////////////////// -#include "server/Server.h" +//#include "server/Server.h" +#include "grpcserver/Server.h" #include "version.h" #include diff --git a/cpp/src/sdk/src/client/ClientProxy.cpp b/cpp/src/sdk/src/client/ClientProxy.cpp index 81dc8d28e4..b4524ba7dd 100644 --- a/cpp/src/sdk/src/client/ClientProxy.cpp +++ b/cpp/src/sdk/src/client/ClientProxy.cpp @@ -86,6 +86,7 @@ ClientProxy::CreateTable(const TableSchema ¶m) { } try { + thrift::TableSchema schema; schema.__set_table_name(param.table_name); schema.__set_index_type((int)param.index_type); diff --git a/cpp/src/sdk/src/interface/ConnectionImpl.h b/cpp/src/sdk/src/interface/ConnectionImpl.h index 60c6cd9b2d..a05e5acba5 100644 --- a/cpp/src/sdk/src/interface/ConnectionImpl.h +++ b/cpp/src/sdk/src/interface/ConnectionImpl.h @@ -56,5 +56,5 @@ public: private: std::shared_ptr client_proxy_; }; - + }