# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from . import milvus_pb2 as milvus__pb2
from . import status_pb2 as status__pb2
[docs]class MilvusServiceStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.CreateTable = channel.unary_unary(
'/milvus.grpc.MilvusService/CreateTable',
request_serializer=milvus__pb2.TableSchema.SerializeToString,
response_deserializer=status__pb2.Status.FromString,
)
self.HasTable = channel.unary_unary(
'/milvus.grpc.MilvusService/HasTable',
request_serializer=milvus__pb2.TableName.SerializeToString,
response_deserializer=milvus__pb2.BoolReply.FromString,
)
self.DropTable = channel.unary_unary(
'/milvus.grpc.MilvusService/DropTable',
request_serializer=milvus__pb2.TableName.SerializeToString,
response_deserializer=status__pb2.Status.FromString,
)
self.CreateIndex = channel.unary_unary(
'/milvus.grpc.MilvusService/CreateIndex',
request_serializer=milvus__pb2.IndexParam.SerializeToString,
response_deserializer=status__pb2.Status.FromString,
)
self.Insert = channel.unary_unary(
'/milvus.grpc.MilvusService/Insert',
request_serializer=milvus__pb2.InsertParam.SerializeToString,
response_deserializer=milvus__pb2.VectorIds.FromString,
)
self.Search = channel.unary_unary(
'/milvus.grpc.MilvusService/Search',
request_serializer=milvus__pb2.SearchParam.SerializeToString,
response_deserializer=milvus__pb2.TopKQueryResult.FromString,
)
self.SearchInFiles = channel.unary_unary(
'/milvus.grpc.MilvusService/SearchInFiles',
request_serializer=milvus__pb2.SearchInFilesParam.SerializeToString,
response_deserializer=milvus__pb2.TopKQueryResult.FromString,
)
self.DescribeTable = channel.unary_unary(
'/milvus.grpc.MilvusService/DescribeTable',
request_serializer=milvus__pb2.TableName.SerializeToString,
response_deserializer=milvus__pb2.TableSchema.FromString,
)
self.CountTable = channel.unary_unary(
'/milvus.grpc.MilvusService/CountTable',
request_serializer=milvus__pb2.TableName.SerializeToString,
response_deserializer=milvus__pb2.TableRowCount.FromString,
)
self.ShowTables = channel.unary_unary(
'/milvus.grpc.MilvusService/ShowTables',
request_serializer=milvus__pb2.Command.SerializeToString,
response_deserializer=milvus__pb2.TableNameList.FromString,
)
self.Cmd = channel.unary_unary(
'/milvus.grpc.MilvusService/Cmd',
request_serializer=milvus__pb2.Command.SerializeToString,
response_deserializer=milvus__pb2.StringReply.FromString,
)
self.DeleteByRange = channel.unary_unary(
'/milvus.grpc.MilvusService/DeleteByRange',
request_serializer=milvus__pb2.DeleteByRangeParam.SerializeToString,
response_deserializer=status__pb2.Status.FromString,
)
self.PreloadTable = channel.unary_unary(
'/milvus.grpc.MilvusService/PreloadTable',
request_serializer=milvus__pb2.TableName.SerializeToString,
response_deserializer=status__pb2.Status.FromString,
)
self.DescribeIndex = channel.unary_unary(
'/milvus.grpc.MilvusService/DescribeIndex',
request_serializer=milvus__pb2.TableName.SerializeToString,
response_deserializer=milvus__pb2.IndexParam.FromString,
)
self.DropIndex = channel.unary_unary(
'/milvus.grpc.MilvusService/DropIndex',
request_serializer=milvus__pb2.TableName.SerializeToString,
response_deserializer=status__pb2.Status.FromString,
)
[docs]class MilvusServiceServicer(object):
# missing associated documentation comment in .proto file
pass
[docs] def CreateTable(self, request, context):
"""*
@brief Create table method
This method is used to create table
@param param, use to provide table information to be created.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def HasTable(self, request, context):
"""*
@brief Test table existence method
This method is used to test table existence.
@param table_name, table name is going to be tested.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def DropTable(self, request, context):
"""*
@brief Delete table method
This method is used to delete table.
@param table_name, table name is going to be deleted.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def CreateIndex(self, request, context):
"""*
@brief Build index by table method
This method is used to build index by table in sync mode.
@param table_name, table is going to be built index.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def Insert(self, request, context):
"""*
@brief Add vector array to table
This method is used to add vector array to table.
@param table_name, table_name is inserted.
@param record_array, vector array is inserted.
@return vector id array
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def Search(self, request, context):
"""*
@brief Query vector
This method is used to query vector in table.
@param table_name, table_name is queried.
@param query_record_array, all vector are going to be queried.
@param query_range_array, optional ranges for conditional search. If not specified, search whole table
@param topk, how many similarity vectors will be searched.
@return query result array.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def SearchInFiles(self, request, context):
"""*
@brief Internal use query interface
This method is used to query vector in specified files.
@param file_id_array, specified files id array, queried.
@param query_record_array, all vector are going to be queried.
@param query_range_array, optional ranges for conditional search. If not specified, search whole table
@param topk, how many similarity vectors will be searched.
@return query result array.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def DescribeTable(self, request, context):
"""*
@brief Get table schema
This method is used to get table schema.
@param table_name, target table name.
@return table schema
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def CountTable(self, request, context):
"""*
@brief Get table schema
This method is used to get table schema.
@param table_name, target table name.
@return table schema
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def ShowTables(self, request, context):
"""*
@brief List all tables in database
This method is used to list all tables.
@return table names.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def Cmd(self, request, context):
"""*
@brief Give the server status
This method is used to give the server status.
@return Server status.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def DeleteByRange(self, request, context):
"""*
@brief delete table by range
This method is used to delete vector by range
@return rpc status.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def PreloadTable(self, request, context):
"""*
@brief preload table
This method is used to preload table
@return Status.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def DescribeIndex(self, request, context):
"""*
@brief describe index
This method is used to describe index
@return Status.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def DropIndex(self, request, context):
"""*
@brief drop index
This method is used to drop index
@return Status.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]def add_MilvusServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'CreateTable': grpc.unary_unary_rpc_method_handler(
servicer.CreateTable,
request_deserializer=milvus__pb2.TableSchema.FromString,
response_serializer=status__pb2.Status.SerializeToString,
),
'HasTable': grpc.unary_unary_rpc_method_handler(
servicer.HasTable,
request_deserializer=milvus__pb2.TableName.FromString,
response_serializer=milvus__pb2.BoolReply.SerializeToString,
),
'DropTable': grpc.unary_unary_rpc_method_handler(
servicer.DropTable,
request_deserializer=milvus__pb2.TableName.FromString,
response_serializer=status__pb2.Status.SerializeToString,
),
'CreateIndex': grpc.unary_unary_rpc_method_handler(
servicer.CreateIndex,
request_deserializer=milvus__pb2.IndexParam.FromString,
response_serializer=status__pb2.Status.SerializeToString,
),
'Insert': grpc.unary_unary_rpc_method_handler(
servicer.Insert,
request_deserializer=milvus__pb2.InsertParam.FromString,
response_serializer=milvus__pb2.VectorIds.SerializeToString,
),
'Search': grpc.unary_unary_rpc_method_handler(
servicer.Search,
request_deserializer=milvus__pb2.SearchParam.FromString,
response_serializer=milvus__pb2.TopKQueryResult.SerializeToString,
),
'SearchInFiles': grpc.unary_unary_rpc_method_handler(
servicer.SearchInFiles,
request_deserializer=milvus__pb2.SearchInFilesParam.FromString,
response_serializer=milvus__pb2.TopKQueryResult.SerializeToString,
),
'DescribeTable': grpc.unary_unary_rpc_method_handler(
servicer.DescribeTable,
request_deserializer=milvus__pb2.TableName.FromString,
response_serializer=milvus__pb2.TableSchema.SerializeToString,
),
'CountTable': grpc.unary_unary_rpc_method_handler(
servicer.CountTable,
request_deserializer=milvus__pb2.TableName.FromString,
response_serializer=milvus__pb2.TableRowCount.SerializeToString,
),
'ShowTables': grpc.unary_unary_rpc_method_handler(
servicer.ShowTables,
request_deserializer=milvus__pb2.Command.FromString,
response_serializer=milvus__pb2.TableNameList.SerializeToString,
),
'Cmd': grpc.unary_unary_rpc_method_handler(
servicer.Cmd,
request_deserializer=milvus__pb2.Command.FromString,
response_serializer=milvus__pb2.StringReply.SerializeToString,
),
'DeleteByRange': grpc.unary_unary_rpc_method_handler(
servicer.DeleteByRange,
request_deserializer=milvus__pb2.DeleteByRangeParam.FromString,
response_serializer=status__pb2.Status.SerializeToString,
),
'PreloadTable': grpc.unary_unary_rpc_method_handler(
servicer.PreloadTable,
request_deserializer=milvus__pb2.TableName.FromString,
response_serializer=status__pb2.Status.SerializeToString,
),
'DescribeIndex': grpc.unary_unary_rpc_method_handler(
servicer.DescribeIndex,
request_deserializer=milvus__pb2.TableName.FromString,
response_serializer=milvus__pb2.IndexParam.SerializeToString,
),
'DropIndex': grpc.unary_unary_rpc_method_handler(
servicer.DropIndex,
request_deserializer=milvus__pb2.TableName.FromString,
response_serializer=status__pb2.Status.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'milvus.grpc.MilvusService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))