mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
fix structure
Former-commit-id: 6b4afd3c15236340eb666f22a0150ce090202b04
This commit is contained in:
parent
128b3030da
commit
db15ea57e9
@ -121,6 +121,12 @@ if (MILVUS_ENABLE_PROFILING STREQUAL "ON")
|
||||
ADD_DEFINITIONS(-DMILVUS_ENABLE_PROFILING)
|
||||
endif()
|
||||
|
||||
#set(MILVUS_ENABLE_THRIFT "ON")
|
||||
message("MILVUS_ENABLE_THRIFT = ${MILVUS_ENABLE_THRIFT}")
|
||||
if (MILVUS_ENABLE_THRIFT STREQUAL "ON")
|
||||
ADD_DEFINITIONS(-DMILVUS_ENABLE_THRIFT)
|
||||
endif()
|
||||
|
||||
include_directories(${MILVUS_ENGINE_INCLUDE})
|
||||
include_directories(${MILVUS_ENGINE_SRC})
|
||||
|
||||
|
||||
@ -89,6 +89,7 @@ if [[ ${MAKE_CLEAN} == "ON" ]]; then
|
||||
-DMILVUS_DB_PATH=${DB_PATH} \
|
||||
-DMILVUS_ENABLE_PROFILING=${PROFILING} \
|
||||
-DBUILD_FAISS_WITH_MKL=${BUILD_FAISS_WITH_MKL} \
|
||||
-DMILVUS_ENABLE_THRIFT=${MILVUS_ENABLE_THRIFT} \
|
||||
$@ ../"
|
||||
echo ${CMAKE_CMD}
|
||||
|
||||
|
||||
@ -8,7 +8,8 @@
|
||||
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(server/grpc_impl grpcserver_files)
|
||||
aux_source_directory(server/thrift_impl thriftserver_files)
|
||||
aux_source_directory(utils utils_files)
|
||||
aux_source_directory(db db_files)
|
||||
aux_source_directory(wrapper wrapper_files)
|
||||
@ -39,8 +40,8 @@ set(service_files
|
||||
thrift/gen-cpp/milvus_types.cpp
|
||||
metrics/SystemInfo.cpp
|
||||
metrics/SystemInfo.h
|
||||
server/ThreadPoolServer.cpp
|
||||
server/ThreadPoolServer.h
|
||||
server/thrift_impl/ThreadPoolServer.cpp
|
||||
server/thrift_impl/ThreadPoolServer.h
|
||||
grpc/gen-milvus/milvus.grpc.pb.cc
|
||||
grpc/gen-milvus/milvus.pb.cc
|
||||
grpc/gen-status/status.grpc.pb.cc
|
||||
@ -177,19 +178,39 @@ set(server_libs
|
||||
metrics
|
||||
)
|
||||
|
||||
add_executable(milvus_server
|
||||
${config_files}
|
||||
# ${server_files}
|
||||
${grpcserver_files}
|
||||
${utils_files}
|
||||
${service_files}
|
||||
${metrics_files}
|
||||
)
|
||||
if (MILVUS_ENABLE_THRIFT STREQUAL "ON")
|
||||
add_executable(milvus_thrift_server
|
||||
${config_files}
|
||||
${server_files}
|
||||
${thriftserver_files}
|
||||
${utils_files}
|
||||
${service_files}
|
||||
${metrics_files}
|
||||
)
|
||||
else()
|
||||
add_executable(milvus_grpc_server
|
||||
${config_files}
|
||||
${server_files}
|
||||
${grpcserver_files}
|
||||
${utils_files}
|
||||
${service_files}
|
||||
${metrics_files}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if (ENABLE_LICENSE STREQUAL "ON")
|
||||
target_link_libraries(milvus_server ${server_libs} license_check ${third_party_libs})
|
||||
if(MILVUS_ENABLE_THRIFT STREQUAL "ON")
|
||||
target_link_libraries(milvus_thrift_server ${server_libs} license_check ${third_party_libs})
|
||||
else()
|
||||
target_link_libraries(milvus_grpc_server ${server_libs} license_check ${third_party_libs})
|
||||
endif()
|
||||
else ()
|
||||
target_link_libraries(milvus_server ${server_libs} ${third_party_libs})
|
||||
if(MILVUS_ENABLE_THRIFT STREQUAL "ON")
|
||||
target_link_libraries(milvus_thrift_server ${server_libs} ${third_party_libs})
|
||||
else()
|
||||
target_link_libraries(milvus_grpc_server ${server_libs} ${third_party_libs})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_LICENSE STREQUAL "ON")
|
||||
@ -203,7 +224,11 @@ if (ENABLE_LICENSE STREQUAL "ON")
|
||||
install(TARGETS license_generator DESTINATION bin)
|
||||
endif ()
|
||||
|
||||
install(TARGETS milvus_server DESTINATION bin)
|
||||
if (MILVUS_ENABLE_THRIFT STREQUAL "ON")
|
||||
install(TARGETS milvus_thrift_server DESTINATION bin)
|
||||
else()
|
||||
install(TARGETS milvus_grpc_server DESTINATION bin)
|
||||
endif()
|
||||
|
||||
install(FILES
|
||||
${CMAKE_BINARY_DIR}/mysqlpp_ep-prefix/src/mysqlpp_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}mysqlpp${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
@ -211,5 +236,4 @@ 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)
|
||||
|
||||
#add_subdirectory(sdk)
|
||||
add_subdirectory(grpcsdk)
|
||||
add_subdirectory(sdk)
|
||||
|
||||
@ -5,7 +5,7 @@ namespace milvus {
|
||||
namespace engine {
|
||||
namespace meta {
|
||||
|
||||
// Do a simple form of in-use connection limiting: wait to return
|
||||
// Do a thriftsimple form of in-use connection limiting: wait to return
|
||||
// a connection until there are a reasonably low number in use
|
||||
// already. Can't do this in create() because we're interested in
|
||||
// connections actually in use, not those created. Also note that
|
||||
|
||||
@ -53,24 +53,24 @@ MilvusService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& chan
|
||||
, 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) {
|
||||
::grpc::Status MilvusService::Stub::CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::milvus::grpc::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<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> 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<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> 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::grpc::Status>* MilvusService::Stub::AsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::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::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::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) {
|
||||
@ -93,44 +93,44 @@ void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* co
|
||||
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) {
|
||||
::grpc::Status MilvusService::Stub::DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::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<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> 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<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> 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::grpc::Status>* MilvusService::Stub::AsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::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::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::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) {
|
||||
::grpc::Status MilvusService::Stub::BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::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<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> 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<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::BuildIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> 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::grpc::Status>* MilvusService::Stub::AsyncBuildIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::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::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncBuildIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::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) {
|
||||
@ -265,7 +265,7 @@ 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>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableSchema, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::CreateTable), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[1],
|
||||
@ -275,12 +275,12 @@ MilvusService::Service::Service() {
|
||||
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>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::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>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::BuildIndex), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[4],
|
||||
@ -322,7 +322,7 @@ MilvusService::Service::Service() {
|
||||
MilvusService::Service::~Service() {
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) {
|
||||
::grpc::Status MilvusService::Service::CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
@ -336,14 +336,14 @@ MilvusService::Service::~Service() {
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) {
|
||||
::grpc::Status MilvusService::Service::DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::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) {
|
||||
::grpc::Status MilvusService::Service::BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
||||
@ -45,12 +45,12 @@ class MilvusService final {
|
||||
//
|
||||
// @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));
|
||||
virtual ::grpc::Status CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::milvus::grpc::Status* response) = 0;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncCreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::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));
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncCreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncCreateTableRaw(context, request, cq));
|
||||
}
|
||||
// *
|
||||
// @brief Test table existence method
|
||||
@ -73,12 +73,12 @@ class MilvusService final {
|
||||
//
|
||||
// @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));
|
||||
virtual ::grpc::Status DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) = 0;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncDropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::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));
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncDropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncDropTableRaw(context, request, cq));
|
||||
}
|
||||
// *
|
||||
// @brief Build index by table method
|
||||
@ -87,12 +87,12 @@ class MilvusService final {
|
||||
//
|
||||
// @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));
|
||||
virtual ::grpc::Status BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) = 0;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncBuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::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));
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncBuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncBuildIndexRaw(context, request, cq));
|
||||
}
|
||||
// *
|
||||
// @brief Add vector array to table
|
||||
@ -219,8 +219,8 @@ class MilvusService final {
|
||||
//
|
||||
// @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<void(::grpc::Status)>) = 0;
|
||||
virtual void CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function<void(::grpc::Status)>) = 0;
|
||||
virtual void CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) = 0;
|
||||
virtual void CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) = 0;
|
||||
// *
|
||||
// @brief Test table existence method
|
||||
//
|
||||
@ -237,8 +237,8 @@ class MilvusService final {
|
||||
//
|
||||
// @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<void(::grpc::Status)>) = 0;
|
||||
virtual void DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function<void(::grpc::Status)>) = 0;
|
||||
virtual void DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) = 0;
|
||||
virtual void DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) = 0;
|
||||
// *
|
||||
// @brief Build index by table method
|
||||
//
|
||||
@ -246,8 +246,8 @@ class MilvusService final {
|
||||
//
|
||||
// @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<void(::grpc::Status)>) = 0;
|
||||
virtual void BuildIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function<void(::grpc::Status)>) = 0;
|
||||
virtual void BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) = 0;
|
||||
virtual void BuildIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) = 0;
|
||||
// *
|
||||
// @brief Add vector array to table
|
||||
//
|
||||
@ -322,14 +322,14 @@ class MilvusService final {
|
||||
};
|
||||
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::Status>* AsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::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::Status>* AsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncBuildIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::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;
|
||||
@ -351,12 +351,12 @@ class MilvusService final {
|
||||
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));
|
||||
::grpc::Status CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::milvus::grpc::Status* response) override;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncCreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::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));
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncCreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::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) {
|
||||
@ -365,19 +365,19 @@ class MilvusService final {
|
||||
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));
|
||||
::grpc::Status DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) override;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncDropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::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));
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncDropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::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));
|
||||
::grpc::Status BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) override;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncBuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::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));
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncBuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::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) {
|
||||
@ -437,14 +437,14 @@ class MilvusService final {
|
||||
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<void(::grpc::Status)>) override;
|
||||
void CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response, std::function<void(::grpc::Status)>) override;
|
||||
void HasTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function<void(::grpc::Status)>) override;
|
||||
void DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void BuildIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void BuildIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void BuildIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)>) override;
|
||||
void InsertVector(::grpc::ClientContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response, std::function<void(::grpc::Status)>) override;
|
||||
void InsertVector(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::VectorIds* response, std::function<void(::grpc::Status)>) override;
|
||||
void SearchVector(::grpc::ClientContext* context, ::milvus::grpc::SearchVectorInfos* request, ::grpc::experimental::ClientReadReactor< ::milvus::grpc::TopKQueryResult>* reactor) override;
|
||||
@ -467,14 +467,14 @@ class MilvusService final {
|
||||
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::Status>* AsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::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::Status>* AsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncBuildIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::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;
|
||||
@ -517,7 +517,7 @@ class MilvusService final {
|
||||
//
|
||||
// @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);
|
||||
virtual ::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response);
|
||||
// *
|
||||
// @brief Test table existence method
|
||||
//
|
||||
@ -533,7 +533,7 @@ class MilvusService final {
|
||||
//
|
||||
// @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);
|
||||
virtual ::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response);
|
||||
// *
|
||||
// @brief Build index by table method
|
||||
//
|
||||
@ -541,7 +541,7 @@ class MilvusService final {
|
||||
//
|
||||
// @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);
|
||||
virtual ::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response);
|
||||
// *
|
||||
// @brief Add vector array to table
|
||||
//
|
||||
@ -622,11 +622,11 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override {
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::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) {
|
||||
void RequestCreateTable(::grpc::ServerContext* context, ::milvus::grpc::TableSchema* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::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);
|
||||
}
|
||||
};
|
||||
@ -662,11 +662,11 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override {
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::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) {
|
||||
void RequestDropTable(::grpc::ServerContext* context, ::milvus::grpc::TableName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::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);
|
||||
}
|
||||
};
|
||||
@ -682,11 +682,11 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override {
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::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) {
|
||||
void RequestBuildIndex(::grpc::ServerContext* context, ::milvus::grpc::TableName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::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);
|
||||
}
|
||||
};
|
||||
@ -838,10 +838,10 @@ class MilvusService final {
|
||||
public:
|
||||
ExperimentalWithCallbackMethod_CreateTable() {
|
||||
::grpc::Service::experimental().MarkMethodCallback(0,
|
||||
new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableSchema, ::milvus::Status>(
|
||||
new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableSchema, ::milvus::grpc::Status>(
|
||||
[this](::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::TableSchema* request,
|
||||
::milvus::Status* response,
|
||||
::milvus::grpc::Status* response,
|
||||
::grpc::experimental::ServerCallbackRpcController* controller) {
|
||||
return this->CreateTable(context, request, response, controller);
|
||||
}));
|
||||
@ -850,11 +850,11 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override {
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::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, "")); }
|
||||
virtual void CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); }
|
||||
};
|
||||
template <class BaseClass>
|
||||
class ExperimentalWithCallbackMethod_HasTable : public BaseClass {
|
||||
@ -888,10 +888,10 @@ class MilvusService final {
|
||||
public:
|
||||
ExperimentalWithCallbackMethod_DropTable() {
|
||||
::grpc::Service::experimental().MarkMethodCallback(2,
|
||||
new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableName, ::milvus::Status>(
|
||||
new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
[this](::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::TableName* request,
|
||||
::milvus::Status* response,
|
||||
::milvus::grpc::Status* response,
|
||||
::grpc::experimental::ServerCallbackRpcController* controller) {
|
||||
return this->DropTable(context, request, response, controller);
|
||||
}));
|
||||
@ -900,11 +900,11 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override {
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::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, "")); }
|
||||
virtual void DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); }
|
||||
};
|
||||
template <class BaseClass>
|
||||
class ExperimentalWithCallbackMethod_BuildIndex : public BaseClass {
|
||||
@ -913,10 +913,10 @@ class MilvusService final {
|
||||
public:
|
||||
ExperimentalWithCallbackMethod_BuildIndex() {
|
||||
::grpc::Service::experimental().MarkMethodCallback(3,
|
||||
new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableName, ::milvus::Status>(
|
||||
new ::grpc::internal::CallbackUnaryHandler< ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
[this](::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::TableName* request,
|
||||
::milvus::Status* response,
|
||||
::milvus::grpc::Status* response,
|
||||
::grpc::experimental::ServerCallbackRpcController* controller) {
|
||||
return this->BuildIndex(context, request, response, controller);
|
||||
}));
|
||||
@ -925,11 +925,11 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override {
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::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, "")); }
|
||||
virtual void BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); }
|
||||
};
|
||||
template <class BaseClass>
|
||||
class ExperimentalWithCallbackMethod_InsertVector : public BaseClass {
|
||||
@ -1110,7 +1110,7 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override {
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -1144,7 +1144,7 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override {
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -1161,7 +1161,7 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override {
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -1297,7 +1297,7 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override {
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -1337,7 +1337,7 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override {
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -1357,7 +1357,7 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override {
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -1524,7 +1524,7 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response) override {
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -1574,7 +1574,7 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override {
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -1599,7 +1599,7 @@ class MilvusService final {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) override {
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
@ -1778,18 +1778,18 @@ class MilvusService final {
|
||||
public:
|
||||
WithStreamedUnaryMethod_CreateTable() {
|
||||
::grpc::Service::MarkMethodStreamed(0,
|
||||
new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableSchema, ::milvus::Status>(std::bind(&WithStreamedUnaryMethod_CreateTable<BaseClass>::StreamedCreateTable, this, std::placeholders::_1, std::placeholders::_2)));
|
||||
new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableSchema, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_CreateTable<BaseClass>::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 {
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::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;
|
||||
virtual ::grpc::Status StreamedCreateTable(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::TableSchema,::milvus::grpc::Status>* server_unary_streamer) = 0;
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithStreamedUnaryMethod_HasTable : public BaseClass {
|
||||
@ -1818,18 +1818,18 @@ class MilvusService final {
|
||||
public:
|
||||
WithStreamedUnaryMethod_DropTable() {
|
||||
::grpc::Service::MarkMethodStreamed(2,
|
||||
new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableName, ::milvus::Status>(std::bind(&WithStreamedUnaryMethod_DropTable<BaseClass>::StreamedDropTable, this, std::placeholders::_1, std::placeholders::_2)));
|
||||
new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableName, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_DropTable<BaseClass>::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 {
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::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;
|
||||
virtual ::grpc::Status StreamedDropTable(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::TableName,::milvus::grpc::Status>* server_unary_streamer) = 0;
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithStreamedUnaryMethod_BuildIndex : public BaseClass {
|
||||
@ -1838,18 +1838,18 @@ class MilvusService final {
|
||||
public:
|
||||
WithStreamedUnaryMethod_BuildIndex() {
|
||||
::grpc::Service::MarkMethodStreamed(3,
|
||||
new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableName, ::milvus::Status>(std::bind(&WithStreamedUnaryMethod_BuildIndex<BaseClass>::StreamedBuildIndex, this, std::placeholders::_1, std::placeholders::_2)));
|
||||
new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::TableName, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_BuildIndex<BaseClass>::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 {
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::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;
|
||||
virtual ::grpc::Status StreamedBuildIndex(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::TableName,::milvus::grpc::Status>* server_unary_streamer) = 0;
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithStreamedUnaryMethod_InsertVector : public BaseClass {
|
||||
|
||||
@ -484,59 +484,60 @@ static ::google::protobuf::Message const * const file_default_instances[] = {
|
||||
|
||||
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"
|
||||
"o\"D\n\tTableName\022#\n\006status\030\001 \001(\0132\023.milvus."
|
||||
"grpc.Status\022\022\n\ntable_name\030\002 \001(\t\"z\n\013Table"
|
||||
"Schema\022*\n\ntable_name\030\001 \001(\0132\026.milvus.grpc"
|
||||
".TableName\022\022\n\nindex_type\030\002 \001(\005\022\021\n\tdimens"
|
||||
"ion\030\003 \001(\003\022\030\n\020store_raw_vector\030\004 \001(\010\"/\n\005R"
|
||||
"ange\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\013InsertInfos\022\022\n\ntable_name\030\001 \001(\t\0220\n\020row"
|
||||
"_record_array\030\002 \003(\0132\026.milvus.grpc.RowRec"
|
||||
"ord\"I\n\tVectorIds\022#\n\006status\030\001 \001(\0132\023.milvu"
|
||||
"s.grpc.Status\022\027\n\017vector_id_array\030\002 \003(\003\"\230"
|
||||
"\001\n\021SearchVectorInfos\022\022\n\ntable_name\030\001 \001(\t"
|
||||
"\0222\n\022query_record_array\030\002 \003(\0132\026.milvus.gr"
|
||||
"pc.RowRecord\022-\n\021query_range_array\030\003 \003(\0132"
|
||||
"\022.milvus.grpc.Range\022\014\n\004topk\030\004 \001(\003\"n\n\030Sea"
|
||||
"rchVectorInFilesInfos\022\025\n\rfile_id_array\030\001"
|
||||
" \003(\t\022;\n\023search_vector_infos\030\002 \001(\0132\036.milv"
|
||||
"us.grpc.SearchVectorInfos\"+\n\013QueryResult"
|
||||
"\022\n\n\002id\030\001 \001(\003\022\020\n\010distance\030\002 \001(\001\"m\n\017TopKQu"
|
||||
"eryResult\022#\n\006status\030\001 \001(\0132\023.milvus.grpc."
|
||||
"Status\0225\n\023query_result_arrays\030\002 \003(\0132\030.mi"
|
||||
"lvus.grpc.QueryResult\"H\n\013StringReply\022#\n\006"
|
||||
"status\030\001 \001(\0132\023.milvus.grpc.Status\022\024\n\014str"
|
||||
"ing_reply\030\002 \001(\t\"D\n\tBoolReply\022#\n\006status\030\001"
|
||||
" \001(\0132\023.milvus.grpc.Status\022\022\n\nbool_reply\030"
|
||||
"\002 \001(\010\"M\n\rTableRowCount\022#\n\006status\030\001 \001(\0132\023"
|
||||
".milvus.grpc.Status\022\027\n\017table_row_count\030\002"
|
||||
" \001(\003\"\026\n\007Command\022\013\n\003cmd\030\001 \001(\t\"A\n\014ServerSt"
|
||||
"atus\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.Statu"
|
||||
"s\022\014\n\004info\030\002 \001(\t2\206\006\n\rMilvusService\022>\n\013Cre"
|
||||
"ateTable\022\030.milvus.grpc.TableSchema\032\023.mil"
|
||||
"vus.grpc.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"
|
||||
":\n\tDropTable\022\026.milvus.grpc.TableName\032\023.m"
|
||||
"ilvus.grpc.Status\"\000\022;\n\nBuildIndex\022\026.milv"
|
||||
"us.grpc.TableName\032\023.milvus.grpc.Status\"\000"
|
||||
"\022B\n\014InsertVector\022\030.milvus.grpc.InsertInf"
|
||||
"os\032\026.milvus.grpc.VectorIds\"\000\022P\n\014SearchVe"
|
||||
"ctor\022\036.milvus.grpc.SearchVectorInfos\032\034.m"
|
||||
"ilvus.grpc.TopKQueryResult\"\0000\001\022^\n\023Search"
|
||||
"VectorInFiles\022%.milvus.grpc.SearchVector"
|
||||
"InFilesInfos\032\034.milvus.grpc.TopKQueryResu"
|
||||
"lt\"\0000\001\022C\n\rDescribeTable\022\026.milvus.grpc.Ta"
|
||||
"bleName\032\030.milvus.grpc.TableSchema\"\000\022H\n\020G"
|
||||
"etTableRowCount\022\026.milvus.grpc.TableName\032"
|
||||
"\032.milvus.grpc.TableRowCount\"\000\022>\n\nShowTab"
|
||||
"les\022\024.milvus.grpc.Command\032\026.milvus.grpc."
|
||||
"TableName\"\0000\001\0229\n\004Ping\022\024.milvus.grpc.Comm"
|
||||
"and\032\031.milvus.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,
|
||||
"milvus.proto", &assign_descriptors_table_milvus_2eproto, 2000,
|
||||
};
|
||||
|
||||
void AddDescriptors_milvus_2eproto() {
|
||||
@ -555,15 +556,15 @@ namespace grpc {
|
||||
// ===================================================================
|
||||
|
||||
void TableName::InitAsDefaultInstance() {
|
||||
::milvus::grpc::_TableName_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>(
|
||||
::milvus::Status::internal_default_instance());
|
||||
::milvus::grpc::_TableName_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>(
|
||||
::milvus::grpc::Status::internal_default_instance());
|
||||
}
|
||||
class TableName::HasBitSetters {
|
||||
public:
|
||||
static const ::milvus::Status& status(const TableName* msg);
|
||||
static const ::milvus::grpc::Status& status(const TableName* msg);
|
||||
};
|
||||
|
||||
const ::milvus::Status&
|
||||
const ::milvus::grpc::Status&
|
||||
TableName::HasBitSetters::status(const TableName* msg) {
|
||||
return *msg->status_;
|
||||
}
|
||||
@ -592,7 +593,7 @@ TableName::TableName(const TableName& from)
|
||||
table_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.table_name_);
|
||||
}
|
||||
if (from.has_status()) {
|
||||
status_ = new ::milvus::Status(*from.status_);
|
||||
status_ = new ::milvus::grpc::Status(*from.status_);
|
||||
} else {
|
||||
status_ = nullptr;
|
||||
}
|
||||
@ -652,12 +653,12 @@ const char* TableName::_InternalParse(const char* begin, const char* end, void*
|
||||
ptr = ::google::protobuf::io::Parse32(ptr, &tag);
|
||||
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
|
||||
switch (tag >> 3) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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;
|
||||
parser_till_end = ::milvus::grpc::Status::_InternalParse;
|
||||
object = msg->mutable_status();
|
||||
if (size > end - ptr) goto len_delim_till_end;
|
||||
ptr += size;
|
||||
@ -715,7 +716,7 @@ bool TableName::MergePartialFromCodedStream(
|
||||
tag = p.first;
|
||||
if (!p.second) goto handle_unusual;
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
case 1: {
|
||||
if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
|
||||
@ -768,7 +769,7 @@ void TableName::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
1, HasBitSetters::status(this), output);
|
||||
@ -797,7 +798,7 @@ void TableName::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
@ -843,7 +844,7 @@ size_t TableName::ByteSizeLong() const {
|
||||
this->table_name());
|
||||
}
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::MessageSize(
|
||||
@ -882,7 +883,7 @@ void TableName::MergeFrom(const TableName& from) {
|
||||
table_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.table_name_);
|
||||
}
|
||||
if (from.has_status()) {
|
||||
mutable_status()->::milvus::Status::MergeFrom(from.status());
|
||||
mutable_status()->::milvus::grpc::Status::MergeFrom(from.status());
|
||||
}
|
||||
}
|
||||
|
||||
@ -2367,15 +2368,15 @@ void InsertInfos::InternalSwap(InsertInfos* other) {
|
||||
// ===================================================================
|
||||
|
||||
void VectorIds::InitAsDefaultInstance() {
|
||||
::milvus::grpc::_VectorIds_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>(
|
||||
::milvus::Status::internal_default_instance());
|
||||
::milvus::grpc::_VectorIds_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>(
|
||||
::milvus::grpc::Status::internal_default_instance());
|
||||
}
|
||||
class VectorIds::HasBitSetters {
|
||||
public:
|
||||
static const ::milvus::Status& status(const VectorIds* msg);
|
||||
static const ::milvus::grpc::Status& status(const VectorIds* msg);
|
||||
};
|
||||
|
||||
const ::milvus::Status&
|
||||
const ::milvus::grpc::Status&
|
||||
VectorIds::HasBitSetters::status(const VectorIds* msg) {
|
||||
return *msg->status_;
|
||||
}
|
||||
@ -2401,7 +2402,7 @@ VectorIds::VectorIds(const VectorIds& from)
|
||||
vector_id_array_(from.vector_id_array_) {
|
||||
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
||||
if (from.has_status()) {
|
||||
status_ = new ::milvus::Status(*from.status_);
|
||||
status_ = new ::milvus::grpc::Status(*from.status_);
|
||||
} else {
|
||||
status_ = nullptr;
|
||||
}
|
||||
@ -2459,12 +2460,12 @@ const char* VectorIds::_InternalParse(const char* begin, const char* end, void*
|
||||
ptr = ::google::protobuf::io::Parse32(ptr, &tag);
|
||||
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
|
||||
switch (tag >> 3) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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;
|
||||
parser_till_end = ::milvus::grpc::Status::_InternalParse;
|
||||
object = msg->mutable_status();
|
||||
if (size > end - ptr) goto len_delim_till_end;
|
||||
ptr += size;
|
||||
@ -2522,7 +2523,7 @@ bool VectorIds::MergePartialFromCodedStream(
|
||||
tag = p.first;
|
||||
if (!p.second) goto handle_unusual;
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
case 1: {
|
||||
if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
|
||||
@ -2576,7 +2577,7 @@ void VectorIds::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
1, HasBitSetters::status(this), output);
|
||||
@ -2606,7 +2607,7 @@ void VectorIds::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
@ -2662,7 +2663,7 @@ size_t VectorIds::ByteSizeLong() const {
|
||||
total_size += data_size;
|
||||
}
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::MessageSize(
|
||||
@ -2698,7 +2699,7 @@ void VectorIds::MergeFrom(const VectorIds& from) {
|
||||
|
||||
vector_id_array_.MergeFrom(from.vector_id_array_);
|
||||
if (from.has_status()) {
|
||||
mutable_status()->::milvus::Status::MergeFrom(from.status());
|
||||
mutable_status()->::milvus::grpc::Status::MergeFrom(from.status());
|
||||
}
|
||||
}
|
||||
|
||||
@ -3867,15 +3868,15 @@ void QueryResult::InternalSwap(QueryResult* other) {
|
||||
// ===================================================================
|
||||
|
||||
void TopKQueryResult::InitAsDefaultInstance() {
|
||||
::milvus::grpc::_TopKQueryResult_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>(
|
||||
::milvus::Status::internal_default_instance());
|
||||
::milvus::grpc::_TopKQueryResult_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>(
|
||||
::milvus::grpc::Status::internal_default_instance());
|
||||
}
|
||||
class TopKQueryResult::HasBitSetters {
|
||||
public:
|
||||
static const ::milvus::Status& status(const TopKQueryResult* msg);
|
||||
static const ::milvus::grpc::Status& status(const TopKQueryResult* msg);
|
||||
};
|
||||
|
||||
const ::milvus::Status&
|
||||
const ::milvus::grpc::Status&
|
||||
TopKQueryResult::HasBitSetters::status(const TopKQueryResult* msg) {
|
||||
return *msg->status_;
|
||||
}
|
||||
@ -3901,7 +3902,7 @@ TopKQueryResult::TopKQueryResult(const TopKQueryResult& from)
|
||||
query_result_arrays_(from.query_result_arrays_) {
|
||||
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
||||
if (from.has_status()) {
|
||||
status_ = new ::milvus::Status(*from.status_);
|
||||
status_ = new ::milvus::grpc::Status(*from.status_);
|
||||
} else {
|
||||
status_ = nullptr;
|
||||
}
|
||||
@ -3959,12 +3960,12 @@ const char* TopKQueryResult::_InternalParse(const char* begin, const char* end,
|
||||
ptr = ::google::protobuf::io::Parse32(ptr, &tag);
|
||||
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
|
||||
switch (tag >> 3) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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;
|
||||
parser_till_end = ::milvus::grpc::Status::_InternalParse;
|
||||
object = msg->mutable_status();
|
||||
if (size > end - ptr) goto len_delim_till_end;
|
||||
ptr += size;
|
||||
@ -4018,7 +4019,7 @@ bool TopKQueryResult::MergePartialFromCodedStream(
|
||||
tag = p.first;
|
||||
if (!p.second) goto handle_unusual;
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
case 1: {
|
||||
if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
|
||||
@ -4067,7 +4068,7 @@ void TopKQueryResult::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
1, HasBitSetters::status(this), output);
|
||||
@ -4095,7 +4096,7 @@ void TopKQueryResult::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
@ -4142,7 +4143,7 @@ size_t TopKQueryResult::ByteSizeLong() const {
|
||||
}
|
||||
}
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::MessageSize(
|
||||
@ -4178,7 +4179,7 @@ void TopKQueryResult::MergeFrom(const TopKQueryResult& from) {
|
||||
|
||||
query_result_arrays_.MergeFrom(from.query_result_arrays_);
|
||||
if (from.has_status()) {
|
||||
mutable_status()->::milvus::Status::MergeFrom(from.status());
|
||||
mutable_status()->::milvus::grpc::Status::MergeFrom(from.status());
|
||||
}
|
||||
}
|
||||
|
||||
@ -4220,15 +4221,15 @@ void TopKQueryResult::InternalSwap(TopKQueryResult* other) {
|
||||
// ===================================================================
|
||||
|
||||
void StringReply::InitAsDefaultInstance() {
|
||||
::milvus::grpc::_StringReply_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>(
|
||||
::milvus::Status::internal_default_instance());
|
||||
::milvus::grpc::_StringReply_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>(
|
||||
::milvus::grpc::Status::internal_default_instance());
|
||||
}
|
||||
class StringReply::HasBitSetters {
|
||||
public:
|
||||
static const ::milvus::Status& status(const StringReply* msg);
|
||||
static const ::milvus::grpc::Status& status(const StringReply* msg);
|
||||
};
|
||||
|
||||
const ::milvus::Status&
|
||||
const ::milvus::grpc::Status&
|
||||
StringReply::HasBitSetters::status(const StringReply* msg) {
|
||||
return *msg->status_;
|
||||
}
|
||||
@ -4257,7 +4258,7 @@ StringReply::StringReply(const StringReply& from)
|
||||
string_reply_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_reply_);
|
||||
}
|
||||
if (from.has_status()) {
|
||||
status_ = new ::milvus::Status(*from.status_);
|
||||
status_ = new ::milvus::grpc::Status(*from.status_);
|
||||
} else {
|
||||
status_ = nullptr;
|
||||
}
|
||||
@ -4317,12 +4318,12 @@ const char* StringReply::_InternalParse(const char* begin, const char* end, void
|
||||
ptr = ::google::protobuf::io::Parse32(ptr, &tag);
|
||||
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
|
||||
switch (tag >> 3) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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;
|
||||
parser_till_end = ::milvus::grpc::Status::_InternalParse;
|
||||
object = msg->mutable_status();
|
||||
if (size > end - ptr) goto len_delim_till_end;
|
||||
ptr += size;
|
||||
@ -4380,7 +4381,7 @@ bool StringReply::MergePartialFromCodedStream(
|
||||
tag = p.first;
|
||||
if (!p.second) goto handle_unusual;
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
case 1: {
|
||||
if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
|
||||
@ -4433,7 +4434,7 @@ void StringReply::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
1, HasBitSetters::status(this), output);
|
||||
@ -4462,7 +4463,7 @@ void StringReply::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
@ -4508,7 +4509,7 @@ size_t StringReply::ByteSizeLong() const {
|
||||
this->string_reply());
|
||||
}
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::MessageSize(
|
||||
@ -4547,7 +4548,7 @@ void StringReply::MergeFrom(const StringReply& from) {
|
||||
string_reply_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_reply_);
|
||||
}
|
||||
if (from.has_status()) {
|
||||
mutable_status()->::milvus::Status::MergeFrom(from.status());
|
||||
mutable_status()->::milvus::grpc::Status::MergeFrom(from.status());
|
||||
}
|
||||
}
|
||||
|
||||
@ -4590,15 +4591,15 @@ void StringReply::InternalSwap(StringReply* other) {
|
||||
// ===================================================================
|
||||
|
||||
void BoolReply::InitAsDefaultInstance() {
|
||||
::milvus::grpc::_BoolReply_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>(
|
||||
::milvus::Status::internal_default_instance());
|
||||
::milvus::grpc::_BoolReply_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>(
|
||||
::milvus::grpc::Status::internal_default_instance());
|
||||
}
|
||||
class BoolReply::HasBitSetters {
|
||||
public:
|
||||
static const ::milvus::Status& status(const BoolReply* msg);
|
||||
static const ::milvus::grpc::Status& status(const BoolReply* msg);
|
||||
};
|
||||
|
||||
const ::milvus::Status&
|
||||
const ::milvus::grpc::Status&
|
||||
BoolReply::HasBitSetters::status(const BoolReply* msg) {
|
||||
return *msg->status_;
|
||||
}
|
||||
@ -4623,7 +4624,7 @@ BoolReply::BoolReply(const BoolReply& from)
|
||||
_internal_metadata_(nullptr) {
|
||||
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
||||
if (from.has_status()) {
|
||||
status_ = new ::milvus::Status(*from.status_);
|
||||
status_ = new ::milvus::grpc::Status(*from.status_);
|
||||
} else {
|
||||
status_ = nullptr;
|
||||
}
|
||||
@ -4684,12 +4685,12 @@ const char* BoolReply::_InternalParse(const char* begin, const char* end, void*
|
||||
ptr = ::google::protobuf::io::Parse32(ptr, &tag);
|
||||
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
|
||||
switch (tag >> 3) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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;
|
||||
parser_till_end = ::milvus::grpc::Status::_InternalParse;
|
||||
object = msg->mutable_status();
|
||||
if (size > end - ptr) goto len_delim_till_end;
|
||||
ptr += size;
|
||||
@ -4734,7 +4735,7 @@ bool BoolReply::MergePartialFromCodedStream(
|
||||
tag = p.first;
|
||||
if (!p.second) goto handle_unusual;
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
case 1: {
|
||||
if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
|
||||
@ -4785,7 +4786,7 @@ void BoolReply::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
1, HasBitSetters::status(this), output);
|
||||
@ -4809,7 +4810,7 @@ void BoolReply::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
@ -4842,7 +4843,7 @@ size_t BoolReply::ByteSizeLong() const {
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::MessageSize(
|
||||
@ -4882,7 +4883,7 @@ void BoolReply::MergeFrom(const BoolReply& from) {
|
||||
(void) cached_has_bits;
|
||||
|
||||
if (from.has_status()) {
|
||||
mutable_status()->::milvus::Status::MergeFrom(from.status());
|
||||
mutable_status()->::milvus::grpc::Status::MergeFrom(from.status());
|
||||
}
|
||||
if (from.bool_reply() != 0) {
|
||||
set_bool_reply(from.bool_reply());
|
||||
@ -4927,15 +4928,15 @@ void BoolReply::InternalSwap(BoolReply* other) {
|
||||
// ===================================================================
|
||||
|
||||
void TableRowCount::InitAsDefaultInstance() {
|
||||
::milvus::grpc::_TableRowCount_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>(
|
||||
::milvus::Status::internal_default_instance());
|
||||
::milvus::grpc::_TableRowCount_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>(
|
||||
::milvus::grpc::Status::internal_default_instance());
|
||||
}
|
||||
class TableRowCount::HasBitSetters {
|
||||
public:
|
||||
static const ::milvus::Status& status(const TableRowCount* msg);
|
||||
static const ::milvus::grpc::Status& status(const TableRowCount* msg);
|
||||
};
|
||||
|
||||
const ::milvus::Status&
|
||||
const ::milvus::grpc::Status&
|
||||
TableRowCount::HasBitSetters::status(const TableRowCount* msg) {
|
||||
return *msg->status_;
|
||||
}
|
||||
@ -4960,7 +4961,7 @@ TableRowCount::TableRowCount(const TableRowCount& from)
|
||||
_internal_metadata_(nullptr) {
|
||||
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
||||
if (from.has_status()) {
|
||||
status_ = new ::milvus::Status(*from.status_);
|
||||
status_ = new ::milvus::grpc::Status(*from.status_);
|
||||
} else {
|
||||
status_ = nullptr;
|
||||
}
|
||||
@ -5021,12 +5022,12 @@ const char* TableRowCount::_InternalParse(const char* begin, const char* end, vo
|
||||
ptr = ::google::protobuf::io::Parse32(ptr, &tag);
|
||||
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
|
||||
switch (tag >> 3) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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;
|
||||
parser_till_end = ::milvus::grpc::Status::_InternalParse;
|
||||
object = msg->mutable_status();
|
||||
if (size > end - ptr) goto len_delim_till_end;
|
||||
ptr += size;
|
||||
@ -5071,7 +5072,7 @@ bool TableRowCount::MergePartialFromCodedStream(
|
||||
tag = p.first;
|
||||
if (!p.second) goto handle_unusual;
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
case 1: {
|
||||
if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
|
||||
@ -5122,7 +5123,7 @@ void TableRowCount::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
1, HasBitSetters::status(this), output);
|
||||
@ -5146,7 +5147,7 @@ void TableRowCount::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
@ -5179,7 +5180,7 @@ size_t TableRowCount::ByteSizeLong() const {
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::MessageSize(
|
||||
@ -5221,7 +5222,7 @@ void TableRowCount::MergeFrom(const TableRowCount& from) {
|
||||
(void) cached_has_bits;
|
||||
|
||||
if (from.has_status()) {
|
||||
mutable_status()->::milvus::Status::MergeFrom(from.status());
|
||||
mutable_status()->::milvus::grpc::Status::MergeFrom(from.status());
|
||||
}
|
||||
if (from.table_row_count() != 0) {
|
||||
set_table_row_count(from.table_row_count());
|
||||
@ -5563,15 +5564,15 @@ void Command::InternalSwap(Command* other) {
|
||||
// ===================================================================
|
||||
|
||||
void ServerStatus::InitAsDefaultInstance() {
|
||||
::milvus::grpc::_ServerStatus_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::Status*>(
|
||||
::milvus::Status::internal_default_instance());
|
||||
::milvus::grpc::_ServerStatus_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>(
|
||||
::milvus::grpc::Status::internal_default_instance());
|
||||
}
|
||||
class ServerStatus::HasBitSetters {
|
||||
public:
|
||||
static const ::milvus::Status& status(const ServerStatus* msg);
|
||||
static const ::milvus::grpc::Status& status(const ServerStatus* msg);
|
||||
};
|
||||
|
||||
const ::milvus::Status&
|
||||
const ::milvus::grpc::Status&
|
||||
ServerStatus::HasBitSetters::status(const ServerStatus* msg) {
|
||||
return *msg->status_;
|
||||
}
|
||||
@ -5600,7 +5601,7 @@ ServerStatus::ServerStatus(const ServerStatus& from)
|
||||
info_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.info_);
|
||||
}
|
||||
if (from.has_status()) {
|
||||
status_ = new ::milvus::Status(*from.status_);
|
||||
status_ = new ::milvus::grpc::Status(*from.status_);
|
||||
} else {
|
||||
status_ = nullptr;
|
||||
}
|
||||
@ -5660,12 +5661,12 @@ const char* ServerStatus::_InternalParse(const char* begin, const char* end, voi
|
||||
ptr = ::google::protobuf::io::Parse32(ptr, &tag);
|
||||
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
|
||||
switch (tag >> 3) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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;
|
||||
parser_till_end = ::milvus::grpc::Status::_InternalParse;
|
||||
object = msg->mutable_status();
|
||||
if (size > end - ptr) goto len_delim_till_end;
|
||||
ptr += size;
|
||||
@ -5723,7 +5724,7 @@ bool ServerStatus::MergePartialFromCodedStream(
|
||||
tag = p.first;
|
||||
if (!p.second) goto handle_unusual;
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
case 1: {
|
||||
if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
|
||||
@ -5776,7 +5777,7 @@ void ServerStatus::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
1, HasBitSetters::status(this), output);
|
||||
@ -5805,7 +5806,7 @@ void ServerStatus::SerializeWithCachedSizes(
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
@ -5851,7 +5852,7 @@ size_t ServerStatus::ByteSizeLong() const {
|
||||
this->info());
|
||||
}
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::MessageSize(
|
||||
@ -5890,7 +5891,7 @@ void ServerStatus::MergeFrom(const ServerStatus& from) {
|
||||
info_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.info_);
|
||||
}
|
||||
if (from.has_status()) {
|
||||
mutable_status()->::milvus::Status::MergeFrom(from.status());
|
||||
mutable_status()->::milvus::grpc::Status::MergeFrom(from.status());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -231,14 +231,14 @@ class TableName final :
|
||||
::std::string* release_table_name();
|
||||
void set_allocated_table_name(::std::string* table_name);
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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);
|
||||
const ::milvus::grpc::Status& status() const;
|
||||
::milvus::grpc::Status* release_status();
|
||||
::milvus::grpc::Status* mutable_status();
|
||||
void set_allocated_status(::milvus::grpc::Status* status);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:milvus.grpc.TableName)
|
||||
private:
|
||||
@ -246,7 +246,7 @@ class TableName final :
|
||||
|
||||
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::google::protobuf::internal::ArenaStringPtr table_name_;
|
||||
::milvus::Status* status_;
|
||||
::milvus::grpc::Status* status_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
};
|
||||
@ -882,14 +882,14 @@ class VectorIds final :
|
||||
::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
|
||||
mutable_vector_id_array();
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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);
|
||||
const ::milvus::grpc::Status& status() const;
|
||||
::milvus::grpc::Status* release_status();
|
||||
::milvus::grpc::Status* mutable_status();
|
||||
void set_allocated_status(::milvus::grpc::Status* status);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:milvus.grpc.VectorIds)
|
||||
private:
|
||||
@ -898,7 +898,7 @@ class VectorIds final :
|
||||
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::google::protobuf::RepeatedField< ::google::protobuf::int64 > vector_id_array_;
|
||||
mutable std::atomic<int> _vector_id_array_cached_byte_size_;
|
||||
::milvus::Status* status_;
|
||||
::milvus::grpc::Status* status_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
};
|
||||
@ -1421,14 +1421,14 @@ class TopKQueryResult final :
|
||||
const ::google::protobuf::RepeatedPtrField< ::milvus::grpc::QueryResult >&
|
||||
query_result_arrays() const;
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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);
|
||||
const ::milvus::grpc::Status& status() const;
|
||||
::milvus::grpc::Status* release_status();
|
||||
::milvus::grpc::Status* mutable_status();
|
||||
void set_allocated_status(::milvus::grpc::Status* status);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:milvus.grpc.TopKQueryResult)
|
||||
private:
|
||||
@ -1436,7 +1436,7 @@ class TopKQueryResult final :
|
||||
|
||||
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::google::protobuf::RepeatedPtrField< ::milvus::grpc::QueryResult > query_result_arrays_;
|
||||
::milvus::Status* status_;
|
||||
::milvus::grpc::Status* status_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
};
|
||||
@ -1551,14 +1551,14 @@ class StringReply final :
|
||||
::std::string* release_string_reply();
|
||||
void set_allocated_string_reply(::std::string* string_reply);
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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);
|
||||
const ::milvus::grpc::Status& status() const;
|
||||
::milvus::grpc::Status* release_status();
|
||||
::milvus::grpc::Status* mutable_status();
|
||||
void set_allocated_status(::milvus::grpc::Status* status);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:milvus.grpc.StringReply)
|
||||
private:
|
||||
@ -1566,7 +1566,7 @@ class StringReply final :
|
||||
|
||||
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::google::protobuf::internal::ArenaStringPtr string_reply_;
|
||||
::milvus::Status* status_;
|
||||
::milvus::grpc::Status* status_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
};
|
||||
@ -1667,14 +1667,14 @@ class BoolReply final :
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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);
|
||||
const ::milvus::grpc::Status& status() const;
|
||||
::milvus::grpc::Status* release_status();
|
||||
::milvus::grpc::Status* mutable_status();
|
||||
void set_allocated_status(::milvus::grpc::Status* status);
|
||||
|
||||
// bool bool_reply = 2;
|
||||
void clear_bool_reply();
|
||||
@ -1687,7 +1687,7 @@ class BoolReply final :
|
||||
class HasBitSetters;
|
||||
|
||||
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::milvus::Status* status_;
|
||||
::milvus::grpc::Status* status_;
|
||||
bool bool_reply_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
@ -1789,14 +1789,14 @@ class TableRowCount final :
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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);
|
||||
const ::milvus::grpc::Status& status() const;
|
||||
::milvus::grpc::Status* release_status();
|
||||
::milvus::grpc::Status* mutable_status();
|
||||
void set_allocated_status(::milvus::grpc::Status* status);
|
||||
|
||||
// int64 table_row_count = 2;
|
||||
void clear_table_row_count();
|
||||
@ -1809,7 +1809,7 @@ class TableRowCount final :
|
||||
class HasBitSetters;
|
||||
|
||||
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::milvus::Status* status_;
|
||||
::milvus::grpc::Status* status_;
|
||||
::google::protobuf::int64 table_row_count_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
@ -2045,14 +2045,14 @@ class ServerStatus final :
|
||||
::std::string* release_info();
|
||||
void set_allocated_info(::std::string* info);
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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);
|
||||
const ::milvus::grpc::Status& status() const;
|
||||
::milvus::grpc::Status* release_status();
|
||||
::milvus::grpc::Status* mutable_status();
|
||||
void set_allocated_status(::milvus::grpc::Status* status);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:milvus.grpc.ServerStatus)
|
||||
private:
|
||||
@ -2060,7 +2060,7 @@ class ServerStatus final :
|
||||
|
||||
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::google::protobuf::internal::ArenaStringPtr info_;
|
||||
::milvus::Status* status_;
|
||||
::milvus::grpc::Status* status_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
};
|
||||
@ -2075,33 +2075,33 @@ class ServerStatus final :
|
||||
#endif // __GNUC__
|
||||
// TableName
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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_;
|
||||
inline const ::milvus::grpc::Status& TableName::status() const {
|
||||
const ::milvus::grpc::Status* p = status_;
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.TableName.status)
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::Status*>(
|
||||
&::milvus::_Status_default_instance_);
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::grpc::Status*>(
|
||||
&::milvus::grpc::_Status_default_instance_);
|
||||
}
|
||||
inline ::milvus::Status* TableName::release_status() {
|
||||
inline ::milvus::grpc::Status* TableName::release_status() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.TableName.status)
|
||||
|
||||
::milvus::Status* temp = status_;
|
||||
::milvus::grpc::Status* temp = status_;
|
||||
status_ = nullptr;
|
||||
return temp;
|
||||
}
|
||||
inline ::milvus::Status* TableName::mutable_status() {
|
||||
inline ::milvus::grpc::Status* TableName::mutable_status() {
|
||||
|
||||
if (status_ == nullptr) {
|
||||
auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual());
|
||||
auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual());
|
||||
status_ = p;
|
||||
}
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.TableName.status)
|
||||
return status_;
|
||||
}
|
||||
inline void TableName::set_allocated_status(::milvus::Status* status) {
|
||||
inline void TableName::set_allocated_status(::milvus::grpc::Status* status) {
|
||||
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
|
||||
if (message_arena == nullptr) {
|
||||
delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_);
|
||||
@ -2505,33 +2505,33 @@ InsertInfos::row_record_array() const {
|
||||
|
||||
// VectorIds
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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_;
|
||||
inline const ::milvus::grpc::Status& VectorIds::status() const {
|
||||
const ::milvus::grpc::Status* p = status_;
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.VectorIds.status)
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::Status*>(
|
||||
&::milvus::_Status_default_instance_);
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::grpc::Status*>(
|
||||
&::milvus::grpc::_Status_default_instance_);
|
||||
}
|
||||
inline ::milvus::Status* VectorIds::release_status() {
|
||||
inline ::milvus::grpc::Status* VectorIds::release_status() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.VectorIds.status)
|
||||
|
||||
::milvus::Status* temp = status_;
|
||||
::milvus::grpc::Status* temp = status_;
|
||||
status_ = nullptr;
|
||||
return temp;
|
||||
}
|
||||
inline ::milvus::Status* VectorIds::mutable_status() {
|
||||
inline ::milvus::grpc::Status* VectorIds::mutable_status() {
|
||||
|
||||
if (status_ == nullptr) {
|
||||
auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual());
|
||||
auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual());
|
||||
status_ = p;
|
||||
}
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.VectorIds.status)
|
||||
return status_;
|
||||
}
|
||||
inline void VectorIds::set_allocated_status(::milvus::Status* status) {
|
||||
inline void VectorIds::set_allocated_status(::milvus::grpc::Status* status) {
|
||||
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
|
||||
if (message_arena == nullptr) {
|
||||
delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_);
|
||||
@ -2871,33 +2871,33 @@ inline void QueryResult::set_distance(double value) {
|
||||
|
||||
// TopKQueryResult
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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_;
|
||||
inline const ::milvus::grpc::Status& TopKQueryResult::status() const {
|
||||
const ::milvus::grpc::Status* p = status_;
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.TopKQueryResult.status)
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::Status*>(
|
||||
&::milvus::_Status_default_instance_);
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::grpc::Status*>(
|
||||
&::milvus::grpc::_Status_default_instance_);
|
||||
}
|
||||
inline ::milvus::Status* TopKQueryResult::release_status() {
|
||||
inline ::milvus::grpc::Status* TopKQueryResult::release_status() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.TopKQueryResult.status)
|
||||
|
||||
::milvus::Status* temp = status_;
|
||||
::milvus::grpc::Status* temp = status_;
|
||||
status_ = nullptr;
|
||||
return temp;
|
||||
}
|
||||
inline ::milvus::Status* TopKQueryResult::mutable_status() {
|
||||
inline ::milvus::grpc::Status* TopKQueryResult::mutable_status() {
|
||||
|
||||
if (status_ == nullptr) {
|
||||
auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual());
|
||||
auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual());
|
||||
status_ = p;
|
||||
}
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.TopKQueryResult.status)
|
||||
return status_;
|
||||
}
|
||||
inline void TopKQueryResult::set_allocated_status(::milvus::Status* status) {
|
||||
inline void TopKQueryResult::set_allocated_status(::milvus::grpc::Status* status) {
|
||||
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
|
||||
if (message_arena == nullptr) {
|
||||
delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_);
|
||||
@ -2950,33 +2950,33 @@ TopKQueryResult::query_result_arrays() const {
|
||||
|
||||
// StringReply
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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_;
|
||||
inline const ::milvus::grpc::Status& StringReply::status() const {
|
||||
const ::milvus::grpc::Status* p = status_;
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.StringReply.status)
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::Status*>(
|
||||
&::milvus::_Status_default_instance_);
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::grpc::Status*>(
|
||||
&::milvus::grpc::_Status_default_instance_);
|
||||
}
|
||||
inline ::milvus::Status* StringReply::release_status() {
|
||||
inline ::milvus::grpc::Status* StringReply::release_status() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.StringReply.status)
|
||||
|
||||
::milvus::Status* temp = status_;
|
||||
::milvus::grpc::Status* temp = status_;
|
||||
status_ = nullptr;
|
||||
return temp;
|
||||
}
|
||||
inline ::milvus::Status* StringReply::mutable_status() {
|
||||
inline ::milvus::grpc::Status* StringReply::mutable_status() {
|
||||
|
||||
if (status_ == nullptr) {
|
||||
auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual());
|
||||
auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual());
|
||||
status_ = p;
|
||||
}
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.StringReply.status)
|
||||
return status_;
|
||||
}
|
||||
inline void StringReply::set_allocated_status(::milvus::Status* status) {
|
||||
inline void StringReply::set_allocated_status(::milvus::grpc::Status* status) {
|
||||
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
|
||||
if (message_arena == nullptr) {
|
||||
delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_);
|
||||
@ -3052,33 +3052,33 @@ inline void StringReply::set_allocated_string_reply(::std::string* string_reply)
|
||||
|
||||
// BoolReply
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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_;
|
||||
inline const ::milvus::grpc::Status& BoolReply::status() const {
|
||||
const ::milvus::grpc::Status* p = status_;
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.BoolReply.status)
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::Status*>(
|
||||
&::milvus::_Status_default_instance_);
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::grpc::Status*>(
|
||||
&::milvus::grpc::_Status_default_instance_);
|
||||
}
|
||||
inline ::milvus::Status* BoolReply::release_status() {
|
||||
inline ::milvus::grpc::Status* BoolReply::release_status() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.BoolReply.status)
|
||||
|
||||
::milvus::Status* temp = status_;
|
||||
::milvus::grpc::Status* temp = status_;
|
||||
status_ = nullptr;
|
||||
return temp;
|
||||
}
|
||||
inline ::milvus::Status* BoolReply::mutable_status() {
|
||||
inline ::milvus::grpc::Status* BoolReply::mutable_status() {
|
||||
|
||||
if (status_ == nullptr) {
|
||||
auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual());
|
||||
auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual());
|
||||
status_ = p;
|
||||
}
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.BoolReply.status)
|
||||
return status_;
|
||||
}
|
||||
inline void BoolReply::set_allocated_status(::milvus::Status* status) {
|
||||
inline void BoolReply::set_allocated_status(::milvus::grpc::Status* status) {
|
||||
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
|
||||
if (message_arena == nullptr) {
|
||||
delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_);
|
||||
@ -3115,33 +3115,33 @@ inline void BoolReply::set_bool_reply(bool value) {
|
||||
|
||||
// TableRowCount
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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_;
|
||||
inline const ::milvus::grpc::Status& TableRowCount::status() const {
|
||||
const ::milvus::grpc::Status* p = status_;
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.TableRowCount.status)
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::Status*>(
|
||||
&::milvus::_Status_default_instance_);
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::grpc::Status*>(
|
||||
&::milvus::grpc::_Status_default_instance_);
|
||||
}
|
||||
inline ::milvus::Status* TableRowCount::release_status() {
|
||||
inline ::milvus::grpc::Status* TableRowCount::release_status() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.TableRowCount.status)
|
||||
|
||||
::milvus::Status* temp = status_;
|
||||
::milvus::grpc::Status* temp = status_;
|
||||
status_ = nullptr;
|
||||
return temp;
|
||||
}
|
||||
inline ::milvus::Status* TableRowCount::mutable_status() {
|
||||
inline ::milvus::grpc::Status* TableRowCount::mutable_status() {
|
||||
|
||||
if (status_ == nullptr) {
|
||||
auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual());
|
||||
auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual());
|
||||
status_ = p;
|
||||
}
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.TableRowCount.status)
|
||||
return status_;
|
||||
}
|
||||
inline void TableRowCount::set_allocated_status(::milvus::Status* status) {
|
||||
inline void TableRowCount::set_allocated_status(::milvus::grpc::Status* status) {
|
||||
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
|
||||
if (message_arena == nullptr) {
|
||||
delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_);
|
||||
@ -3235,33 +3235,33 @@ inline void Command::set_allocated_cmd(::std::string* cmd) {
|
||||
|
||||
// ServerStatus
|
||||
|
||||
// .milvus.Status status = 1;
|
||||
// .milvus.grpc.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_;
|
||||
inline const ::milvus::grpc::Status& ServerStatus::status() const {
|
||||
const ::milvus::grpc::Status* p = status_;
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.ServerStatus.status)
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::Status*>(
|
||||
&::milvus::_Status_default_instance_);
|
||||
return p != nullptr ? *p : *reinterpret_cast<const ::milvus::grpc::Status*>(
|
||||
&::milvus::grpc::_Status_default_instance_);
|
||||
}
|
||||
inline ::milvus::Status* ServerStatus::release_status() {
|
||||
inline ::milvus::grpc::Status* ServerStatus::release_status() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.ServerStatus.status)
|
||||
|
||||
::milvus::Status* temp = status_;
|
||||
::milvus::grpc::Status* temp = status_;
|
||||
status_ = nullptr;
|
||||
return temp;
|
||||
}
|
||||
inline ::milvus::Status* ServerStatus::mutable_status() {
|
||||
inline ::milvus::grpc::Status* ServerStatus::mutable_status() {
|
||||
|
||||
if (status_ == nullptr) {
|
||||
auto* p = CreateMaybeMessage<::milvus::Status>(GetArenaNoVirtual());
|
||||
auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual());
|
||||
status_ = p;
|
||||
}
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.ServerStatus.status)
|
||||
return status_;
|
||||
}
|
||||
inline void ServerStatus::set_allocated_status(::milvus::Status* status) {
|
||||
inline void ServerStatus::set_allocated_status(::milvus::grpc::Status* status) {
|
||||
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
|
||||
if (message_arena == nullptr) {
|
||||
delete reinterpret_cast< ::google::protobuf::MessageLite*>(status_);
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
#include <grpcpp/impl/codegen/service_type.h>
|
||||
#include <grpcpp/impl/codegen/sync_stream.h>
|
||||
namespace milvus {
|
||||
namespace grpc {
|
||||
|
||||
} // namespace milvus
|
||||
} // namespace grpc
|
||||
|
||||
|
||||
@ -28,7 +28,9 @@ class ServerContext;
|
||||
} // namespace grpc
|
||||
|
||||
namespace milvus {
|
||||
namespace grpc {
|
||||
|
||||
} // namespace grpc
|
||||
} // namespace milvus
|
||||
|
||||
|
||||
|
||||
@ -17,20 +17,22 @@
|
||||
#include <google/protobuf/port_def.inc>
|
||||
|
||||
namespace milvus {
|
||||
namespace grpc {
|
||||
class StatusDefaultTypeInternal {
|
||||
public:
|
||||
::google::protobuf::internal::ExplicitlyConstructed<Status> _instance;
|
||||
} _Status_default_instance_;
|
||||
} // namespace grpc
|
||||
} // namespace milvus
|
||||
static void InitDefaultsStatus_status_2eproto() {
|
||||
GOOGLE_PROTOBUF_VERIFY_VERSION;
|
||||
|
||||
{
|
||||
void* ptr = &::milvus::_Status_default_instance_;
|
||||
new (ptr) ::milvus::Status();
|
||||
void* ptr = &::milvus::grpc::_Status_default_instance_;
|
||||
new (ptr) ::milvus::grpc::Status();
|
||||
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
|
||||
}
|
||||
::milvus::Status::InitAsDefaultInstance();
|
||||
::milvus::grpc::Status::InitAsDefaultInstance();
|
||||
}
|
||||
|
||||
::google::protobuf::internal::SCCInfo<0> scc_info_Status_status_2eproto =
|
||||
@ -46,19 +48,19 @@ constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descr
|
||||
|
||||
const ::google::protobuf::uint32 TableStruct_status_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::Status, _internal_metadata_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::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_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::Status, error_code_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::Status, reason_),
|
||||
};
|
||||
static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
|
||||
{ 0, -1, sizeof(::milvus::Status)},
|
||||
{ 0, -1, sizeof(::milvus::grpc::Status)},
|
||||
};
|
||||
|
||||
static ::google::protobuf::Message const * const file_default_instances[] = {
|
||||
reinterpret_cast<const ::google::protobuf::Message*>(&::milvus::_Status_default_instance_),
|
||||
reinterpret_cast<const ::google::protobuf::Message*>(&::milvus::grpc::_Status_default_instance_),
|
||||
};
|
||||
|
||||
::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_status_2eproto = {
|
||||
@ -68,26 +70,26 @@ static ::google::protobuf::Message const * const file_default_instances[] = {
|
||||
};
|
||||
|
||||
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"
|
||||
"\n\014status.proto\022\013milvus.grpc\"D\n\006Status\022*\n"
|
||||
"\nerror_code\030\001 \001(\0162\026.milvus.grpc.ErrorCod"
|
||||
"e\022\016\n\006reason\030\002 \001(\t*\354\003\n\tErrorCode\022\013\n\007SUCCE"
|
||||
"SS\020\000\022\024\n\020UNEXPECTED_ERROR\020\001\022\022\n\016CONNECT_FA"
|
||||
"ILED\020\002\022\025\n\021PERMISSION_DENIED\020\003\022\024\n\020TABLE_N"
|
||||
"OT_EXISTS\020\004\022\024\n\020ILLEGAL_ARGUMENT\020\005\022\021\n\rILL"
|
||||
"EGAL_RANGE\020\006\022\025\n\021ILLEGAL_DIMENSION\020\007\022\026\n\022I"
|
||||
"LLEGAL_INDEX_TYPE\020\010\022\026\n\022ILLEGAL_TABLE_NAM"
|
||||
"E\020\t\022\020\n\014ILLEGAL_TOPK\020\n\022\025\n\021ILLEGAL_ROWRECO"
|
||||
"RD\020\013\022\025\n\021ILLEGAL_VECTOR_ID\020\014\022\031\n\025ILLEGAL_S"
|
||||
"EARCH_RESULT\020\r\022\022\n\016FILE_NOT_FOUND\020\016\022\017\n\013ME"
|
||||
"TA_FAILED\020\017\022\020\n\014CACHE_FAILED\020\020\022\030\n\024CANNOT_"
|
||||
"CREATE_FOLDER\020\021\022\026\n\022CANNOT_CREATE_FILE\020\022\022"
|
||||
"\030\n\024CANNOT_DELETE_FOLDER\020\023\022\026\n\022CANNOT_DELE"
|
||||
"TE_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,
|
||||
"status.proto", &assign_descriptors_table_status_2eproto, 600,
|
||||
};
|
||||
|
||||
void AddDescriptors_status_2eproto() {
|
||||
@ -100,6 +102,7 @@ void AddDescriptors_status_2eproto() {
|
||||
// Force running AddDescriptors() at dynamic initialization time.
|
||||
static bool dynamic_init_dummy_status_2eproto = []() { AddDescriptors_status_2eproto(); return true; }();
|
||||
namespace milvus {
|
||||
namespace grpc {
|
||||
const ::google::protobuf::EnumDescriptor* ErrorCode_descriptor() {
|
||||
::google::protobuf::internal::AssignDescriptors(&assign_descriptors_table_status_2eproto);
|
||||
return file_level_enum_descriptors_status_2eproto[0];
|
||||
@ -151,7 +154,7 @@ const int Status::kReasonFieldNumber;
|
||||
Status::Status()
|
||||
: ::google::protobuf::Message(), _internal_metadata_(nullptr) {
|
||||
SharedCtor();
|
||||
// @@protoc_insertion_point(constructor:milvus.Status)
|
||||
// @@protoc_insertion_point(constructor:milvus.grpc.Status)
|
||||
}
|
||||
Status::Status(const Status& from)
|
||||
: ::google::protobuf::Message(),
|
||||
@ -162,7 +165,7 @@ Status::Status(const Status& from)
|
||||
reason_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.reason_);
|
||||
}
|
||||
error_code_ = from.error_code_;
|
||||
// @@protoc_insertion_point(copy_constructor:milvus.Status)
|
||||
// @@protoc_insertion_point(copy_constructor:milvus.grpc.Status)
|
||||
}
|
||||
|
||||
void Status::SharedCtor() {
|
||||
@ -173,7 +176,7 @@ void Status::SharedCtor() {
|
||||
}
|
||||
|
||||
Status::~Status() {
|
||||
// @@protoc_insertion_point(destructor:milvus.Status)
|
||||
// @@protoc_insertion_point(destructor:milvus.grpc.Status)
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
@ -191,7 +194,7 @@ const Status& Status::default_instance() {
|
||||
|
||||
|
||||
void Status::Clear() {
|
||||
// @@protoc_insertion_point(message_clear_start:milvus.Status)
|
||||
// @@protoc_insertion_point(message_clear_start:milvus.grpc.Status)
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
@ -214,11 +217,11 @@ const char* Status::_InternalParse(const char* begin, const char* end, void* obj
|
||||
ptr = ::google::protobuf::io::Parse32(ptr, &tag);
|
||||
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
|
||||
switch (tag >> 3) {
|
||||
// .milvus.ErrorCode error_code = 1;
|
||||
// .milvus.grpc.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));
|
||||
msg->set_error_code(static_cast<::milvus::grpc::ErrorCode>(val));
|
||||
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
|
||||
break;
|
||||
}
|
||||
@ -227,7 +230,7 @@ const char* Status::_InternalParse(const char* begin, const char* end, void* obj
|
||||
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");
|
||||
ctx->extra_parse_data().SetFieldName("milvus.grpc.Status.reason");
|
||||
object = msg->mutable_reason();
|
||||
if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) {
|
||||
parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8;
|
||||
@ -266,20 +269,20 @@ 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)
|
||||
// @@protoc_insertion_point(parse_start:milvus.grpc.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;
|
||||
// .milvus.grpc.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));
|
||||
set_error_code(static_cast< ::milvus::grpc::ErrorCode >(value));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
@ -294,7 +297,7 @@ bool Status::MergePartialFromCodedStream(
|
||||
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->reason().data(), static_cast<int>(this->reason().length()),
|
||||
::google::protobuf::internal::WireFormatLite::PARSE,
|
||||
"milvus.Status.reason"));
|
||||
"milvus.grpc.Status.reason"));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
@ -313,10 +316,10 @@ bool Status::MergePartialFromCodedStream(
|
||||
}
|
||||
}
|
||||
success:
|
||||
// @@protoc_insertion_point(parse_success:milvus.Status)
|
||||
// @@protoc_insertion_point(parse_success:milvus.grpc.Status)
|
||||
return true;
|
||||
failure:
|
||||
// @@protoc_insertion_point(parse_failure:milvus.Status)
|
||||
// @@protoc_insertion_point(parse_failure:milvus.grpc.Status)
|
||||
return false;
|
||||
#undef DO_
|
||||
}
|
||||
@ -324,11 +327,11 @@ failure:
|
||||
|
||||
void Status::SerializeWithCachedSizes(
|
||||
::google::protobuf::io::CodedOutputStream* output) const {
|
||||
// @@protoc_insertion_point(serialize_start:milvus.Status)
|
||||
// @@protoc_insertion_point(serialize_start:milvus.grpc.Status)
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.ErrorCode error_code = 1;
|
||||
// .milvus.grpc.ErrorCode error_code = 1;
|
||||
if (this->error_code() != 0) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteEnum(
|
||||
1, this->error_code(), output);
|
||||
@ -339,7 +342,7 @@ void Status::SerializeWithCachedSizes(
|
||||
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->reason().data(), static_cast<int>(this->reason().length()),
|
||||
::google::protobuf::internal::WireFormatLite::SERIALIZE,
|
||||
"milvus.Status.reason");
|
||||
"milvus.grpc.Status.reason");
|
||||
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
|
||||
2, this->reason(), output);
|
||||
}
|
||||
@ -348,16 +351,16 @@ void Status::SerializeWithCachedSizes(
|
||||
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
|
||||
_internal_metadata_.unknown_fields(), output);
|
||||
}
|
||||
// @@protoc_insertion_point(serialize_end:milvus.Status)
|
||||
// @@protoc_insertion_point(serialize_end:milvus.grpc.Status)
|
||||
}
|
||||
|
||||
::google::protobuf::uint8* Status::InternalSerializeWithCachedSizesToArray(
|
||||
::google::protobuf::uint8* target) const {
|
||||
// @@protoc_insertion_point(serialize_to_array_start:milvus.Status)
|
||||
// @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.Status)
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// .milvus.ErrorCode error_code = 1;
|
||||
// .milvus.grpc.ErrorCode error_code = 1;
|
||||
if (this->error_code() != 0) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
|
||||
1, this->error_code(), target);
|
||||
@ -368,7 +371,7 @@ void Status::SerializeWithCachedSizes(
|
||||
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->reason().data(), static_cast<int>(this->reason().length()),
|
||||
::google::protobuf::internal::WireFormatLite::SERIALIZE,
|
||||
"milvus.Status.reason");
|
||||
"milvus.grpc.Status.reason");
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
|
||||
2, this->reason(), target);
|
||||
@ -378,12 +381,12 @@ void Status::SerializeWithCachedSizes(
|
||||
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
|
||||
_internal_metadata_.unknown_fields(), target);
|
||||
}
|
||||
// @@protoc_insertion_point(serialize_to_array_end:milvus.Status)
|
||||
// @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.Status)
|
||||
return target;
|
||||
}
|
||||
|
||||
size_t Status::ByteSizeLong() const {
|
||||
// @@protoc_insertion_point(message_byte_size_start:milvus.Status)
|
||||
// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.Status)
|
||||
size_t total_size = 0;
|
||||
|
||||
if (_internal_metadata_.have_unknown_fields()) {
|
||||
@ -402,7 +405,7 @@ size_t Status::ByteSizeLong() const {
|
||||
this->reason());
|
||||
}
|
||||
|
||||
// .milvus.ErrorCode error_code = 1;
|
||||
// .milvus.grpc.ErrorCode error_code = 1;
|
||||
if (this->error_code() != 0) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::EnumSize(this->error_code());
|
||||
@ -414,22 +417,22 @@ size_t Status::ByteSizeLong() const {
|
||||
}
|
||||
|
||||
void Status::MergeFrom(const ::google::protobuf::Message& from) {
|
||||
// @@protoc_insertion_point(generalized_merge_from_start:milvus.Status)
|
||||
// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.Status)
|
||||
GOOGLE_DCHECK_NE(&from, this);
|
||||
const Status* source =
|
||||
::google::protobuf::DynamicCastToGenerated<Status>(
|
||||
&from);
|
||||
if (source == nullptr) {
|
||||
// @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.Status)
|
||||
// @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.Status)
|
||||
::google::protobuf::internal::ReflectionOps::Merge(from, this);
|
||||
} else {
|
||||
// @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.Status)
|
||||
// @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.Status)
|
||||
MergeFrom(*source);
|
||||
}
|
||||
}
|
||||
|
||||
void Status::MergeFrom(const Status& from) {
|
||||
// @@protoc_insertion_point(class_specific_merge_from_start:milvus.Status)
|
||||
// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.Status)
|
||||
GOOGLE_DCHECK_NE(&from, this);
|
||||
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
||||
::google::protobuf::uint32 cached_has_bits = 0;
|
||||
@ -445,14 +448,14 @@ void Status::MergeFrom(const Status& from) {
|
||||
}
|
||||
|
||||
void Status::CopyFrom(const ::google::protobuf::Message& from) {
|
||||
// @@protoc_insertion_point(generalized_copy_from_start:milvus.Status)
|
||||
// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.Status)
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
void Status::CopyFrom(const Status& from) {
|
||||
// @@protoc_insertion_point(class_specific_copy_from_start:milvus.Status)
|
||||
// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.Status)
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
@ -481,11 +484,12 @@ void Status::InternalSwap(Status* other) {
|
||||
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
} // namespace grpc
|
||||
} // namespace milvus
|
||||
namespace google {
|
||||
namespace protobuf {
|
||||
template<> PROTOBUF_NOINLINE ::milvus::Status* Arena::CreateMaybeMessage< ::milvus::Status >(Arena* arena) {
|
||||
return Arena::CreateInternal< ::milvus::Status >(arena);
|
||||
template<> PROTOBUF_NOINLINE ::milvus::grpc::Status* Arena::CreateMaybeMessage< ::milvus::grpc::Status >(Arena* arena) {
|
||||
return Arena::CreateInternal< ::milvus::grpc::Status >(arena);
|
||||
}
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
|
||||
@ -50,16 +50,19 @@ struct TableStruct_status_2eproto {
|
||||
};
|
||||
void AddDescriptors_status_2eproto();
|
||||
namespace milvus {
|
||||
namespace grpc {
|
||||
class Status;
|
||||
class StatusDefaultTypeInternal;
|
||||
extern StatusDefaultTypeInternal _Status_default_instance_;
|
||||
} // namespace grpc
|
||||
} // namespace milvus
|
||||
namespace google {
|
||||
namespace protobuf {
|
||||
template<> ::milvus::Status* Arena::CreateMaybeMessage<::milvus::Status>(Arena*);
|
||||
template<> ::milvus::grpc::Status* Arena::CreateMaybeMessage<::milvus::grpc::Status>(Arena*);
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
namespace milvus {
|
||||
namespace grpc {
|
||||
|
||||
enum ErrorCode {
|
||||
SUCCESS = 0,
|
||||
@ -105,7 +108,7 @@ inline bool ErrorCode_Parse(
|
||||
// ===================================================================
|
||||
|
||||
class Status final :
|
||||
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.Status) */ {
|
||||
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.Status) */ {
|
||||
public:
|
||||
Status();
|
||||
virtual ~Status();
|
||||
@ -213,13 +216,13 @@ class Status final :
|
||||
::std::string* release_reason();
|
||||
void set_allocated_reason(::std::string* reason);
|
||||
|
||||
// .milvus.ErrorCode error_code = 1;
|
||||
// .milvus.grpc.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);
|
||||
::milvus::grpc::ErrorCode error_code() const;
|
||||
void set_error_code(::milvus::grpc::ErrorCode value);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:milvus.Status)
|
||||
// @@protoc_insertion_point(class_scope:milvus.grpc.Status)
|
||||
private:
|
||||
class HasBitSetters;
|
||||
|
||||
@ -240,18 +243,18 @@ class Status final :
|
||||
#endif // __GNUC__
|
||||
// Status
|
||||
|
||||
// .milvus.ErrorCode error_code = 1;
|
||||
// .milvus.grpc.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 ::milvus::grpc::ErrorCode Status::error_code() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.Status.error_code)
|
||||
return static_cast< ::milvus::grpc::ErrorCode >(error_code_);
|
||||
}
|
||||
inline void Status::set_error_code(::milvus::ErrorCode value) {
|
||||
inline void Status::set_error_code(::milvus::grpc::ErrorCode value) {
|
||||
|
||||
error_code_ = value;
|
||||
// @@protoc_insertion_point(field_set:milvus.Status.error_code)
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.Status.error_code)
|
||||
}
|
||||
|
||||
// string reason = 2;
|
||||
@ -259,41 +262,41 @@ 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)
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.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)
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.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)
|
||||
// @@protoc_insertion_point(field_set_rvalue:milvus.grpc.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)
|
||||
// @@protoc_insertion_point(field_set_char:milvus.grpc.Status.reason)
|
||||
}
|
||||
inline void Status::set_reason(const char* value, size_t size) {
|
||||
|
||||
reason_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
|
||||
::std::string(reinterpret_cast<const char*>(value), size));
|
||||
// @@protoc_insertion_point(field_set_pointer:milvus.Status.reason)
|
||||
// @@protoc_insertion_point(field_set_pointer:milvus.grpc.Status.reason)
|
||||
}
|
||||
inline ::std::string* Status::mutable_reason() {
|
||||
|
||||
// @@protoc_insertion_point(field_mutable:milvus.Status.reason)
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.Status.reason)
|
||||
return reason_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline ::std::string* Status::release_reason() {
|
||||
// @@protoc_insertion_point(field_release:milvus.Status.reason)
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.Status.reason)
|
||||
|
||||
return reason_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
@ -304,7 +307,7 @@ inline void Status::set_allocated_reason(::std::string* reason) {
|
||||
|
||||
}
|
||||
reason_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), reason);
|
||||
// @@protoc_insertion_point(field_set_allocated:milvus.Status.reason)
|
||||
// @@protoc_insertion_point(field_set_allocated:milvus.grpc.Status.reason)
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
@ -313,15 +316,16 @@ inline void Status::set_allocated_reason(::std::string* reason) {
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
} // namespace grpc
|
||||
} // namespace milvus
|
||||
|
||||
namespace google {
|
||||
namespace protobuf {
|
||||
|
||||
template <> struct is_proto_enum< ::milvus::ErrorCode> : ::std::true_type {};
|
||||
template <> struct is_proto_enum< ::milvus::grpc::ErrorCode> : ::std::true_type {};
|
||||
template <>
|
||||
inline const EnumDescriptor* GetEnumDescriptor< ::milvus::ErrorCode>() {
|
||||
return ::milvus::ErrorCode_descriptor();
|
||||
inline const EnumDescriptor* GetEnumDescriptor< ::milvus::grpc::ErrorCode>() {
|
||||
return ::milvus::grpc::ErrorCode_descriptor();
|
||||
}
|
||||
|
||||
} // namespace protobuf
|
||||
|
||||
@ -8,7 +8,7 @@ package milvus.grpc;
|
||||
* @brief Table Name
|
||||
*/
|
||||
message TableName {
|
||||
milvus.Status status = 1;
|
||||
Status status = 1;
|
||||
string table_name = 2;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ message InsertInfos {
|
||||
* @brief Vector ids
|
||||
*/
|
||||
message VectorIds {
|
||||
milvus.Status status = 1;
|
||||
Status status = 1;
|
||||
repeated int64 vector_id_array = 2;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ message QueryResult {
|
||||
* @brief TopK query result
|
||||
*/
|
||||
message TopKQueryResult {
|
||||
milvus.Status status = 1;
|
||||
Status status = 1;
|
||||
repeated QueryResult query_result_arrays = 2;
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ message TopKQueryResult {
|
||||
* @brief Server String Reply
|
||||
*/
|
||||
message StringReply {
|
||||
milvus.Status status = 1;
|
||||
Status status = 1;
|
||||
string string_reply = 2;
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ message StringReply {
|
||||
* @brief Server bool Reply
|
||||
*/
|
||||
message BoolReply {
|
||||
milvus.Status status = 1;
|
||||
Status status = 1;
|
||||
bool bool_reply = 2;
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ message BoolReply {
|
||||
* @brief Return table row count
|
||||
*/
|
||||
message TableRowCount {
|
||||
milvus.Status status = 1;
|
||||
Status status = 1;
|
||||
int64 table_row_count = 2;
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ message Command {
|
||||
* @brief Give Server Command
|
||||
*/
|
||||
message ServerStatus{
|
||||
milvus.Status status = 1;
|
||||
Status status = 1;
|
||||
string info = 2;
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ service MilvusService {
|
||||
* @param param, use to provide table information to be created.
|
||||
*
|
||||
*/
|
||||
rpc CreateTable(TableSchema) returns (milvus.Status){}
|
||||
rpc CreateTable(TableSchema) returns (Status){}
|
||||
|
||||
/**
|
||||
* @brief Test table existence method
|
||||
@ -155,7 +155,7 @@ service MilvusService {
|
||||
* @param table_name, table name is going to be deleted.
|
||||
*
|
||||
*/
|
||||
rpc DropTable(TableName) returns (milvus.Status) {}
|
||||
rpc DropTable(TableName) returns (Status) {}
|
||||
|
||||
/**
|
||||
* @brief Build index by table method
|
||||
@ -165,7 +165,7 @@ service MilvusService {
|
||||
* @param table_name, table is going to be built index.
|
||||
*
|
||||
*/
|
||||
rpc BuildIndex(TableName) returns (milvus.Status) {}
|
||||
rpc BuildIndex(TableName) returns (Status) {}
|
||||
|
||||
/**
|
||||
* @brief Add vector array to table
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package milvus;
|
||||
package milvus.grpc;
|
||||
|
||||
enum ErrorCode {
|
||||
SUCCESS = 0;
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
# 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)
|
||||
@ -1,384 +0,0 @@
|
||||
#pragma onceinclude_directories(/usr/include)
|
||||
|
||||
|
||||
#include "Status.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
/** \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<float> data; ///< Vector raw data
|
||||
};
|
||||
|
||||
|
||||
//struct InsertInfos {
|
||||
// std::string table_name;
|
||||
// std::vector<RowRecord> row_record_array;
|
||||
//};
|
||||
|
||||
/**
|
||||
* @brief Vector ids for return
|
||||
*/
|
||||
struct VectorIds {
|
||||
StatusMsg status;
|
||||
std::vector<int64_t> vector_id_array;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Infos for searching vector
|
||||
*/
|
||||
struct SearchVectorInfos {
|
||||
std::string table_name;
|
||||
std::vector<RowRecord> query_record_array;
|
||||
std::vector<Range> query_range_array;
|
||||
int64_t topk;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Infos for searching vector in files
|
||||
*/
|
||||
struct SearchVectorInFilesInfos {
|
||||
std::vector<std::string> 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<QueryResult> 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<Connection>
|
||||
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> 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<RowRecord> &record_array,
|
||||
std::vector<int64_t> &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<RowRecord> &query_record_array,
|
||||
const std::vector<Range> &query_range_array,
|
||||
int64_t topk,
|
||||
std::vector<TopKQueryResult> &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<std::string> &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;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,330 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
/** \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<typename... Args>
|
||||
static Status OK(Args &&... args) {
|
||||
return Status(StatusCode::OK, MessageBuilder(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Invalid
|
||||
*
|
||||
* static Invalid status constructor with a specific message
|
||||
*
|
||||
* @param, serveral specific messages
|
||||
* @return, the status with Invalid.
|
||||
*
|
||||
*/
|
||||
template<typename... Args>
|
||||
static Status Invalid(Args &&... args) {
|
||||
return Status(StatusCode::InvalidAgument,
|
||||
MessageBuilder(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Unknown Error
|
||||
*
|
||||
* static unknown error status constructor with a specific message
|
||||
*
|
||||
* @param, serveral specific messages
|
||||
* @return, the status with unknown error.
|
||||
*
|
||||
*/
|
||||
template<typename... Args>
|
||||
static Status UnknownError(Args &&... args) {
|
||||
return Status(StatusCode::UnknownError, MessageBuilder(std::forward<Args>(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<typename... Args>
|
||||
static Status NotSupported(Args &&... args) {
|
||||
return Status(StatusCode::NotSupported, MessageBuilder(std::forward<Args>(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<typename Head>
|
||||
static void MessageBuilderRecursive(std::stringstream &stream, Head &&head) {
|
||||
stream << head;
|
||||
}
|
||||
|
||||
template<typename Head, typename... Tail>
|
||||
static void MessageBuilderRecursive(std::stringstream &stream, Head &&head, Tail &&... tail) {
|
||||
MessageBuilderRecursive(stream, std::forward<Head>(head));
|
||||
MessageBuilderRecursive(stream, std::forward<Tail>(tail)...);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
static std::string MessageBuilder(Args &&... args) {
|
||||
std::stringstream stream;
|
||||
|
||||
MessageBuilderRecursive(stream, std::forward<Args>(args)...);
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* 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<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) override;
|
||||
|
||||
virtual Status SearchVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &query_record_array,
|
||||
const std::vector<Range> &query_range_array,
|
||||
int64_t topk,
|
||||
std::vector<TopKQueryResult> &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<std::string> &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<grpcClient> client_ptr;
|
||||
bool connected_ = false;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <random>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <grpc/grpc.h>
|
||||
#include <grpcpp/channel.h>
|
||||
#include <grpcpp/client_context.h>
|
||||
#include <grpcpp/create_channel.h>
|
||||
#include <grpcpp/security/credentials.h>
|
||||
|
||||
#include "Status.h"
|
||||
#include "milvus.grpc.pb.h"
|
||||
#include "status.grpc.pb.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
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<std::string> &table_array);
|
||||
|
||||
void Ping(std::string &result, const std::string cmd);
|
||||
|
||||
void Disconnect();
|
||||
|
||||
private:
|
||||
std::unique_ptr<::milvus::grpc::MilvusService::Stub> stub_;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* 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 <exception>
|
||||
|
||||
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_;
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -1,102 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* 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_;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,245 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// 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 <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <csignal>
|
||||
//#include <numaif.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* 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 <cstdint>
|
||||
#include <string>
|
||||
|
||||
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
|
||||
@ -1,82 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
|
||||
// Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
// Proprietary and confidential.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include "ServerConfig.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
|
||||
#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*>(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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* 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);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,8 +3,7 @@
|
||||
// Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
// Proprietary and confidential.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//#include "server/Server.h"
|
||||
#include "grpcserver/Server.h"
|
||||
#include "server/Server.h"
|
||||
#include "version.h"
|
||||
|
||||
#include <getopt.h>
|
||||
|
||||
@ -4,32 +4,65 @@
|
||||
# Proprietary and confidential.
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
aux_source_directory(src/interface interface_files)
|
||||
aux_source_directory(src/client client_files)
|
||||
aux_source_directory(src/util util_files)
|
||||
aux_source_directory(interface interface_files)
|
||||
|
||||
aux_source_directory(util util_files)
|
||||
|
||||
include_directories(src)
|
||||
include_directories(include)
|
||||
include_directories(/usr/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp)
|
||||
include_directories(include)
|
||||
include_directories(/usr/local/include)
|
||||
|
||||
set(service_files
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/MilvusService.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/milvus_constants.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/milvus_types.cpp
|
||||
)
|
||||
if (MILVUS_ENABLE_THRIFT STREQUAL "ON")
|
||||
aux_source_directory(thrift thrift_client_files)
|
||||
include_directories(thrift)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp)
|
||||
|
||||
add_library(milvus_sdk STATIC
|
||||
${interface_files}
|
||||
${client_files}
|
||||
${util_files}
|
||||
${service_files}
|
||||
)
|
||||
set(thrift_service_files
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/MilvusService.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/milvus_constants.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/milvus_types.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(milvus_sdk
|
||||
${third_party_libs}
|
||||
)
|
||||
add_library(milvus_thrift_sdk STATIC
|
||||
${interface_files}
|
||||
${thrift_client_files}
|
||||
${util_files}
|
||||
${thrift_service_files}
|
||||
)
|
||||
|
||||
target_link_libraries(milvus_thrift_sdk
|
||||
${third_party_libs}
|
||||
)
|
||||
else()
|
||||
aux_source_directory(grpc grpc_client_files)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/grpc/gen-milvus)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/grpc/gen-status)
|
||||
|
||||
set(grpc_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}
|
||||
${grpc_client_files}
|
||||
${util_files}
|
||||
${grpc_service_files}
|
||||
)
|
||||
|
||||
target_link_libraries(milvus_grpc_sdk
|
||||
${third_party_libs}
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
if (MILVUS_ENABLE_THRIFT STREQUAL "ON")
|
||||
install(TARGETS milvus_thrift_sdk DESTINATION lib)
|
||||
else()
|
||||
install(TARGETS milvus_grpc_sdk DESTINATION lib)
|
||||
endif()
|
||||
|
||||
add_subdirectory(examples)
|
||||
|
||||
install(TARGETS milvus_sdk DESTINATION lib)
|
||||
|
||||
@ -4,4 +4,5 @@
|
||||
# Proprietary and confidential.
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
add_subdirectory(simple)
|
||||
add_subdirectory(thriftsimple)
|
||||
add_subdirectory(grpcsimple)
|
||||
@ -7,12 +7,12 @@
|
||||
aux_source_directory(src src_files)
|
||||
|
||||
include_directories(src)
|
||||
include_directories(../include)
|
||||
include_directories(../../include)
|
||||
|
||||
link_directories(${CMAKE_BINARY_DIR})
|
||||
|
||||
add_executable(grpc_sdk_simple
|
||||
./main.cpp
|
||||
main.cpp
|
||||
${src_files}
|
||||
)
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#include <thread>
|
||||
#include <unistd.h>
|
||||
|
||||
using namespace ::zilliz::milvus;
|
||||
using namespace milvus;
|
||||
|
||||
namespace {
|
||||
std::string GetTableName();
|
||||
@ -30,7 +30,7 @@ namespace {
|
||||
|
||||
void PrintTableSchema(const TableSchema& tb_schema) {
|
||||
BLOCK_SPLITER
|
||||
std::cout << "Table name: " << tb_schema.table_name.table_name << std::endl;
|
||||
std::cout << "Table name: " << tb_schema.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;
|
||||
@ -91,7 +91,7 @@ namespace {
|
||||
|
||||
TableSchema BuildTableSchema() {
|
||||
TableSchema tb_schema;
|
||||
tb_schema.table_name.table_name = TABLE_NAME;
|
||||
tb_schema.table_name = TABLE_NAME;
|
||||
tb_schema.index_type = IndexType::gpu_ivfflat;
|
||||
tb_schema.dimension = TABLE_DIMENSION;
|
||||
tb_schema.store_raw_vector = true;
|
||||
@ -221,7 +221,7 @@ ClientTest::Test(const std::string& address, const std::string& port) {
|
||||
std::cout << "CreateTable function call status: " << stat.ToString() << std::endl;
|
||||
PrintTableSchema(tb_schema);
|
||||
|
||||
bool has_table = conn->HasTable(tb_schema.table_name.table_name);
|
||||
bool has_table = conn->HasTable(tb_schema.table_name);
|
||||
if(has_table) {
|
||||
std::cout << "Table is created" << std::endl;
|
||||
}
|
||||
@ -282,8 +282,8 @@ ClientTest::Test(const std::string& address, const std::string& port) {
|
||||
std::string status = conn->ServerStatus();
|
||||
std::cout << "Server status before disconnect: " << status << std::endl;
|
||||
}
|
||||
// Connection::Destroy(conn);
|
||||
conn->Disconnect();
|
||||
Connection::Destroy(conn);
|
||||
// conn->Disconnect();
|
||||
{//server status
|
||||
std::string status = conn->ServerStatus();
|
||||
std::cout << "Server status after disconnect: " << status << std::endl;
|
||||
@ -11,14 +11,14 @@ include_directories(../../include)
|
||||
|
||||
link_directories(${CMAKE_BINARY_DIR})
|
||||
|
||||
add_executable(sdk_simple
|
||||
add_executable(thrift_sdk_simple
|
||||
./main.cpp
|
||||
${src_files}
|
||||
)
|
||||
|
||||
target_link_libraries(sdk_simple
|
||||
milvus_sdk
|
||||
target_link_libraries(thrift_sdk_simple
|
||||
milvus_thrift_sdk
|
||||
pthread
|
||||
)
|
||||
|
||||
install(TARGETS sdk_simple DESTINATION bin)
|
||||
install(TARGETS thrift_sdk_simple DESTINATION bin)
|
||||
@ -5,18 +5,16 @@
|
||||
******************************************************************************/
|
||||
#include "ClientProxy.h"
|
||||
#include "milvus.grpc.pb.h"
|
||||
#define GRPC_MULTIPLE_THREAD;
|
||||
|
||||
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_);
|
||||
client_ptr = new GrpcClient(channel_);
|
||||
|
||||
if (channel_ != nullptr) {
|
||||
connected_ = true;
|
||||
@ -26,10 +24,8 @@ ClientProxy::Connect(const ConnectParam ¶m) {
|
||||
|
||||
Status
|
||||
ClientProxy::Connect(const std::string &uri) {
|
||||
// Disconnect();
|
||||
|
||||
size_t index = uri.find_first_of(":", 0);
|
||||
if ((index == std::string::npos)) {
|
||||
size_t index = uri.find_first_of(':', 0);
|
||||
if (index == std::string::npos) {
|
||||
return Status::Invalid("Invalid uri");
|
||||
}
|
||||
|
||||
@ -54,8 +50,13 @@ ClientProxy::Connected() const {
|
||||
|
||||
Status
|
||||
ClientProxy::Disconnect() {
|
||||
connected_ = false;
|
||||
// delete client_ptr;
|
||||
try {
|
||||
client_ptr->Disconnect();
|
||||
connected_ = false;
|
||||
channel_.reset();
|
||||
}catch (std::exception &ex) {
|
||||
return Status(StatusCode::UnknownError, "failed to disconnect: " + std::string(ex.what()));
|
||||
}
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
@ -68,16 +69,12 @@ 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.mutable_table_name()->set_table_name(param.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
|
||||
client_ptr->CreateTable(schema);
|
||||
} catch (std::exception &ex) {
|
||||
return Status(StatusCode::UnknownError, "failed to create table: " + std::string(ex.what()));
|
||||
}
|
||||
@ -91,6 +88,11 @@ ClientProxy::HasTable(const std::string &table_name) {
|
||||
return client_ptr->HasTable(grpc_table_name);
|
||||
}
|
||||
|
||||
Status
|
||||
ClientProxy::DeleteTable(const std::string &table_name) {
|
||||
return this->DropTable(table_name);
|
||||
}
|
||||
|
||||
Status
|
||||
ClientProxy::DropTable(const std::string &table_name) {
|
||||
try {
|
||||
@ -119,45 +121,42 @@ ClientProxy::BuildIndex(const std::string &table_name) {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
Status
|
||||
ClientProxy::AddVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) {
|
||||
return InsertVector(table_name, record_array, id_array);
|
||||
}
|
||||
|
||||
Status
|
||||
ClientProxy::InsertVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &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;
|
||||
//
|
||||
// //Single thread
|
||||
// client_ptr->InsertVector(vector_ids, insert_infos);
|
||||
// auto finish = std::chrono::high_resolution_clock::now();
|
||||
//
|
||||
// for (size_t i = 0; i < vector_ids.vector_id_array_size(); i++) {
|
||||
// id_array.push_back(vector_ids.vector_id_array(i));
|
||||
// }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
#ifdef GRPC_MULTIPLE_THREAD
|
||||
//multithread
|
||||
std::vector<std::thread> 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];
|
||||
// TODO: Where delete following pointer? Can change it to shared_ptr?
|
||||
std::shared_ptr<::milvus::grpc::InsertInfos> insert_info_array(
|
||||
new ::milvus::grpc::InsertInfos[thread_count],
|
||||
std::default_delete<::milvus::grpc::InsertInfos[]>() );
|
||||
|
||||
std::shared_ptr<::milvus::grpc::VectorIds> vector_ids_array(
|
||||
new ::milvus::grpc::VectorIds[thread_count],
|
||||
std::default_delete<::milvus::grpc::VectorIds[]>() );
|
||||
|
||||
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);
|
||||
insert_info_array.get()[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();
|
||||
::milvus::grpc::RowRecord *grpc_record =
|
||||
insert_info_array.get()[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]);
|
||||
}
|
||||
@ -168,7 +167,8 @@ ClientProxy::InsertVector(const std::string &table_name,
|
||||
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::thread(&GrpcClient::InsertVector, client_ptr,
|
||||
std::ref(vector_ids_array.get()[j]), std::ref(insert_info_array.get()[j])));
|
||||
}
|
||||
std::for_each(threads.begin(), threads.end(), std::mem_fn(&std::thread::join));
|
||||
auto finish = std::chrono::high_resolution_clock::now();
|
||||
@ -176,13 +176,35 @@ ClientProxy::InsertVector(const std::string &table_name,
|
||||
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));
|
||||
for (size_t j = 0; j < vector_ids_array.get()[i].vector_id_array_size(); j++) {
|
||||
id_array.push_back(vector_ids_array.get()[i].vector_id_array(j));
|
||||
}
|
||||
}
|
||||
#else
|
||||
::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;
|
||||
|
||||
//Single thread
|
||||
client_ptr->InsertVector(vector_ids, insert_infos);
|
||||
auto finish = std::chrono::high_resolution_clock::now();
|
||||
|
||||
for (size_t i = 0; i < vector_ids.vector_id_array_size(); i++) {
|
||||
id_array.push_back(vector_ids.vector_id_array(i));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
} catch (std::exception &ex) {
|
||||
return Status(StatusCode::UnknownError, "failed to add vector: " + std::string(ex.what()));
|
||||
return Status(StatusCode::UnknownError, "fail to add vector: " + std::string(ex.what()));
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
@ -201,8 +223,8 @@ ClientProxy::SearchVector(const std::string &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]);
|
||||
for (auto &rec : record.data) {
|
||||
row_record->add_vector_data(rec);
|
||||
}
|
||||
}
|
||||
|
||||
@ -231,7 +253,7 @@ ClientProxy::SearchVector(const std::string &table_name,
|
||||
}
|
||||
|
||||
} catch (std::exception &ex) {
|
||||
return Status(StatusCode::UnknownError, "failed to search vectors: " + std::string(ex.what()));
|
||||
return Status(StatusCode::UnknownError, "fail to search vectors: " + std::string(ex.what()));
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
@ -244,12 +266,12 @@ ClientProxy::DescribeTable(const std::string &table_name, TableSchema &table_sch
|
||||
|
||||
client_ptr->DescribeTable(grpc_schema, table_name);
|
||||
|
||||
table_schema.table_name.table_name = grpc_schema.table_name().table_name();
|
||||
table_schema.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(StatusCode::UnknownError, "fail to describe table: " + std::string(ex.what()));
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
@ -261,7 +283,7 @@ ClientProxy::GetTableRowCount(const std::string &table_name, int64_t &row_count)
|
||||
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(StatusCode::UnknownError, "fail to show tables: " + std::string(ex.what()));
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
@ -273,7 +295,7 @@ ClientProxy::ShowTables(std::vector<std::string> &table_array) {
|
||||
client_ptr->ShowTables(table_array);
|
||||
|
||||
} catch (std::exception &ex) {
|
||||
return Status(StatusCode::UnknownError, "failed to show tables: " + std::string(ex.what()));
|
||||
return Status(StatusCode::UnknownError, "fail to show tables: " + std::string(ex.what()));
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
@ -292,7 +314,7 @@ ClientProxy::ServerVersion() const {
|
||||
|
||||
std::string
|
||||
ClientProxy::ServerStatus() const {
|
||||
if (connected_ == false) {
|
||||
if (channel_ == nullptr) {
|
||||
return "not connected to server";
|
||||
}
|
||||
|
||||
@ -306,4 +328,3 @@ ClientProxy::ServerStatus() const {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
87
cpp/src/sdk/grpc/ClientProxy.h
Normal file
87
cpp/src/sdk/grpc/ClientProxy.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include "src/sdk/include/MilvusApi.h"
|
||||
#include "GrpcClient.h"
|
||||
|
||||
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
|
||||
DeleteTable(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
|
||||
AddVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) override;
|
||||
|
||||
virtual Status
|
||||
InsertVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) override;
|
||||
|
||||
virtual Status
|
||||
SearchVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &query_record_array,
|
||||
const std::vector<Range> &query_range_array,
|
||||
int64_t topk,
|
||||
std::vector<TopKQueryResult> &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<std::string> &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<GrpcClient> client_ptr;
|
||||
bool connected_ = false;
|
||||
};
|
||||
|
||||
}
|
||||
@ -9,7 +9,7 @@
|
||||
#include <grpcpp/create_channel.h>
|
||||
#include <grpcpp/security/credentials.h>
|
||||
|
||||
#include "grpcClient.h"
|
||||
#include "GrpcClient.h"
|
||||
|
||||
using grpc::Channel;
|
||||
using grpc::ClientContext;
|
||||
@ -18,75 +18,91 @@ using grpc::ClientReaderWriter;
|
||||
using grpc::ClientWriter;
|
||||
using grpc::Status;
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
grpcClient::grpcClient(std::shared_ptr<::grpc::Channel> channel)
|
||||
GrpcClient::GrpcClient(std::shared_ptr<::grpc::Channel>& channel)
|
||||
: stub_(::milvus::grpc::MilvusService::NewStub(channel)) {
|
||||
|
||||
}
|
||||
|
||||
grpcClient::~grpcClient() {
|
||||
|
||||
}
|
||||
GrpcClient::~GrpcClient() = default;
|
||||
|
||||
void
|
||||
grpcClient::CreateTable(const ::milvus::grpc::TableSchema table_schema) {
|
||||
GrpcClient::CreateTable(const ::milvus::grpc::TableSchema& table_schema) {
|
||||
ClientContext context;
|
||||
::milvus::Status response;
|
||||
grpc::Status response;
|
||||
::grpc::Status status = stub_->CreateTable(&context, table_schema, &response);
|
||||
|
||||
if (!status.ok()) {
|
||||
std::cout << "CreateTable rpc failed!\n";
|
||||
std::cerr << "CreateTable gRPC failed!" << std::endl;
|
||||
}
|
||||
|
||||
if (response.error_code() != grpc::SUCCESS) {
|
||||
std::cerr << response.reason() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
grpcClient::HasTable(const ::milvus::grpc::TableName table_name) {
|
||||
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";
|
||||
std::cerr << "HasTable gRPC failed!" << std::endl;
|
||||
}
|
||||
if (response.status().error_code() != grpc::SUCCESS) {
|
||||
std::cerr << response.status().reason() << std::endl;
|
||||
}
|
||||
return response.bool_reply();
|
||||
}
|
||||
|
||||
void
|
||||
grpcClient::DropTable(const ::milvus::grpc::TableName table_name) {
|
||||
GrpcClient::DropTable(const ::milvus::grpc::TableName& table_name) {
|
||||
ClientContext context;
|
||||
::milvus::Status response;
|
||||
grpc::Status response;
|
||||
::grpc::Status status = stub_->DropTable(&context, table_name, &response);
|
||||
|
||||
if (!status.ok()) {
|
||||
std::cout << "DropTable rpc failed!\n";
|
||||
std::cerr << "DropTable gRPC failed!\n";
|
||||
}
|
||||
|
||||
if (response.error_code() != grpc::SUCCESS) {
|
||||
std::cerr << response.reason() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grpcClient::BuildIndex(const ::milvus::grpc::TableName table_name) {
|
||||
GrpcClient::BuildIndex(const ::milvus::grpc::TableName& table_name) {
|
||||
ClientContext context;
|
||||
::milvus::Status response;
|
||||
grpc::Status response;
|
||||
::grpc::Status status = stub_->BuildIndex(&context, table_name, &response);
|
||||
|
||||
if (!status.ok()) {
|
||||
std::cout << "BuildIndex rpc failed!\n";
|
||||
std::cerr << "BuildIndex rpc failed!\n";
|
||||
}
|
||||
|
||||
if (response.error_code() != grpc::SUCCESS) {
|
||||
std::cerr << response.reason() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grpcClient::InsertVector(::milvus::grpc::VectorIds& vector_ids, const ::milvus::grpc::InsertInfos insert_infos) {
|
||||
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";
|
||||
std::cerr << "InsertVector rpc failed!\n";
|
||||
}
|
||||
|
||||
if (vector_ids.status().error_code() != grpc::SUCCESS) {
|
||||
std::cerr << vector_ids.status().reason() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grpcClient::SearchVector(std::vector<::milvus::grpc::TopKQueryResult>& result_array,
|
||||
const ::milvus::grpc::SearchVectorInfos search_vector_infos) {
|
||||
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<ClientReader<::milvus::grpc::TopKQueryResult> > reader(
|
||||
@ -99,37 +115,52 @@ grpcClient::SearchVector(std::vector<::milvus::grpc::TopKQueryResult>& result_ar
|
||||
::grpc::Status status = reader->Finish();
|
||||
|
||||
if (!status.ok()) {
|
||||
std::cout << "SearchVector rpc failed!\n";
|
||||
std::cerr << "SearchVector rpc failed!\n";
|
||||
}
|
||||
|
||||
if (query_result.status().error_code() != grpc::SUCCESS) {
|
||||
std::cerr << query_result.status().reason() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grpcClient::DescribeTable(::milvus::grpc::TableSchema &grpc_schema, const std::string table_name) {
|
||||
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";
|
||||
std::cerr << "DescribeTable rpc failed!\n";
|
||||
}
|
||||
|
||||
if (grpc_schema.table_name().status().error_code() != grpc::SUCCESS) {
|
||||
std::cerr << grpc_schema.table_name().status().reason() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
int64_t
|
||||
grpcClient::GetTableRowCount(const std::string table_name) {
|
||||
GrpcClient::GetTableRowCount(const std::string& table_name) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::TableRowCount response;
|
||||
::milvus::grpc::TableName grpc_tablename;
|
||||
grpc_tablename.set_table_name(table_name);
|
||||
::grpc::Status status = stub_->GetTableRowCount(&context, grpc_tablename, &response);
|
||||
|
||||
if (!status.ok()) {
|
||||
std::cout << "DescribeTable rpc failed!\n";
|
||||
std::cerr << "DescribeTable rpc failed!\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (response.status().error_code() != grpc::SUCCESS) {
|
||||
std::cerr << response.status().reason() << std::endl;
|
||||
return -1;
|
||||
}
|
||||
return response.table_row_count();
|
||||
}
|
||||
|
||||
void
|
||||
grpcClient::ShowTables(std::vector<std::string> &table_array) {
|
||||
GrpcClient::ShowTables(std::vector<std::string> &table_array) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::Command command;
|
||||
std::unique_ptr<ClientReader<::milvus::grpc::TableName> > reader(
|
||||
@ -142,12 +173,16 @@ grpcClient::ShowTables(std::vector<std::string> &table_array) {
|
||||
::grpc::Status status = reader->Finish();
|
||||
|
||||
if (!status.ok()) {
|
||||
std::cout << "ShowTables rpc failed!\n";
|
||||
std::cerr << "ShowTables gRPC failed!" << std::endl;
|
||||
}
|
||||
|
||||
if (table_name.status().error_code() != grpc::SUCCESS) {
|
||||
std::cerr << table_name.status().reason() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grpcClient::Ping(std::string &result, const std::string cmd) {
|
||||
GrpcClient::Ping(std::string &result, const std::string& cmd) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::ServerStatus response;
|
||||
::milvus::grpc::Command command;
|
||||
@ -156,13 +191,17 @@ grpcClient::Ping(std::string &result, const std::string cmd) {
|
||||
|
||||
result = response.info();
|
||||
if (!status.ok()) {
|
||||
std::cout << "Ping rpc failed!\n";
|
||||
std::cerr << "Ping gRPC failed!" << std::endl;
|
||||
}
|
||||
|
||||
if (response.status().error_code() != grpc::SUCCESS) {
|
||||
std::cerr << response.status().reason() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grpcClient::Disconnect() {
|
||||
GrpcClient::Disconnect() {
|
||||
stub_.release();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
59
cpp/src/sdk/grpc/GrpcClient.h
Normal file
59
cpp/src/sdk/grpc/GrpcClient.h
Normal file
@ -0,0 +1,59 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <random>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <grpc/grpc.h>
|
||||
#include <grpcpp/channel.h>
|
||||
#include <grpcpp/client_context.h>
|
||||
#include <grpcpp/create_channel.h>
|
||||
#include <grpcpp/security/credentials.h>
|
||||
|
||||
#include "milvus.grpc.pb.h"
|
||||
//#include "status.grpc.pb.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace milvus {
|
||||
class GrpcClient {
|
||||
public:
|
||||
explicit GrpcClient(std::shared_ptr<::grpc::Channel>& channel);
|
||||
|
||||
virtual ~GrpcClient();
|
||||
|
||||
void CreateTable(const grpc::TableSchema& table_schema);
|
||||
|
||||
bool HasTable(const grpc::TableName& table_name);
|
||||
|
||||
void DropTable(const grpc::TableName& table_name);
|
||||
|
||||
void BuildIndex(const grpc::TableName& table_name);
|
||||
|
||||
void InsertVector(grpc::VectorIds& vector_ids, const grpc::InsertInfos& insert_infos);
|
||||
|
||||
void SearchVector(std::vector<grpc::TopKQueryResult>& result_array,
|
||||
const grpc::SearchVectorInfos& search_vector_infos);
|
||||
|
||||
void DescribeTable(grpc::TableSchema& grpc_schema, const std::string& table_name);
|
||||
|
||||
int64_t GetTableRowCount(const std::string& table_name);
|
||||
|
||||
void ShowTables(std::vector<std::string> &table_array);
|
||||
|
||||
void Ping(std::string &result, const std::string& cmd);
|
||||
|
||||
void Disconnect();
|
||||
|
||||
private:
|
||||
std::unique_ptr<grpc::MilvusService::Stub> stub_;
|
||||
};
|
||||
|
||||
}
|
||||
@ -75,7 +75,7 @@ struct TopKQueryResult {
|
||||
* @brief SDK main class
|
||||
*/
|
||||
class Connection {
|
||||
public:
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief CreateConnection
|
||||
@ -99,7 +99,7 @@ public:
|
||||
*/
|
||||
|
||||
static Status
|
||||
Destroy(std::shared_ptr<Connection> connection_ptr);
|
||||
Destroy(std::shared_ptr<Connection>& connection_ptr);
|
||||
|
||||
/**
|
||||
* @brief Connect
|
||||
@ -178,6 +178,8 @@ public:
|
||||
*
|
||||
* @return Indicate if table is delete successfully.
|
||||
*/
|
||||
virtual Status DropTable(const std::string &table_name) = 0;
|
||||
|
||||
virtual Status DeleteTable(const std::string &table_name) = 0;
|
||||
|
||||
|
||||
@ -203,6 +205,10 @@ public:
|
||||
*
|
||||
* @return Indicate if vector array are inserted successfully
|
||||
*/
|
||||
virtual Status InsertVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) = 0;
|
||||
|
||||
virtual Status AddVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) = 0;
|
||||
|
||||
@ -4,28 +4,28 @@
|
||||
#include <sstream>
|
||||
|
||||
/** \brief Milvus SDK namespace
|
||||
*/
|
||||
*/
|
||||
namespace milvus {
|
||||
|
||||
/**
|
||||
* @brief Status Code for SDK interface return
|
||||
*/
|
||||
* @brief Status Code for SDK interface return
|
||||
*/
|
||||
enum class StatusCode {
|
||||
OK = 0,
|
||||
// system error section
|
||||
// system error section
|
||||
UnknownError = 1,
|
||||
NotSupported,
|
||||
NotConnected,
|
||||
|
||||
// function error section
|
||||
// function error section
|
||||
InvalidAgument = 1000,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Status for SDK interface return
|
||||
*/
|
||||
* @brief Status for SDK interface return
|
||||
*/
|
||||
class Status {
|
||||
public:
|
||||
public:
|
||||
/**
|
||||
* @brief Status
|
||||
*
|
||||
@ -161,169 +161,168 @@ class Status {
|
||||
template<typename... Args>
|
||||
static Status OK(Args &&... args) {
|
||||
return Status(StatusCode::OK, MessageBuilder(std::forward<Args>(args)...));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Invalid
|
||||
*
|
||||
* static Invalid status constructor with a specific message
|
||||
*
|
||||
* @param, serveral specific messages
|
||||
* @return, the status with Invalid.
|
||||
*
|
||||
*/
|
||||
template<typename... Args>
|
||||
static Status Invalid(Args &&... args) {
|
||||
return Status(StatusCode::InvalidAgument,
|
||||
MessageBuilder(std::forward<Args>(args)...));
|
||||
}
|
||||
/**
|
||||
* @brief Invalid
|
||||
*
|
||||
* static Invalid status constructor with a specific message
|
||||
*
|
||||
* @param, serveral specific messages
|
||||
* @return, the status with Invalid.
|
||||
*
|
||||
*/
|
||||
template<typename... Args>
|
||||
static Status Invalid(Args &&... args) {
|
||||
return Status(StatusCode::InvalidAgument,
|
||||
MessageBuilder(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Unknown Error
|
||||
*
|
||||
* static unknown error status constructor with a specific message
|
||||
*
|
||||
* @param, serveral specific messages
|
||||
* @return, the status with unknown error.
|
||||
*
|
||||
*/
|
||||
template<typename... Args>
|
||||
static Status UnknownError(Args &&... args) {
|
||||
return Status(StatusCode::UnknownError, MessageBuilder(std::forward<Args>(args)...));
|
||||
}
|
||||
/**
|
||||
* @brief Unknown Error
|
||||
*
|
||||
* static unknown error status constructor with a specific message
|
||||
*
|
||||
* @param, serveral specific messages
|
||||
* @return, the status with unknown error.
|
||||
*
|
||||
*/
|
||||
template<typename... Args>
|
||||
static Status UnknownError(Args &&... args) {
|
||||
return Status(StatusCode::UnknownError, MessageBuilder(std::forward<Args>(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<typename... Args>
|
||||
static Status NotSupported(Args &&... args) {
|
||||
return Status(StatusCode::NotSupported, MessageBuilder(std::forward<Args>(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<typename... Args>
|
||||
static Status NotSupported(Args &&... args) {
|
||||
return Status(StatusCode::NotSupported, MessageBuilder(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ok
|
||||
*
|
||||
* Return true iff the status indicates success.
|
||||
*
|
||||
* @return, if the status indicates success.
|
||||
*
|
||||
*/
|
||||
bool ok() const { return (state_ == nullptr); }
|
||||
/**
|
||||
* @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 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 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 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 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 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 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; }
|
||||
/**
|
||||
* @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<typename Head>
|
||||
static void MessageBuilderRecursive(std::stringstream &stream, Head &&head) {
|
||||
stream << head;
|
||||
}
|
||||
|
||||
template<typename Head, typename... Tail>
|
||||
static void MessageBuilderRecursive(std::stringstream &stream, Head &&head, Tail &&... tail) {
|
||||
MessageBuilderRecursive(stream, std::forward<Head>(head));
|
||||
MessageBuilderRecursive(stream, std::forward<Tail>(tail)...);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
static std::string MessageBuilder(Args &&... args) {
|
||||
std::stringstream stream;
|
||||
|
||||
MessageBuilderRecursive(stream, std::forward<Args>(args)...);
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
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<typename Head>
|
||||
static void MessageBuilderRecursive(std::stringstream &stream, Head &&head) {
|
||||
stream << head;
|
||||
}
|
||||
|
||||
template<typename Head, typename... Tail>
|
||||
static void MessageBuilderRecursive(std::stringstream &stream, Head &&head, Tail &&... tail) {
|
||||
MessageBuilderRecursive(stream, std::forward<Head>(head));
|
||||
MessageBuilderRecursive(stream, std::forward<Tail>(tail)...);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
static std::string MessageBuilder(Args &&... args) {
|
||||
std::stringstream stream;
|
||||
|
||||
MessageBuilderRecursive(stream, std::forward<Args>(args)...);
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -6,7 +6,6 @@
|
||||
#include "ConnectionImpl.h"
|
||||
#include "version.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
|
||||
std::shared_ptr<Connection>
|
||||
@ -15,10 +14,10 @@ Connection::Create() {
|
||||
}
|
||||
|
||||
Status
|
||||
Connection::Destroy(std::shared_ptr<milvus::Connection> connection_ptr) {
|
||||
// if (connection_ptr != nullptr) {
|
||||
// return connection_ptr->Disconnect();
|
||||
// }
|
||||
Connection::Destroy(std::shared_ptr<milvus::Connection>& connection_ptr) {
|
||||
if (connection_ptr != nullptr) {
|
||||
return connection_ptr->Disconnect();
|
||||
}
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
@ -67,6 +66,11 @@ ConnectionImpl::DropTable(const std::string &table_name) {
|
||||
return client_proxy_->DropTable(table_name);
|
||||
}
|
||||
|
||||
Status
|
||||
ConnectionImpl::DeleteTable(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);
|
||||
@ -79,6 +83,13 @@ ConnectionImpl::InsertVector(const std::string &table_name,
|
||||
return client_proxy_->InsertVector(table_name, record_array, id_array);
|
||||
}
|
||||
|
||||
Status
|
||||
ConnectionImpl::AddVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) {
|
||||
return client_proxy_->InsertVector(table_name, record_array, id_array);
|
||||
}
|
||||
|
||||
Status
|
||||
ConnectionImpl::SearchVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &query_record_array,
|
||||
@ -115,4 +126,3 @@ ConnectionImpl::ServerStatus() const {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -5,10 +5,9 @@
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
//#include "MilvusApi.h"
|
||||
#include "client/ClientProxy.h"
|
||||
#include "../include/MilvusApi.h"
|
||||
#include "src/sdk/grpc/ClientProxy.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
|
||||
class ConnectionImpl : public Connection {
|
||||
@ -30,12 +29,18 @@ public:
|
||||
|
||||
virtual Status DropTable(const std::string &table_name) override;
|
||||
|
||||
virtual Status DeleteTable(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<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) override;
|
||||
|
||||
virtual Status AddVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) override;
|
||||
|
||||
virtual Status SearchVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &query_record_array,
|
||||
const std::vector<Range> &query_range_array,
|
||||
@ -59,4 +64,3 @@ private:
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
@ -3,9 +3,8 @@
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#include "Status.h"
|
||||
#include "../include/Status.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
|
||||
Status::~Status() noexcept {
|
||||
@ -126,4 +125,4 @@ std::string Status::ToString() const {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,116 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* 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 milvus {
|
||||
|
||||
std::shared_ptr<Connection>
|
||||
Connection::Create() {
|
||||
return std::shared_ptr<Connection>(new ConnectionImpl());
|
||||
}
|
||||
|
||||
Status
|
||||
Connection::Destroy(std::shared_ptr<milvus::Connection> connection_ptr) {
|
||||
if(connection_ptr != nullptr) {
|
||||
return connection_ptr->Disconnect();
|
||||
}
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
ConnectionImpl::ConnectionImpl() {
|
||||
client_proxy_ = std::make_shared<ClientProxy>();
|
||||
}
|
||||
|
||||
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::DeleteTable(const std::string &table_name) {
|
||||
return client_proxy_->DeleteTable(table_name);
|
||||
}
|
||||
|
||||
Status
|
||||
ConnectionImpl::BuildIndex(const std::string &table_name) {
|
||||
return client_proxy_->BuildIndex(table_name);
|
||||
}
|
||||
|
||||
Status
|
||||
ConnectionImpl::AddVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) {
|
||||
return client_proxy_->AddVector(table_name, record_array, id_array);
|
||||
}
|
||||
|
||||
Status
|
||||
ConnectionImpl::SearchVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &query_record_array,
|
||||
const std::vector<Range> &query_range_array,
|
||||
int64_t topk,
|
||||
std::vector<TopKQueryResult> &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<std::string> &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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* 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 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 DeleteTable(const std::string &table_name) override;
|
||||
|
||||
virtual Status BuildIndex(const std::string &table_name) override;
|
||||
|
||||
virtual Status AddVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) override;
|
||||
|
||||
virtual Status SearchVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &query_record_array,
|
||||
const std::vector<Range> &query_range_array,
|
||||
int64_t topk,
|
||||
std::vector<TopKQueryResult> &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<std::string> &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<ClientProxy> client_proxy_;
|
||||
};
|
||||
|
||||
}
|
||||
@ -1,122 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#include "Status.h"
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@ -127,6 +127,11 @@ ClientProxy::DeleteTable(const std::string &table_name) {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
Status
|
||||
ClientProxy::DropTable(const std::string &table_name) {
|
||||
return this->DeleteTable(table_name);
|
||||
}
|
||||
|
||||
Status
|
||||
ClientProxy::BuildIndex(const std::string &table_name) {
|
||||
if(!IsConnected()) {
|
||||
@ -173,6 +178,13 @@ ClientProxy::AddVector(const std::string &table_name,
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
Status
|
||||
ClientProxy::InsertVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) {
|
||||
return this->AddVector(table_name, record_array, id_array);
|
||||
}
|
||||
|
||||
Status
|
||||
ClientProxy::SearchVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &query_record_array,
|
||||
@ -191,7 +203,7 @@ ClientProxy::SearchVector(const std::string &table_name,
|
||||
thrift::RowRecord thrift_record;
|
||||
|
||||
thrift_record.vector_data.resize(record.data.size() * sizeof(double));
|
||||
double *dbl = (double *) (const_cast<char *>(thrift_record.vector_data.data()));
|
||||
auto dbl = (double *) (const_cast<char *>(thrift_record.vector_data.data()));
|
||||
for (size_t i = 0; i < record.data.size(); i++) {
|
||||
dbl[i] = (double) (record.data[i]);
|
||||
}
|
||||
@ -223,8 +235,8 @@ ClientProxy::SearchVector(const std::string &table_name,
|
||||
return Status(StatusCode::UnknownError, "illegal result");
|
||||
}
|
||||
|
||||
int64_t* id_ptr = (int64_t*)thrift_topk_result.id_array.data();
|
||||
double* dist_ptr = (double*)thrift_topk_result.distance_array.data();
|
||||
auto id_ptr = (int64_t*)thrift_topk_result.id_array.data();
|
||||
auto dist_ptr = (double*)thrift_topk_result.distance_array.data();
|
||||
for(size_t i = 0; i < id_count; i++) {
|
||||
QueryResult query_result;
|
||||
query_result.id = id_ptr[i];
|
||||
@ -27,12 +27,18 @@ public:
|
||||
|
||||
virtual Status DeleteTable(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 AddVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) override;
|
||||
|
||||
virtual Status InsertVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &record_array,
|
||||
std::vector<int64_t> &id_array) override;
|
||||
|
||||
virtual Status SearchVector(const std::string &table_name,
|
||||
const std::vector<RowRecord> &query_record_array,
|
||||
const std::vector<Range> &query_range_array,
|
||||
@ -4,8 +4,13 @@
|
||||
// Proprietary and confidential.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include "Server.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "MilvusServer.h"
|
||||
//#include "ServerConfig.h"
|
||||
#ifdef MILVUS_ENABLE_THRIFT
|
||||
#include "server/thrift_impl/MilvusServer.h"
|
||||
#else
|
||||
#include "server/grpc_impl/MilvusServer.h"
|
||||
#endif
|
||||
|
||||
#include "utils/Log.h"
|
||||
#include "utils/SignalUtil.h"
|
||||
#include "utils/TimeRecorder.h"
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
******************************************************************************/
|
||||
#include "milvus.grpc.pb.h"
|
||||
#include "MilvusServer.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "DBWrapper.h"
|
||||
#include "../ServerConfig.h"
|
||||
#include "../DBWrapper.h"
|
||||
#include "utils/Log.h"
|
||||
#include "faiss/utils.h"
|
||||
#include "RequestHandler.h"
|
||||
@ -28,15 +28,10 @@
|
||||
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> server;
|
||||
static std::unique_ptr<grpc::Server> server;
|
||||
|
||||
constexpr long MESSAGE_SIZE = 400 * 1024 * 1024;
|
||||
|
||||
void
|
||||
MilvusServer::StartService() {
|
||||
@ -52,34 +47,25 @@ MilvusServer::StartService() {
|
||||
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");
|
||||
std::string server_address(address + ":" + std::to_string(port));
|
||||
|
||||
ServerBuilder builder;
|
||||
builder.SetMaxReceiveMessageSize(400 * 1024 * 1024); //default 4 * 1024 * 1024
|
||||
builder.SetMaxSendMessageSize(400 * 1024 * 1024);
|
||||
grpc::ServerBuilder builder;
|
||||
builder.SetMaxReceiveMessageSize(MESSAGE_SIZE); //default 4 * 1024 * 1024
|
||||
builder.SetMaxSendMessageSize(MESSAGE_SIZE);
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
@ -7,17 +7,6 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <grpc/grpc.h>
|
||||
#include <grpcpp/server.h>
|
||||
#include <grpcpp/server_builder.h>
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/security/server_credentials.h>
|
||||
|
||||
using grpc::Channel;
|
||||
using grpc::ClientContext;
|
||||
using grpc::ClientReader;
|
||||
using grpc::ClientReaderWriter;
|
||||
using grpc::ClientWriter;
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
@ -13,18 +13,17 @@ namespace milvus {
|
||||
namespace server {
|
||||
|
||||
::grpc::Status
|
||||
RequestHandler::CreateTable(::grpc::ServerContext *context, const ::milvus::grpc::TableSchema *request, ::milvus::Status *response) {
|
||||
RequestHandler::CreateTable(::grpc::ServerContext *context, const ::milvus::grpc::TableSchema *request, ::milvus::grpc::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;
|
||||
::milvus::grpc::Status grpc_status;
|
||||
RequestScheduler::ExecTask(task_ptr, &grpc_status);
|
||||
response->set_bool_reply(has_table);
|
||||
response->mutable_status()->set_reason(grpc_status.reason());
|
||||
@ -33,14 +32,14 @@ RequestHandler::HasTable(::grpc::ServerContext *context, const ::milvus::grpc::T
|
||||
}
|
||||
|
||||
::grpc::Status
|
||||
RequestHandler::DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response) {
|
||||
RequestHandler::DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::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) {
|
||||
RequestHandler::BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) {
|
||||
BaseTaskPtr task_ptr = BuildIndexTask::Create(request->table_name());
|
||||
RequestScheduler::ExecTask(task_ptr, response);
|
||||
return ::grpc::Status::OK;
|
||||
@ -49,7 +48,7 @@ RequestHandler::BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc:
|
||||
::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;
|
||||
::milvus::grpc::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());
|
||||
@ -59,7 +58,6 @@ RequestHandler::InsertVector(::grpc::ServerContext* context, const ::milvus::grp
|
||||
::grpc::Status
|
||||
RequestHandler::SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer) {
|
||||
std::vector<std::string> 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;
|
||||
@ -76,7 +74,7 @@ RequestHandler::SearchVectorInFiles(::grpc::ServerContext* context, const ::milv
|
||||
::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;
|
||||
::milvus::grpc::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());
|
||||
@ -87,7 +85,7 @@ RequestHandler::DescribeTable(::grpc::ServerContext* context, const ::milvus::gr
|
||||
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;
|
||||
::milvus::grpc::Status grpc_status;
|
||||
RequestScheduler::ExecTask(task_ptr, &grpc_status);
|
||||
response->set_table_row_count(row_count);
|
||||
response->mutable_status()->set_reason(grpc_status.reason());
|
||||
@ -106,7 +104,7 @@ RequestHandler::ShowTables(::grpc::ServerContext* context, const ::milvus::grpc:
|
||||
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;
|
||||
::milvus::grpc::Status grpc_status;
|
||||
RequestScheduler::ExecTask(task_ptr, &grpc_status);
|
||||
response->set_info(result);
|
||||
response->mutable_status()->set_reason(grpc_status.reason());
|
||||
@ -26,7 +26,9 @@ public:
|
||||
*
|
||||
* @param param
|
||||
*/
|
||||
::grpc::Status CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::Status* response);
|
||||
::grpc::Status
|
||||
CreateTable(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response) override ;
|
||||
|
||||
/**
|
||||
* @brief Test table existence method
|
||||
@ -38,7 +40,9 @@ public:
|
||||
*
|
||||
* @param table_name
|
||||
*/
|
||||
::grpc::Status HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response);
|
||||
::grpc::Status
|
||||
HasTable(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response) override ;
|
||||
|
||||
/**
|
||||
* @brief Drop table method
|
||||
@ -50,7 +54,9 @@ public:
|
||||
*
|
||||
* @param table_name
|
||||
*/
|
||||
::grpc::Status DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response);
|
||||
::grpc::Status
|
||||
DropTable(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) override;
|
||||
|
||||
/**
|
||||
* @brief build index by table method
|
||||
@ -62,7 +68,9 @@ public:
|
||||
*
|
||||
* @param table_name
|
||||
*/
|
||||
::grpc::Status BuildIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::Status* response);
|
||||
::grpc::Status
|
||||
BuildIndex(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) override;
|
||||
|
||||
|
||||
/**
|
||||
@ -78,7 +86,9 @@ public:
|
||||
* @param table_name
|
||||
* @param record_array
|
||||
*/
|
||||
::grpc::Status InsertVector(::grpc::ServerContext* context, const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response);
|
||||
::grpc::Status
|
||||
InsertVector(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::InsertInfos* request, ::milvus::grpc::VectorIds* response) override;
|
||||
|
||||
/**
|
||||
* @brief Query vector
|
||||
@ -97,7 +107,9 @@ public:
|
||||
* @param query_range_array
|
||||
* @param topk
|
||||
*/
|
||||
::grpc::Status SearchVector(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer);
|
||||
::grpc::Status
|
||||
SearchVector(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::SearchVectorInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer) override;
|
||||
|
||||
/**
|
||||
* @brief Internal use query interface
|
||||
@ -116,7 +128,9 @@ public:
|
||||
* @param query_range_array
|
||||
* @param topk
|
||||
*/
|
||||
::grpc::Status SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer);
|
||||
::grpc::Status
|
||||
SearchVectorInFiles(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer) override;
|
||||
|
||||
/**
|
||||
* @brief Get table schema
|
||||
@ -129,7 +143,9 @@ public:
|
||||
*
|
||||
* @param table_name
|
||||
*/
|
||||
::grpc::Status DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response);
|
||||
::grpc::Status
|
||||
DescribeTable(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) override;
|
||||
|
||||
/**
|
||||
* @brief Get table row count
|
||||
@ -142,7 +158,9 @@ public:
|
||||
*
|
||||
* @param table_name
|
||||
*/
|
||||
::grpc::Status GetTableRowCount(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response);
|
||||
::grpc::Status
|
||||
GetTableRowCount(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) override;
|
||||
|
||||
/**
|
||||
* @brief List all tables in database
|
||||
@ -152,7 +170,9 @@ public:
|
||||
*
|
||||
* @return table names.
|
||||
*/
|
||||
::grpc::Status ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer);
|
||||
::grpc::Status
|
||||
ShowTables(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::Command* request, ::grpc::ServerWriter< ::milvus::grpc::TableName>* writer) override;
|
||||
|
||||
/**
|
||||
* @brief Give the server status
|
||||
@ -164,7 +184,9 @@ public:
|
||||
*
|
||||
* @param cmd
|
||||
*/
|
||||
::grpc::Status Ping(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response);
|
||||
::grpc::Status
|
||||
Ping(::grpc::ServerContext* context,
|
||||
const ::milvus::grpc::Command* request, ::milvus::grpc::ServerStatus* response) override;
|
||||
|
||||
};
|
||||
}
|
||||
@ -6,7 +6,7 @@
|
||||
#include "RequestScheduler.h"
|
||||
#include "utils/Log.h"
|
||||
|
||||
#include "../grpc/gen-status/status.pb.h"
|
||||
#include "src/grpc/gen-status/status.pb.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
@ -15,34 +15,34 @@ namespace server {
|
||||
using namespace ::milvus;
|
||||
|
||||
namespace {
|
||||
const std::map<ServerError, ::milvus::ErrorCode > &ErrorMap() {
|
||||
static const std::map<ServerError, ::milvus::ErrorCode> 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},
|
||||
const std::map<ServerError, ::milvus::grpc::ErrorCode > &ErrorMap() {
|
||||
static const std::map<ServerError, ::milvus::grpc::ErrorCode> code_map = {
|
||||
{SERVER_UNEXPECTED_ERROR, ::milvus::grpc::ErrorCode::UNEXPECTED_ERROR},
|
||||
{SERVER_UNSUPPORTED_ERROR, ::milvus::grpc::ErrorCode::UNEXPECTED_ERROR},
|
||||
{SERVER_NULL_POINTER, ::milvus::grpc::ErrorCode::UNEXPECTED_ERROR},
|
||||
{SERVER_INVALID_ARGUMENT, ::milvus::grpc::ErrorCode::ILLEGAL_ARGUMENT},
|
||||
{SERVER_FILE_NOT_FOUND, ::milvus::grpc::ErrorCode::FILE_NOT_FOUND},
|
||||
{SERVER_NOT_IMPLEMENT, ::milvus::grpc::ErrorCode::UNEXPECTED_ERROR},
|
||||
{SERVER_BLOCKING_QUEUE_EMPTY, ::milvus::grpc::ErrorCode::UNEXPECTED_ERROR},
|
||||
{SERVER_CANNOT_CREATE_FOLDER, ::milvus::grpc::ErrorCode::CANNOT_CREATE_FOLDER},
|
||||
{SERVER_CANNOT_CREATE_FILE, ::milvus::grpc::ErrorCode::CANNOT_CREATE_FILE},
|
||||
{SERVER_CANNOT_DELETE_FOLDER, ::milvus::grpc::ErrorCode::CANNOT_DELETE_FOLDER},
|
||||
{SERVER_CANNOT_DELETE_FILE, ::milvus::grpc::ErrorCode::CANNOT_DELETE_FILE},
|
||||
{SERVER_TABLE_NOT_EXIST, ::milvus::grpc::ErrorCode::TABLE_NOT_EXISTS},
|
||||
{SERVER_INVALID_TABLE_NAME, ::milvus::grpc::ErrorCode::ILLEGAL_TABLE_NAME},
|
||||
{SERVER_INVALID_TABLE_DIMENSION, ::milvus::grpc::ErrorCode::ILLEGAL_DIMENSION},
|
||||
{SERVER_INVALID_TIME_RANGE, ::milvus::grpc::ErrorCode::ILLEGAL_RANGE},
|
||||
{SERVER_INVALID_VECTOR_DIMENSION, ::milvus::grpc::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},
|
||||
{SERVER_INVALID_INDEX_TYPE, ::milvus::grpc::ErrorCode::ILLEGAL_INDEX_TYPE},
|
||||
{SERVER_INVALID_ROWRECORD, ::milvus::grpc::ErrorCode::ILLEGAL_ROWRECORD},
|
||||
{SERVER_INVALID_ROWRECORD_ARRAY, ::milvus::grpc::ErrorCode::ILLEGAL_ROWRECORD},
|
||||
{SERVER_INVALID_TOPK, ::milvus::grpc::ErrorCode::ILLEGAL_TOPK},
|
||||
{SERVER_ILLEGAL_VECTOR_ID, ::milvus::grpc::ErrorCode::ILLEGAL_VECTOR_ID},
|
||||
{SERVER_ILLEGAL_SEARCH_RESULT, ::milvus::grpc::ErrorCode::ILLEGAL_SEARCH_RESULT},
|
||||
{SERVER_CACHE_ERROR, ::milvus::grpc::ErrorCode::CACHE_FAILED},
|
||||
{DB_META_TRANSACTION_FAILED, ::milvus::grpc::ErrorCode::META_FAILED},
|
||||
{SERVER_BUILD_INDEX_ERROR, ::milvus::grpc::ErrorCode::BUILD_INDEX_ERROR},
|
||||
};
|
||||
|
||||
return code_map;
|
||||
@ -94,7 +94,7 @@ RequestScheduler::~RequestScheduler() {
|
||||
Stop();
|
||||
}
|
||||
|
||||
void RequestScheduler::ExecTask(BaseTaskPtr& task_ptr, ::milvus::Status *grpc_status) {
|
||||
void RequestScheduler::ExecTask(BaseTaskPtr& task_ptr, ::milvus::grpc::Status *grpc_status) {
|
||||
if(task_ptr == nullptr) {
|
||||
return;
|
||||
}
|
||||
@ -102,22 +102,15 @@ void RequestScheduler::ExecTask(BaseTaskPtr& task_ptr, ::milvus::Status *grpc_st
|
||||
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;
|
||||
grpc_status->set_error_code(::milvus::grpc::ErrorCode((int) err));
|
||||
} else {
|
||||
// grpc_status->set_error_code(::milvus::ErrorCode((int) SERVER_SUCCESS));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -66,7 +66,7 @@ public:
|
||||
|
||||
ServerError ExecuteTask(const BaseTaskPtr& task_ptr);
|
||||
|
||||
static void ExecTask(BaseTaskPtr& task_ptr, ::milvus::Status* grpc_status);
|
||||
static void ExecTask(BaseTaskPtr& task_ptr, ::milvus::grpc::Status* grpc_status);
|
||||
|
||||
protected:
|
||||
RequestScheduler();
|
||||
@ -4,23 +4,23 @@
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#include "RequestTask.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "../ServerConfig.h"
|
||||
#include "utils/CommonUtil.h"
|
||||
#include "utils/Log.h"
|
||||
#include "utils/TimeRecorder.h"
|
||||
#include "utils/ValidationUtil.h"
|
||||
#include "DBWrapper.h"
|
||||
#include "../DBWrapper.h"
|
||||
#include "version.h"
|
||||
#include "MilvusServer.h"
|
||||
|
||||
#include "Server.h"
|
||||
#include "src/server/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";
|
||||
static const char* DQL_TASK_GROUP = "dql";
|
||||
static const char* DDL_DML_TASK_GROUP = "ddl_dml";
|
||||
static const char* PING_TASK_GROUP = "ping";
|
||||
|
||||
using DB_META = zilliz::milvus::engine::meta::Meta;
|
||||
using DB_DATE = zilliz::milvus::engine::meta::DateT;
|
||||
@ -55,21 +55,8 @@ namespace {
|
||||
|
||||
return map_type[type];
|
||||
}
|
||||
|
||||
void
|
||||
ConvertRowRecordToFloatArray(const ::milvus::grpc::InsertInfos insert_infos,
|
||||
uint64_t dimension,
|
||||
std::vector<float>& 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;
|
||||
constexpr long DAY_SECONDS = 24 * 60 * 60;
|
||||
|
||||
void
|
||||
ConvertTimeRangeToDBDates(const std::vector<::milvus::grpc::Range> &range_array,
|
||||
@ -112,13 +99,13 @@ namespace {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
CreateTableTask::CreateTableTask(const ::milvus::grpc::TableSchema schema)
|
||||
CreateTableTask::CreateTableTask(const ::milvus::grpc::TableSchema& schema)
|
||||
: BaseTask(DDL_DML_TASK_GROUP),
|
||||
schema_(schema) {
|
||||
|
||||
}
|
||||
|
||||
BaseTaskPtr CreateTableTask::Create(const ::milvus::grpc::TableSchema schema) {
|
||||
BaseTaskPtr CreateTableTask::Create(const ::milvus::grpc::TableSchema& schema) {
|
||||
return std::shared_ptr<BaseTask>(new CreateTableTask(schema));
|
||||
}
|
||||
|
||||
@ -127,8 +114,7 @@ ServerError CreateTableTask::OnExecute() {
|
||||
|
||||
try {
|
||||
//step 1: check arguments
|
||||
ServerError res = SERVER_SUCCESS;
|
||||
res = ValidateTableName(schema_.table_name().table_name());
|
||||
ServerError res = ValidateTableName(schema_.table_name().table_name());
|
||||
if(res != SERVER_SUCCESS) {
|
||||
return SetError(res, "Invalid table name: " + schema_.table_name().table_name());
|
||||
}
|
||||
@ -152,7 +138,8 @@ ServerError CreateTableTask::OnExecute() {
|
||||
|
||||
//step 3: create table
|
||||
engine::Status stat = DBWrapper::DB()->CreateTable(table_info);
|
||||
if(!stat.ok()) {//table could exist
|
||||
if(!stat.ok()) {
|
||||
//table could exist
|
||||
return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString());
|
||||
}
|
||||
|
||||
@ -181,8 +168,7 @@ ServerError DescribeTableTask::OnExecute() {
|
||||
|
||||
try {
|
||||
//step 1: check arguments
|
||||
ServerError res = SERVER_SUCCESS;
|
||||
res = ValidateTableName(table_name_);
|
||||
ServerError res = ValidateTableName(table_name_);
|
||||
if(res != SERVER_SUCCESS) {
|
||||
return SetError(res, "Invalid table name: " + table_name_);
|
||||
}
|
||||
@ -225,14 +211,17 @@ ServerError BuildIndexTask::OnExecute() {
|
||||
TimeRecorder rc("BuildIndexTask");
|
||||
|
||||
//step 1: check arguments
|
||||
ServerError res = SERVER_SUCCESS;
|
||||
res = ValidateTableName(table_name_);
|
||||
ServerError 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(!stat.ok()) {
|
||||
return SetError(DB_META_TRANSACTION_FAILED, "Engine failed: " + stat.ToString());
|
||||
}
|
||||
|
||||
if(!has_table) {
|
||||
return SetError(SERVER_TABLE_NOT_EXIST, "Table " + table_name_ + " not exists");
|
||||
}
|
||||
@ -252,14 +241,14 @@ ServerError BuildIndexTask::OnExecute() {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
HasTableTask::HasTableTask(const std::string table_name, bool& has_table)
|
||||
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) {
|
||||
BaseTaskPtr HasTableTask::Create(const std::string& table_name, bool& has_table) {
|
||||
return std::shared_ptr<BaseTask>(new HasTableTask(table_name, has_table));
|
||||
}
|
||||
|
||||
@ -268,8 +257,7 @@ ServerError HasTableTask::OnExecute() {
|
||||
TimeRecorder rc("HasTableTask");
|
||||
|
||||
//step 1: check arguments
|
||||
ServerError res = SERVER_SUCCESS;
|
||||
res = ValidateTableName(table_name_);
|
||||
ServerError res = ValidateTableName(table_name_);
|
||||
if(res != SERVER_SUCCESS) {
|
||||
return SetError(res, "Invalid table name: " + table_name_);
|
||||
}
|
||||
@ -304,8 +292,7 @@ ServerError DropTableTask::OnExecute() {
|
||||
TimeRecorder rc("DropTableTask");
|
||||
|
||||
//step 1: check arguments
|
||||
ServerError res = SERVER_SUCCESS;
|
||||
res = ValidateTableName(table_name_);
|
||||
ServerError res = ValidateTableName(table_name_);
|
||||
if(res != SERVER_SUCCESS) {
|
||||
return SetError(res, "Invalid table name: " + table_name_);
|
||||
}
|
||||
@ -340,13 +327,13 @@ ServerError DropTableTask::OnExecute() {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
ShowTablesTask::ShowTablesTask(::grpc::ServerWriter< ::milvus::grpc::TableName> writer)
|
||||
ShowTablesTask::ShowTablesTask(::grpc::ServerWriter< ::milvus::grpc::TableName>& writer)
|
||||
: BaseTask(DDL_DML_TASK_GROUP),
|
||||
writer_(writer) {
|
||||
|
||||
}
|
||||
|
||||
BaseTaskPtr ShowTablesTask::Create(::grpc::ServerWriter< ::milvus::grpc::TableName> writer) {
|
||||
BaseTaskPtr ShowTablesTask::Create(::grpc::ServerWriter< ::milvus::grpc::TableName>& writer) {
|
||||
return std::shared_ptr<BaseTask>(new ShowTablesTask(writer));
|
||||
}
|
||||
|
||||
@ -366,7 +353,7 @@ ServerError ShowTablesTask::OnExecute() {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
InsertVectorTask::InsertVectorTask(const ::milvus::grpc::InsertInfos insert_infos,
|
||||
InsertVectorTask::InsertVectorTask(const ::milvus::grpc::InsertInfos& insert_infos,
|
||||
::milvus::grpc::VectorIds& record_ids)
|
||||
: BaseTask(DDL_DML_TASK_GROUP),
|
||||
insert_infos_(insert_infos),
|
||||
@ -374,7 +361,7 @@ InsertVectorTask::InsertVectorTask(const ::milvus::grpc::InsertInfos insert_info
|
||||
record_ids_.Clear();
|
||||
}
|
||||
|
||||
BaseTaskPtr InsertVectorTask::Create(const ::milvus::grpc::InsertInfos insert_infos,
|
||||
BaseTaskPtr InsertVectorTask::Create(const ::milvus::grpc::InsertInfos& insert_infos,
|
||||
::milvus::grpc::VectorIds& record_ids) {
|
||||
return std::shared_ptr<BaseTask>(new InsertVectorTask(insert_infos, record_ids));
|
||||
}
|
||||
@ -384,8 +371,7 @@ ServerError InsertVectorTask::OnExecute() {
|
||||
TimeRecorder rc("InsertVectorTask");
|
||||
|
||||
//step 1: check arguments
|
||||
ServerError res = SERVER_SUCCESS;
|
||||
res = ValidateTableName(insert_infos_.table_name());
|
||||
ServerError res = ValidateTableName(insert_infos_.table_name());
|
||||
if(res != SERVER_SUCCESS) {
|
||||
return SetError(res, "Invalid table name: " + insert_infos_.table_name());
|
||||
}
|
||||
@ -414,9 +400,9 @@ ServerError InsertVectorTask::OnExecute() {
|
||||
#endif
|
||||
|
||||
//step 3: prepare float data
|
||||
std::vector<float> vec_f;
|
||||
std::vector<float> vec_f(insert_infos_.row_record_array_size() * table_info.dimension_, 0);
|
||||
|
||||
vec_f.resize(insert_infos_.row_record_array_size() * table_info.dimension_);
|
||||
// TODO: change to one dimension array in protobuf or use multiple-thread to copy the data
|
||||
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);
|
||||
@ -426,23 +412,22 @@ ServerError InsertVectorTask::OnExecute() {
|
||||
rc.ElapseFromBegin("prepare vectors data");
|
||||
|
||||
//step 4: insert vectors
|
||||
uint64_t vec_count = (uint64_t)insert_infos_.row_record_array_size();
|
||||
std::vector<int64_t> vec_ids;
|
||||
vec_ids.resize(record_ids_.vector_id_array_size());
|
||||
vec_ids.clear();
|
||||
auto vec_count = (uint64_t)insert_infos_.row_record_array_size();
|
||||
std::vector<int64_t> vec_ids(record_ids_.vector_id_array_size(), 0);
|
||||
|
||||
stat = DBWrapper::DB()->InsertVectors(insert_infos_.table_name(), vec_count, vec_f.data(), vec_ids);
|
||||
rc.ElapseFromBegin("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));
|
||||
for (int64_t id : vec_ids) {
|
||||
record_ids_.add_vector_id_array(id);
|
||||
}
|
||||
|
||||
if(record_ids_.vector_id_array_size() != vec_count) {
|
||||
auto ids_size = record_ids_.vector_id_array_size();
|
||||
if(ids_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";
|
||||
+ std::to_string(ids_size) + " id";
|
||||
return SetError(SERVER_ILLEGAL_VECTOR_ID, msg);
|
||||
}
|
||||
|
||||
@ -461,20 +446,20 @@ ServerError InsertVectorTask::OnExecute() {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
SearchVectorTask::SearchVectorTask(const ::milvus::grpc::SearchVectorInfos searchVectorInfos,
|
||||
const std::vector<std::string> file_id_array,
|
||||
::grpc::ServerWriter<::milvus::grpc::TopKQueryResult> writer)
|
||||
SearchVectorTask::SearchVectorTask(const ::milvus::grpc::SearchVectorInfos& search_vector_infos,
|
||||
const std::vector<std::string>& file_id_array,
|
||||
::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>& writer)
|
||||
: BaseTask(DQL_TASK_GROUP),
|
||||
searchVector_infos_(searchVectorInfos),
|
||||
search_vector_infos_(search_vector_infos),
|
||||
file_id_array_(file_id_array),
|
||||
writer_(writer) {
|
||||
|
||||
}
|
||||
|
||||
BaseTaskPtr SearchVectorTask::Create(const ::milvus::grpc::SearchVectorInfos searchVectorInfos,
|
||||
const std::vector<std::string> file_id_array,
|
||||
::grpc::ServerWriter<::milvus::grpc::TopKQueryResult> writer) {
|
||||
return std::shared_ptr<BaseTask>(new SearchVectorTask(searchVectorInfos, file_id_array,
|
||||
BaseTaskPtr SearchVectorTask::Create(const ::milvus::grpc::SearchVectorInfos& search_vector_infos,
|
||||
const std::vector<std::string>& file_id_array,
|
||||
::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>& writer) {
|
||||
return std::shared_ptr<BaseTask>(new SearchVectorTask(search_vector_infos, file_id_array,
|
||||
writer));
|
||||
}
|
||||
|
||||
@ -483,20 +468,19 @@ ServerError SearchVectorTask::OnExecute() {
|
||||
TimeRecorder rc("SearchVectorTask");
|
||||
|
||||
//step 1: check arguments
|
||||
ServerError res = SERVER_SUCCESS;
|
||||
std::string table_name_ = searchVector_infos_.table_name();
|
||||
res = ValidateTableName(table_name_);
|
||||
std::string table_name_ = search_vector_infos_.table_name();
|
||||
ServerError res = ValidateTableName(table_name_);
|
||||
if(res != SERVER_SUCCESS) {
|
||||
return SetError(res, "Invalid table name: " + table_name_);
|
||||
}
|
||||
|
||||
int top_k_ = searchVector_infos_.topk();
|
||||
int top_k_ = search_vector_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()) {
|
||||
if(search_vector_infos_.query_record_array().empty()) {
|
||||
return SetError(SERVER_INVALID_ROWRECORD_ARRAY, "Row record array is empty");
|
||||
}
|
||||
|
||||
@ -518,8 +502,8 @@ ServerError SearchVectorTask::OnExecute() {
|
||||
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));
|
||||
for (size_t i = 0; i < search_vector_infos_.query_range_array_size(); i++) {
|
||||
range_array.emplace_back(search_vector_infos_.query_range_array(i));
|
||||
}
|
||||
ConvertTimeRangeToDBDates(range_array, dates, error_code, error_msg);
|
||||
if(error_code != SERVER_SUCCESS) {
|
||||
@ -536,19 +520,19 @@ ServerError SearchVectorTask::OnExecute() {
|
||||
#endif
|
||||
|
||||
//step 3: prepare float data
|
||||
std::vector<float> 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++) {
|
||||
auto record_array_size = search_vector_infos_.query_record_array_size();
|
||||
std::vector<float> vec_f(record_array_size * table_info.dimension_, 0);
|
||||
//TODO
|
||||
for (size_t i = 0; i < 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);
|
||||
vec_f[i * table_info.dimension_ + j] = search_vector_infos_.query_record_array(i).vector_data(j);
|
||||
}
|
||||
}
|
||||
rc.ElapseFromBegin("prepare vector data");
|
||||
|
||||
//step 4: search vectors
|
||||
engine::QueryResults results;
|
||||
uint64_t record_count = (uint64_t)searchVector_infos_.query_record_array().size();
|
||||
auto record_count = (uint64_t)search_vector_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);
|
||||
@ -577,7 +561,7 @@ ServerError SearchVectorTask::OnExecute() {
|
||||
//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);
|
||||
const auto &record = search_vector_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();
|
||||
@ -604,14 +588,14 @@ ServerError SearchVectorTask::OnExecute() {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
GetTableRowCountTask::GetTableRowCountTask(const std::string table_name, int64_t& row_count)
|
||||
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) {
|
||||
BaseTaskPtr GetTableRowCountTask::Create(const std::string& table_name, int64_t& row_count) {
|
||||
return std::shared_ptr<BaseTask>(new GetTableRowCountTask(table_name, row_count));
|
||||
}
|
||||
|
||||
@ -661,7 +645,6 @@ ServerError PingTask::OnExecute() {
|
||||
result_ = MILVUS_VERSION;
|
||||
} else if (cmd_ == "disconnect") {
|
||||
//TODO stopservice
|
||||
// MilvusServer::StopService();
|
||||
}
|
||||
|
||||
return SERVER_SUCCESS;
|
||||
@ -21,10 +21,10 @@ namespace server {
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class CreateTableTask : public BaseTask {
|
||||
public:
|
||||
static BaseTaskPtr Create(const ::milvus::grpc::TableSchema schema);
|
||||
static BaseTaskPtr Create(const ::milvus::grpc::TableSchema& schema);
|
||||
|
||||
protected:
|
||||
CreateTableTask(const ::milvus::grpc::TableSchema request);
|
||||
explicit CreateTableTask(const ::milvus::grpc::TableSchema& request);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
@ -35,10 +35,10 @@ private:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class HasTableTask : public BaseTask {
|
||||
public:
|
||||
static BaseTaskPtr Create(const std::string table_name, bool& has_table);
|
||||
static BaseTaskPtr Create(const std::string& table_name, bool& has_table);
|
||||
|
||||
protected:
|
||||
HasTableTask(const std::string request, bool& has_table);
|
||||
HasTableTask(const std::string& request, bool& has_table);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
@ -70,7 +70,7 @@ public:
|
||||
static BaseTaskPtr Create(const std::string& table_name);
|
||||
|
||||
protected:
|
||||
DropTableTask(const std::string& table_name);
|
||||
explicit DropTableTask(const std::string& table_name);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
@ -85,7 +85,7 @@ public:
|
||||
static BaseTaskPtr Create(const std::string& table_name);
|
||||
|
||||
protected:
|
||||
BuildIndexTask(const std::string& table_name);
|
||||
explicit BuildIndexTask(const std::string& table_name);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
@ -97,10 +97,10 @@ private:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class ShowTablesTask : public BaseTask {
|
||||
public:
|
||||
static BaseTaskPtr Create(::grpc::ServerWriter< ::milvus::grpc::TableName> writer);
|
||||
static BaseTaskPtr Create(::grpc::ServerWriter< ::milvus::grpc::TableName>& writer);
|
||||
|
||||
protected:
|
||||
ShowTablesTask(::grpc::ServerWriter< ::milvus::grpc::TableName> writer);
|
||||
explicit ShowTablesTask(::grpc::ServerWriter< ::milvus::grpc::TableName>& writer);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
@ -111,11 +111,11 @@ private:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class InsertVectorTask : public BaseTask {
|
||||
public:
|
||||
static BaseTaskPtr Create(const ::milvus::grpc::InsertInfos insert_infos,
|
||||
static BaseTaskPtr Create(const ::milvus::grpc::InsertInfos& insert_infos,
|
||||
::milvus::grpc::VectorIds& record_ids_);
|
||||
|
||||
protected:
|
||||
InsertVectorTask(const ::milvus::grpc::InsertInfos insert_infos,
|
||||
InsertVectorTask(const ::milvus::grpc::InsertInfos& insert_infos,
|
||||
::milvus::grpc::VectorIds& record_ids_);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
@ -128,19 +128,19 @@ private:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class SearchVectorTask : public BaseTask {
|
||||
public:
|
||||
static BaseTaskPtr Create(const ::milvus::grpc::SearchVectorInfos searchVectorInfos,
|
||||
const std::vector<std::string> file_id_array,
|
||||
::grpc::ServerWriter<::milvus::grpc::TopKQueryResult> writer);
|
||||
static BaseTaskPtr Create(const ::milvus::grpc::SearchVectorInfos& searchVectorInfos,
|
||||
const std::vector<std::string>& file_id_array,
|
||||
::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>& writer);
|
||||
|
||||
protected:
|
||||
SearchVectorTask(const ::milvus::grpc::SearchVectorInfos searchVectorInfos,
|
||||
const std::vector<std::string> file_id_array,
|
||||
::grpc::ServerWriter<::milvus::grpc::TopKQueryResult> writer);
|
||||
SearchVectorTask(const ::milvus::grpc::SearchVectorInfos& searchVectorInfos,
|
||||
const std::vector<std::string>& file_id_array,
|
||||
::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>& writer);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
private:
|
||||
const ::milvus::grpc::SearchVectorInfos searchVector_infos_;
|
||||
const ::milvus::grpc::SearchVectorInfos search_vector_infos_;
|
||||
std::vector<std::string> file_id_array_;
|
||||
::grpc::ServerWriter<::milvus::grpc::TopKQueryResult> writer_;
|
||||
};
|
||||
@ -148,16 +148,16 @@ private:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class GetTableRowCountTask : public BaseTask {
|
||||
public:
|
||||
static BaseTaskPtr Create(const std::string table_name, int64_t& row_count);
|
||||
static BaseTaskPtr Create(const std::string& table_name, int64_t& row_count);
|
||||
|
||||
protected:
|
||||
GetTableRowCountTask(const std::string table_name, int64_t& row_count);
|
||||
GetTableRowCountTask(const std::string& table_name, int64_t& row_count);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
private:
|
||||
std::string table_name_;
|
||||
int64_t row_count_;
|
||||
int64_t& row_count_;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -5,9 +5,9 @@
|
||||
******************************************************************************/
|
||||
#include "MilvusServer.h"
|
||||
#include "RequestHandler.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "src/server/ServerConfig.h"
|
||||
#include "ThreadPoolServer.h"
|
||||
#include "DBWrapper.h"
|
||||
#include "src/server/DBWrapper.h"
|
||||
#include "utils/Log.h"
|
||||
|
||||
#include "milvus_types.h"
|
||||
@ -4,12 +4,12 @@
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#include "RequestTask.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "src/server/ServerConfig.h"
|
||||
#include "utils/CommonUtil.h"
|
||||
#include "utils/Log.h"
|
||||
#include "utils/TimeRecorder.h"
|
||||
#include "utils/ValidationUtil.h"
|
||||
#include "DBWrapper.h"
|
||||
#include "src/server/DBWrapper.h"
|
||||
#include "version.h"
|
||||
|
||||
#ifdef MILVUS_ENABLE_PROFILING
|
||||
@ -4,7 +4,7 @@
|
||||
// Proprietary and confidential.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include "SignalUtil.h"
|
||||
#include "server/Server.h"
|
||||
#include "src/server/Server.h"
|
||||
#include "utils/Log.h"
|
||||
|
||||
#include <signal.h>
|
||||
@ -16,7 +16,6 @@ namespace server {
|
||||
|
||||
void SignalUtil::HandleSignal(int signum){
|
||||
|
||||
|
||||
switch(signum){
|
||||
case SIGINT:
|
||||
case SIGUSR2:{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user