# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from needlestack.apis import collections_pb2 as needlestack_dot_apis_dot_collections__pb2
from needlestack.apis import indices_pb2 as needlestack_dot_apis_dot_indices__pb2
from needlestack.apis import servicers_pb2 as needlestack_dot_apis_dot_servicers__pb2
[docs]class MergerStub(object):
"""Main entrypoint for external clients to run distributed kNN searches
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Search = channel.unary_unary(
'/Merger/Search',
request_serializer=needlestack_dot_apis_dot_servicers__pb2.SearchRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_servicers__pb2.SearchResponse.FromString,
)
self.SearchStream = channel.unary_stream(
'/Merger/SearchStream',
request_serializer=needlestack_dot_apis_dot_servicers__pb2.SearchRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_indices__pb2.SearchResultItem.FromString,
)
self.Retrieve = channel.unary_unary(
'/Merger/Retrieve',
request_serializer=needlestack_dot_apis_dot_servicers__pb2.RetrieveRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_servicers__pb2.RetrieveResponse.FromString,
)
self.CollectionsAdd = channel.unary_unary(
'/Merger/CollectionsAdd',
request_serializer=needlestack_dot_apis_dot_collections__pb2.CollectionsAddRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_collections__pb2.CollectionsAddResponse.FromString,
)
self.CollectionsDelete = channel.unary_unary(
'/Merger/CollectionsDelete',
request_serializer=needlestack_dot_apis_dot_collections__pb2.CollectionsDeleteRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_collections__pb2.CollectionsDeleteRequest.FromString,
)
self.CollectionsList = channel.unary_unary(
'/Merger/CollectionsList',
request_serializer=needlestack_dot_apis_dot_collections__pb2.CollectionsListRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_collections__pb2.CollectionsListResponse.FromString,
)
self.CollectionsLoad = channel.unary_unary(
'/Merger/CollectionsLoad',
request_serializer=needlestack_dot_apis_dot_collections__pb2.CollectionsLoadRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_collections__pb2.CollectionsLoadResponse.FromString,
)
[docs]class MergerServicer(object):
"""Main entrypoint for external clients to run distributed kNN searches
"""
[docs] def Search(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def SearchStream(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def Retrieve(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def CollectionsAdd(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def CollectionsDelete(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def CollectionsList(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def CollectionsLoad(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]def add_MergerServicer_to_server(servicer, server):
rpc_method_handlers = {
'Search': grpc.unary_unary_rpc_method_handler(
servicer.Search,
request_deserializer=needlestack_dot_apis_dot_servicers__pb2.SearchRequest.FromString,
response_serializer=needlestack_dot_apis_dot_servicers__pb2.SearchResponse.SerializeToString,
),
'SearchStream': grpc.unary_stream_rpc_method_handler(
servicer.SearchStream,
request_deserializer=needlestack_dot_apis_dot_servicers__pb2.SearchRequest.FromString,
response_serializer=needlestack_dot_apis_dot_indices__pb2.SearchResultItem.SerializeToString,
),
'Retrieve': grpc.unary_unary_rpc_method_handler(
servicer.Retrieve,
request_deserializer=needlestack_dot_apis_dot_servicers__pb2.RetrieveRequest.FromString,
response_serializer=needlestack_dot_apis_dot_servicers__pb2.RetrieveResponse.SerializeToString,
),
'CollectionsAdd': grpc.unary_unary_rpc_method_handler(
servicer.CollectionsAdd,
request_deserializer=needlestack_dot_apis_dot_collections__pb2.CollectionsAddRequest.FromString,
response_serializer=needlestack_dot_apis_dot_collections__pb2.CollectionsAddResponse.SerializeToString,
),
'CollectionsDelete': grpc.unary_unary_rpc_method_handler(
servicer.CollectionsDelete,
request_deserializer=needlestack_dot_apis_dot_collections__pb2.CollectionsDeleteRequest.FromString,
response_serializer=needlestack_dot_apis_dot_collections__pb2.CollectionsDeleteRequest.SerializeToString,
),
'CollectionsList': grpc.unary_unary_rpc_method_handler(
servicer.CollectionsList,
request_deserializer=needlestack_dot_apis_dot_collections__pb2.CollectionsListRequest.FromString,
response_serializer=needlestack_dot_apis_dot_collections__pb2.CollectionsListResponse.SerializeToString,
),
'CollectionsLoad': grpc.unary_unary_rpc_method_handler(
servicer.CollectionsLoad,
request_deserializer=needlestack_dot_apis_dot_collections__pb2.CollectionsLoadRequest.FromString,
response_serializer=needlestack_dot_apis_dot_collections__pb2.CollectionsLoadResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'Merger', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
[docs]class SearcherStub(object):
"""Worker used by `Merger` to perform single-node kNN search
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Search = channel.unary_unary(
'/Searcher/Search',
request_serializer=needlestack_dot_apis_dot_servicers__pb2.SearchRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_servicers__pb2.SearchResponse.FromString,
)
self.SearchStream = channel.unary_stream(
'/Searcher/SearchStream',
request_serializer=needlestack_dot_apis_dot_servicers__pb2.SearchRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_indices__pb2.SearchResultItem.FromString,
)
self.Retrieve = channel.unary_unary(
'/Searcher/Retrieve',
request_serializer=needlestack_dot_apis_dot_servicers__pb2.RetrieveRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_servicers__pb2.RetrieveResponse.FromString,
)
self.CollectionsLoad = channel.unary_unary(
'/Searcher/CollectionsLoad',
request_serializer=needlestack_dot_apis_dot_collections__pb2.CollectionsLoadRequest.SerializeToString,
response_deserializer=needlestack_dot_apis_dot_collections__pb2.CollectionsLoadResponse.FromString,
)
[docs]class SearcherServicer(object):
"""Worker used by `Merger` to perform single-node kNN search
"""
[docs] def Search(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def SearchStream(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def Retrieve(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def CollectionsLoad(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]def add_SearcherServicer_to_server(servicer, server):
rpc_method_handlers = {
'Search': grpc.unary_unary_rpc_method_handler(
servicer.Search,
request_deserializer=needlestack_dot_apis_dot_servicers__pb2.SearchRequest.FromString,
response_serializer=needlestack_dot_apis_dot_servicers__pb2.SearchResponse.SerializeToString,
),
'SearchStream': grpc.unary_stream_rpc_method_handler(
servicer.SearchStream,
request_deserializer=needlestack_dot_apis_dot_servicers__pb2.SearchRequest.FromString,
response_serializer=needlestack_dot_apis_dot_indices__pb2.SearchResultItem.SerializeToString,
),
'Retrieve': grpc.unary_unary_rpc_method_handler(
servicer.Retrieve,
request_deserializer=needlestack_dot_apis_dot_servicers__pb2.RetrieveRequest.FromString,
response_serializer=needlestack_dot_apis_dot_servicers__pb2.RetrieveResponse.SerializeToString,
),
'CollectionsLoad': grpc.unary_unary_rpc_method_handler(
servicer.CollectionsLoad,
request_deserializer=needlestack_dot_apis_dot_collections__pb2.CollectionsLoadRequest.FromString,
response_serializer=needlestack_dot_apis_dot_collections__pb2.CollectionsLoadResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'Searcher', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))