mirror of https://github.com/milvus-io/milvus.git
[skip ci] update-mishards-load-api (#4505)
Signed-off-by: yinghao.zou <yinghao.zou@zilliz.com>pull/4509/head
parent
437f5d9777
commit
febcfe4c0b
|
@ -35,6 +35,11 @@ class GrpcArgsParser(object):
|
|||
def parse_proto_CollectionName(cls, param):
|
||||
return param.collection_name
|
||||
|
||||
@classmethod
|
||||
@error_status
|
||||
def parse_proto_PreloadCollectionParam(cls, param):
|
||||
return param.collection_name, list(param.partition_tag_array)
|
||||
|
||||
@classmethod
|
||||
@error_status
|
||||
def parse_proto_FlushParam(cls, param):
|
||||
|
|
|
@ -566,19 +566,18 @@ class ServiceHandler(milvus_pb2_grpc.MilvusServiceServicer):
|
|||
error_code=_status.code, reason=_status.message),
|
||||
collection_names=_results)
|
||||
|
||||
def _preload_collection(self, collection_name):
|
||||
return self.router.connection().load_collection(collection_name)
|
||||
def _preload_collection(self, collection_name, partition_tags):
|
||||
return self.router.connection().load_collection(collection_name, partition_tags)
|
||||
|
||||
@mark_grpc_method
|
||||
def PreloadCollection(self, request, context):
|
||||
_status, _collection_name = Parser.parse_proto_CollectionName(request)
|
||||
_collection_name, _partition_tags = Parser.parse_proto_PreloadCollectionParam(request)
|
||||
|
||||
if not _status.OK():
|
||||
return status_pb2.Status(error_code=_status.code,
|
||||
reason=_status.message)
|
||||
|
||||
logger.info('PreloadCollection {}'.format(_collection_name))
|
||||
_status = self._preload_collection(_collection_name)
|
||||
# if not _status.OK():
|
||||
# return status_pb2.Status(error_code=_status.code,
|
||||
# reason=_status.message)
|
||||
logger.info('PreloadCollection {} | {}'.format(_collection_name, _partition_tags))
|
||||
_status = self._preload_collection(_collection_name, _partition_tags)
|
||||
return status_pb2.Status(error_code=_status.code,
|
||||
reason=_status.message)
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ py==1.8.0
|
|||
pyasn1==0.4.7
|
||||
pyasn1-modules==0.2.6
|
||||
pylint==2.5.0
|
||||
pymilvus==0.2.14
|
||||
#pymilvus-test==0.3.25
|
||||
#pymilvus==0.2.14
|
||||
pymilvus-test==0.3.35
|
||||
pyparsing==2.4.0
|
||||
pytest==4.6.3
|
||||
pytest-level==0.1.1
|
||||
|
|
Loading…
Reference in New Issue