From 332507e935e611517634557f3f8584b267c5509b Mon Sep 17 00:00:00 2001 From: Pasha Podolsky Date: Thu, 5 Dec 2024 17:16:27 +0300 Subject: [PATCH] dev --- aiosumma/aiosumma/client.py | 58 +++- .../aiosumma/proto/consumer_service_pb2.py | 16 +- .../proto/consumer_service_pb2_grpc.py | 93 ++++- aiosumma/aiosumma/proto/dag_pb_pb2.py | 16 +- aiosumma/aiosumma/proto/dag_pb_pb2_grpc.py | 20 ++ aiosumma/aiosumma/proto/index_service_pb2.py | 20 +- .../aiosumma/proto/index_service_pb2_grpc.py | 327 ++++++++++++++---- aiosumma/aiosumma/proto/public_service_pb2.py | 16 +- .../aiosumma/proto/public_service_pb2_grpc.py | 39 ++- aiosumma/aiosumma/proto/query_pb2.py | 30 +- aiosumma/aiosumma/proto/query_pb2_grpc.py | 20 ++ .../aiosumma/proto/reflection_service_pb2.py | 18 +- .../proto/reflection_service_pb2_grpc.py | 39 ++- aiosumma/aiosumma/proto/search_service_pb2.py | 16 +- .../aiosumma/proto/search_service_pb2_grpc.py | 39 ++- aiosumma/aiosumma/proto/unixfs_pb2.py | 16 +- aiosumma/aiosumma/proto/unixfs_pb2_grpc.py | 20 ++ aiosumma/aiosumma/proto/utils_pb2.py | 16 +- aiosumma/aiosumma/proto/utils_pb2_grpc.py | 20 ++ aiosumma/pyproject.toml | 6 +- aiosumma/requirements.txt | 1 + .../src/components/index_writer_holder.rs | 6 +- 22 files changed, 703 insertions(+), 149 deletions(-) diff --git a/aiosumma/aiosumma/client.py b/aiosumma/aiosumma/client.py index 4200ffc1..56110743 100644 --- a/aiosumma/aiosumma/client.py +++ b/aiosumma/aiosumma/client.py @@ -20,7 +20,41 @@ from .proto.utils_pb2 import Asc, Desc # noqa -def setup_metadata(session_id, request_id): +def prepare_filters(filters: dict[str, list | tuple | str]) -> list[dict]: + all_extra_filters = [] + for field_name, values in filters.items(): + subqueries = [] + for value in values: + if isinstance(value, (list, tuple)): + subqueries.append( + { + "query": { + "match": { + "value": f"{field_name}:+[{value[0]} TO {value[1]}]" + } + }, + "occur": "must", + } + ) + else: + subqueries.append( + { + "occur": "should", + "query": { + "match": {"value": f"{field_name}:{value}"}, + }, + } + ) + all_extra_filters.append( + { + "query": {"boolean": {"subqueries": subqueries}}, + "occur": "must", + } + ) + return all_extra_filters + + +def setup_metadata(session_id: str, request_id: str): metadata = [] if session_id: metadata.append(('session-id', session_id)) @@ -29,7 +63,7 @@ def setup_metadata(session_id, request_id): return metadata -def prepare_search_request(search_request): +def prepare_search_request(search_request: dict | query_pb.SearchRequest) -> query_pb.SearchRequest: if isinstance(search_request, Dict): dict_search_request = search_request search_request = query_pb.SearchRequest() @@ -37,7 +71,7 @@ def prepare_search_request(search_request): return search_request -def prepare_query(query): +def prepare_query(query: dict | str) -> query_pb.Query: if isinstance(query, Dict): dict_query = query elif isinstance(query, str): @@ -473,12 +507,12 @@ async def get_indices_aliases( @expose async def documents( - self, - index_name: str, - query_filter: Optional[Union[dict, str]] = None, - fields: Optional[List[str]] = None, - request_id: Optional[str] = None, - session_id: Optional[str] = None, + self, + index_name: str, + query_filter: Optional[Union[dict, str]] = None, + fields: Optional[List[str]] = None, + request_id: Optional[str] = None, + session_id: Optional[str] = None, ) -> AsyncIterator[str]: """ Retrieve all documents from the index @@ -491,16 +525,14 @@ async def documents( # asyncfor is buggy: https://github.com/grpc/grpc/issues/32005 if query_filter: query_filter = prepare_query(query_filter) - streaming_call = self.stubs['index_api'].documents( + async for document in self.stubs['index_api'].documents( index_service_pb.DocumentsRequest( index_name=index_name, query_filter=query_filter, fields=fields, ), metadata=setup_metadata(session_id, request_id), - ) - while True: - document = await asyncio.create_task(streaming_call.read()) + ): if document == grpc.aio.EOF: break yield document.document diff --git a/aiosumma/aiosumma/proto/consumer_service_pb2.py b/aiosumma/aiosumma/proto/consumer_service_pb2.py index b024bf18..e4472afb 100644 --- a/aiosumma/aiosumma/proto/consumer_service_pb2.py +++ b/aiosumma/aiosumma/proto/consumer_service_pb2.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: consumer_service.proto -# Protobuf Python Version: 4.25.1 +# Protobuf Python Version: 5.27.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 27, + 2, + '', + 'consumer_service.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -19,8 +29,8 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'consumer_service_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None _globals['_CREATECONSUMERREQUEST']._serialized_start=39 _globals['_CREATECONSUMERREQUEST']._serialized_end=166 _globals['_CREATECONSUMERRESPONSE']._serialized_start=168 diff --git a/aiosumma/aiosumma/proto/consumer_service_pb2_grpc.py b/aiosumma/aiosumma/proto/consumer_service_pb2_grpc.py index 1b96b4ab..f88ab589 100644 --- a/aiosumma/aiosumma/proto/consumer_service_pb2_grpc.py +++ b/aiosumma/aiosumma/proto/consumer_service_pb2_grpc.py @@ -1,9 +1,29 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from . import consumer_service_pb2 as consumer__service__pb2 +GRPC_GENERATED_VERSION = '1.67.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in consumer_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class ConsumerApiStub(object): """Manage ingestion data from Kafka @@ -19,22 +39,22 @@ def __init__(self, channel): '/summa.proto.ConsumerApi/create_consumer', request_serializer=consumer__service__pb2.CreateConsumerRequest.SerializeToString, response_deserializer=consumer__service__pb2.CreateConsumerResponse.FromString, - ) + _registered_method=True) self.get_consumer = channel.unary_unary( '/summa.proto.ConsumerApi/get_consumer', request_serializer=consumer__service__pb2.GetConsumerRequest.SerializeToString, response_deserializer=consumer__service__pb2.GetConsumerResponse.FromString, - ) + _registered_method=True) self.get_consumers = channel.unary_unary( '/summa.proto.ConsumerApi/get_consumers', request_serializer=consumer__service__pb2.GetConsumersRequest.SerializeToString, response_deserializer=consumer__service__pb2.GetConsumersResponse.FromString, - ) + _registered_method=True) self.delete_consumer = channel.unary_unary( '/summa.proto.ConsumerApi/delete_consumer', request_serializer=consumer__service__pb2.DeleteConsumerRequest.SerializeToString, response_deserializer=consumer__service__pb2.DeleteConsumerResponse.FromString, - ) + _registered_method=True) class ConsumerApiServicer(object): @@ -96,6 +116,7 @@ def add_ConsumerApiServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'summa.proto.ConsumerApi', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('summa.proto.ConsumerApi', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -114,11 +135,21 @@ def create_consumer(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.ConsumerApi/create_consumer', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.ConsumerApi/create_consumer', consumer__service__pb2.CreateConsumerRequest.SerializeToString, consumer__service__pb2.CreateConsumerResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def get_consumer(request, @@ -131,11 +162,21 @@ def get_consumer(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.ConsumerApi/get_consumer', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.ConsumerApi/get_consumer', consumer__service__pb2.GetConsumerRequest.SerializeToString, consumer__service__pb2.GetConsumerResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def get_consumers(request, @@ -148,11 +189,21 @@ def get_consumers(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.ConsumerApi/get_consumers', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.ConsumerApi/get_consumers', consumer__service__pb2.GetConsumersRequest.SerializeToString, consumer__service__pb2.GetConsumersResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def delete_consumer(request, @@ -165,8 +216,18 @@ def delete_consumer(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.ConsumerApi/delete_consumer', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.ConsumerApi/delete_consumer', consumer__service__pb2.DeleteConsumerRequest.SerializeToString, consumer__service__pb2.DeleteConsumerResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/aiosumma/aiosumma/proto/dag_pb_pb2.py b/aiosumma/aiosumma/proto/dag_pb_pb2.py index 7d9b89b7..443247e2 100644 --- a/aiosumma/aiosumma/proto/dag_pb_pb2.py +++ b/aiosumma/aiosumma/proto/dag_pb_pb2.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: dag_pb.proto -# Protobuf Python Version: 4.25.1 +# Protobuf Python Version: 5.27.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 27, + 2, + '', + 'dag_pb.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -19,8 +29,8 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'dag_pb_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None _globals['_PBLINK']._serialized_start=24 _globals['_PBLINK']._serialized_end=120 _globals['_PBNODE']._serialized_start=122 diff --git a/aiosumma/aiosumma/proto/dag_pb_pb2_grpc.py b/aiosumma/aiosumma/proto/dag_pb_pb2_grpc.py index 2daafffe..80d579ca 100644 --- a/aiosumma/aiosumma/proto/dag_pb_pb2_grpc.py +++ b/aiosumma/aiosumma/proto/dag_pb_pb2_grpc.py @@ -1,4 +1,24 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings + +GRPC_GENERATED_VERSION = '1.67.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in dag_pb_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/aiosumma/aiosumma/proto/index_service_pb2.py b/aiosumma/aiosumma/proto/index_service_pb2.py index 3ab48383..5649b5a2 100644 --- a/aiosumma/aiosumma/proto/index_service_pb2.py +++ b/aiosumma/aiosumma/proto/index_service_pb2.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: index_service.proto -# Protobuf Python Version: 4.25.1 +# Protobuf Python Version: 5.27.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 27, + 2, + '', + 'index_service.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -21,11 +31,11 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'index_service_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - _globals['_GETINDICESALIASESRESPONSE_INDICESALIASESENTRY']._options = None +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_GETINDICESALIASESRESPONSE_INDICESALIASESENTRY']._loaded_options = None _globals['_GETINDICESALIASESRESPONSE_INDICESALIASESENTRY']._serialized_options = b'8\001' - _globals['_REMOTEENGINECONFIG_HEADERSTEMPLATEENTRY']._options = None + _globals['_REMOTEENGINECONFIG_HEADERSTEMPLATEENTRY']._loaded_options = None _globals['_REMOTEENGINECONFIG_HEADERSTEMPLATEENTRY']._serialized_options = b'8\001' _globals['_CONFLICTSTRATEGY']._serialized_start=5164 _globals['_CONFLICTSTRATEGY']._serialized_end=5246 diff --git a/aiosumma/aiosumma/proto/index_service_pb2_grpc.py b/aiosumma/aiosumma/proto/index_service_pb2_grpc.py index 44d576d2..b0358f38 100644 --- a/aiosumma/aiosumma/proto/index_service_pb2_grpc.py +++ b/aiosumma/aiosumma/proto/index_service_pb2_grpc.py @@ -1,9 +1,29 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from . import index_service_pb2 as index__service__pb2 +GRPC_GENERATED_VERSION = '1.67.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in index_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class IndexApiStub(object): """Manages indices @@ -19,87 +39,87 @@ def __init__(self, channel): '/summa.proto.IndexApi/attach_index', request_serializer=index__service__pb2.AttachIndexRequest.SerializeToString, response_deserializer=index__service__pb2.AttachIndexResponse.FromString, - ) + _registered_method=True) self.commit_index = channel.unary_unary( '/summa.proto.IndexApi/commit_index', request_serializer=index__service__pb2.CommitIndexRequest.SerializeToString, response_deserializer=index__service__pb2.CommitIndexResponse.FromString, - ) + _registered_method=True) self.copy_documents = channel.unary_unary( '/summa.proto.IndexApi/copy_documents', request_serializer=index__service__pb2.CopyDocumentsRequest.SerializeToString, response_deserializer=index__service__pb2.CopyDocumentsResponse.FromString, - ) + _registered_method=True) self.create_index = channel.unary_unary( '/summa.proto.IndexApi/create_index', request_serializer=index__service__pb2.CreateIndexRequest.SerializeToString, response_deserializer=index__service__pb2.CreateIndexResponse.FromString, - ) + _registered_method=True) self.copy_index = channel.unary_unary( '/summa.proto.IndexApi/copy_index', request_serializer=index__service__pb2.CopyIndexRequest.SerializeToString, response_deserializer=index__service__pb2.CopyIndexResponse.FromString, - ) + _registered_method=True) self.delete_documents = channel.unary_unary( '/summa.proto.IndexApi/delete_documents', request_serializer=index__service__pb2.DeleteDocumentsRequest.SerializeToString, response_deserializer=index__service__pb2.DeleteDocumentsResponse.FromString, - ) + _registered_method=True) self.delete_index = channel.unary_unary( '/summa.proto.IndexApi/delete_index', request_serializer=index__service__pb2.DeleteIndexRequest.SerializeToString, response_deserializer=index__service__pb2.DeleteIndexResponse.FromString, - ) + _registered_method=True) self.documents = channel.unary_stream( '/summa.proto.IndexApi/documents', request_serializer=index__service__pb2.DocumentsRequest.SerializeToString, response_deserializer=index__service__pb2.DocumentsResponse.FromString, - ) + _registered_method=True) self.get_indices_aliases = channel.unary_unary( '/summa.proto.IndexApi/get_indices_aliases', request_serializer=index__service__pb2.GetIndicesAliasesRequest.SerializeToString, response_deserializer=index__service__pb2.GetIndicesAliasesResponse.FromString, - ) + _registered_method=True) self.get_index = channel.unary_unary( '/summa.proto.IndexApi/get_index', request_serializer=index__service__pb2.GetIndexRequest.SerializeToString, response_deserializer=index__service__pb2.GetIndexResponse.FromString, - ) + _registered_method=True) self.get_indices = channel.unary_unary( '/summa.proto.IndexApi/get_indices', request_serializer=index__service__pb2.GetIndicesRequest.SerializeToString, response_deserializer=index__service__pb2.GetIndicesResponse.FromString, - ) + _registered_method=True) self.index_document_stream = channel.stream_unary( '/summa.proto.IndexApi/index_document_stream', request_serializer=index__service__pb2.IndexDocumentStreamRequest.SerializeToString, response_deserializer=index__service__pb2.IndexDocumentStreamResponse.FromString, - ) + _registered_method=True) self.index_document = channel.unary_unary( '/summa.proto.IndexApi/index_document', request_serializer=index__service__pb2.IndexDocumentRequest.SerializeToString, response_deserializer=index__service__pb2.IndexDocumentResponse.FromString, - ) + _registered_method=True) self.merge_segments = channel.unary_unary( '/summa.proto.IndexApi/merge_segments', request_serializer=index__service__pb2.MergeSegmentsRequest.SerializeToString, response_deserializer=index__service__pb2.MergeSegmentsResponse.FromString, - ) + _registered_method=True) self.set_index_alias = channel.unary_unary( '/summa.proto.IndexApi/set_index_alias', request_serializer=index__service__pb2.SetIndexAliasRequest.SerializeToString, response_deserializer=index__service__pb2.SetIndexAliasResponse.FromString, - ) + _registered_method=True) self.vacuum_index = channel.unary_unary( '/summa.proto.IndexApi/vacuum_index', request_serializer=index__service__pb2.VacuumIndexRequest.SerializeToString, response_deserializer=index__service__pb2.VacuumIndexResponse.FromString, - ) + _registered_method=True) self.warmup_index = channel.unary_unary( '/summa.proto.IndexApi/warmup_index', request_serializer=index__service__pb2.WarmupIndexRequest.SerializeToString, response_deserializer=index__service__pb2.WarmupIndexResponse.FromString, - ) + _registered_method=True) class IndexApiServicer(object): @@ -317,6 +337,7 @@ def add_IndexApiServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'summa.proto.IndexApi', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('summa.proto.IndexApi', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -335,11 +356,21 @@ def attach_index(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/attach_index', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/attach_index', index__service__pb2.AttachIndexRequest.SerializeToString, index__service__pb2.AttachIndexResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def commit_index(request, @@ -352,11 +383,21 @@ def commit_index(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/commit_index', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/commit_index', index__service__pb2.CommitIndexRequest.SerializeToString, index__service__pb2.CommitIndexResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def copy_documents(request, @@ -369,11 +410,21 @@ def copy_documents(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/copy_documents', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/copy_documents', index__service__pb2.CopyDocumentsRequest.SerializeToString, index__service__pb2.CopyDocumentsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def create_index(request, @@ -386,11 +437,21 @@ def create_index(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/create_index', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/create_index', index__service__pb2.CreateIndexRequest.SerializeToString, index__service__pb2.CreateIndexResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def copy_index(request, @@ -403,11 +464,21 @@ def copy_index(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/copy_index', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/copy_index', index__service__pb2.CopyIndexRequest.SerializeToString, index__service__pb2.CopyIndexResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def delete_documents(request, @@ -420,11 +491,21 @@ def delete_documents(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/delete_documents', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/delete_documents', index__service__pb2.DeleteDocumentsRequest.SerializeToString, index__service__pb2.DeleteDocumentsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def delete_index(request, @@ -437,11 +518,21 @@ def delete_index(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/delete_index', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/delete_index', index__service__pb2.DeleteIndexRequest.SerializeToString, index__service__pb2.DeleteIndexResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def documents(request, @@ -454,11 +545,21 @@ def documents(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/summa.proto.IndexApi/documents', + return grpc.experimental.unary_stream( + request, + target, + '/summa.proto.IndexApi/documents', index__service__pb2.DocumentsRequest.SerializeToString, index__service__pb2.DocumentsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def get_indices_aliases(request, @@ -471,11 +572,21 @@ def get_indices_aliases(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/get_indices_aliases', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/get_indices_aliases', index__service__pb2.GetIndicesAliasesRequest.SerializeToString, index__service__pb2.GetIndicesAliasesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def get_index(request, @@ -488,11 +599,21 @@ def get_index(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/get_index', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/get_index', index__service__pb2.GetIndexRequest.SerializeToString, index__service__pb2.GetIndexResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def get_indices(request, @@ -505,11 +626,21 @@ def get_indices(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/get_indices', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/get_indices', index__service__pb2.GetIndicesRequest.SerializeToString, index__service__pb2.GetIndicesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def index_document_stream(request_iterator, @@ -522,11 +653,21 @@ def index_document_stream(request_iterator, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/summa.proto.IndexApi/index_document_stream', + return grpc.experimental.stream_unary( + request_iterator, + target, + '/summa.proto.IndexApi/index_document_stream', index__service__pb2.IndexDocumentStreamRequest.SerializeToString, index__service__pb2.IndexDocumentStreamResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def index_document(request, @@ -539,11 +680,21 @@ def index_document(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/index_document', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/index_document', index__service__pb2.IndexDocumentRequest.SerializeToString, index__service__pb2.IndexDocumentResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def merge_segments(request, @@ -556,11 +707,21 @@ def merge_segments(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/merge_segments', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/merge_segments', index__service__pb2.MergeSegmentsRequest.SerializeToString, index__service__pb2.MergeSegmentsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def set_index_alias(request, @@ -573,11 +734,21 @@ def set_index_alias(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/set_index_alias', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/set_index_alias', index__service__pb2.SetIndexAliasRequest.SerializeToString, index__service__pb2.SetIndexAliasResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def vacuum_index(request, @@ -590,11 +761,21 @@ def vacuum_index(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/vacuum_index', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/vacuum_index', index__service__pb2.VacuumIndexRequest.SerializeToString, index__service__pb2.VacuumIndexResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def warmup_index(request, @@ -607,8 +788,18 @@ def warmup_index(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.IndexApi/warmup_index', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.IndexApi/warmup_index', index__service__pb2.WarmupIndexRequest.SerializeToString, index__service__pb2.WarmupIndexResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/aiosumma/aiosumma/proto/public_service_pb2.py b/aiosumma/aiosumma/proto/public_service_pb2.py index a3f85156..7fad7d40 100644 --- a/aiosumma/aiosumma/proto/public_service_pb2.py +++ b/aiosumma/aiosumma/proto/public_service_pb2.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: public_service.proto -# Protobuf Python Version: 4.25.1 +# Protobuf Python Version: 5.27.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 27, + 2, + '', + 'public_service.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -20,8 +30,8 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'public_service_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None _globals['_PUBLICAPI']._serialized_start=50 _globals['_PUBLICAPI']._serialized_end=130 # @@protoc_insertion_point(module_scope) diff --git a/aiosumma/aiosumma/proto/public_service_pb2_grpc.py b/aiosumma/aiosumma/proto/public_service_pb2_grpc.py index d9961bdd..52861d77 100644 --- a/aiosumma/aiosumma/proto/public_service_pb2_grpc.py +++ b/aiosumma/aiosumma/proto/public_service_pb2_grpc.py @@ -1,9 +1,29 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from . import query_pb2 as query__pb2 +GRPC_GENERATED_VERSION = '1.67.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in public_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class PublicApiStub(object): """Searches documents in the stored indices @@ -19,7 +39,7 @@ def __init__(self, channel): '/summa.proto.PublicApi/search', request_serializer=query__pb2.SearchRequest.SerializeToString, response_deserializer=query__pb2.SearchResponse.FromString, - ) + _registered_method=True) class PublicApiServicer(object): @@ -45,6 +65,7 @@ def add_PublicApiServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'summa.proto.PublicApi', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('summa.proto.PublicApi', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -63,8 +84,18 @@ def search(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.PublicApi/search', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.PublicApi/search', query__pb2.SearchRequest.SerializeToString, query__pb2.SearchResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/aiosumma/aiosumma/proto/query_pb2.py b/aiosumma/aiosumma/proto/query_pb2.py index 8c080b88..d5ac6dfb 100644 --- a/aiosumma/aiosumma/proto/query_pb2.py +++ b/aiosumma/aiosumma/proto/query_pb2.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: query.proto -# Protobuf Python Version: 4.25.1 +# Protobuf Python Version: 5.27.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 27, + 2, + '', + 'query.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -19,21 +29,21 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'query_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - _globals['_QUERYPARSERCONFIG_FIELDALIASESENTRY']._options = None +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_QUERYPARSERCONFIG_FIELDALIASESENTRY']._loaded_options = None _globals['_QUERYPARSERCONFIG_FIELDALIASESENTRY']._serialized_options = b'8\001' - _globals['_QUERYPARSERCONFIG_FIELDBOOSTSENTRY']._options = None + _globals['_QUERYPARSERCONFIG_FIELDBOOSTSENTRY']._loaded_options = None _globals['_QUERYPARSERCONFIG_FIELDBOOSTSENTRY']._serialized_options = b'8\001' - _globals['_QUERYPARSERCONFIG_TERMFIELDMAPPERCONFIGSENTRY']._options = None + _globals['_QUERYPARSERCONFIG_TERMFIELDMAPPERCONFIGSENTRY']._loaded_options = None _globals['_QUERYPARSERCONFIG_TERMFIELDMAPPERCONFIGSENTRY']._serialized_options = b'8\001' - _globals['_QUERYPARSERCONFIG_MORPHOLOGYCONFIGSENTRY']._options = None + _globals['_QUERYPARSERCONFIG_MORPHOLOGYCONFIGSENTRY']._loaded_options = None _globals['_QUERYPARSERCONFIG_MORPHOLOGYCONFIGSENTRY']._serialized_options = b'8\001' - _globals['_SCOREDDOCUMENT_SNIPPETSENTRY']._options = None + _globals['_SCOREDDOCUMENT_SNIPPETSENTRY']._loaded_options = None _globals['_SCOREDDOCUMENT_SNIPPETSENTRY']._serialized_options = b'8\001' - _globals['_FACETCOLLECTOROUTPUT_FACETCOUNTSENTRY']._options = None + _globals['_FACETCOLLECTOROUTPUT_FACETCOUNTSENTRY']._loaded_options = None _globals['_FACETCOLLECTOROUTPUT_FACETCOUNTSENTRY']._serialized_options = b'8\001' - _globals['_TOPDOCSCOLLECTOR_SNIPPETCONFIGSENTRY']._options = None + _globals['_TOPDOCSCOLLECTOR_SNIPPETCONFIGSENTRY']._loaded_options = None _globals['_TOPDOCSCOLLECTOR_SNIPPETCONFIGSENTRY']._serialized_options = b'8\001' _globals['_OCCUR']._serialized_start=5566 _globals['_OCCUR']._serialized_end=5609 diff --git a/aiosumma/aiosumma/proto/query_pb2_grpc.py b/aiosumma/aiosumma/proto/query_pb2_grpc.py index 2daafffe..c3ee7950 100644 --- a/aiosumma/aiosumma/proto/query_pb2_grpc.py +++ b/aiosumma/aiosumma/proto/query_pb2_grpc.py @@ -1,4 +1,24 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings + +GRPC_GENERATED_VERSION = '1.67.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in query_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/aiosumma/aiosumma/proto/reflection_service_pb2.py b/aiosumma/aiosumma/proto/reflection_service_pb2.py index 27fa25d0..dad867f7 100644 --- a/aiosumma/aiosumma/proto/reflection_service_pb2.py +++ b/aiosumma/aiosumma/proto/reflection_service_pb2.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: reflection_service.proto -# Protobuf Python Version: 4.25.1 +# Protobuf Python Version: 5.27.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 27, + 2, + '', + 'reflection_service.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -19,9 +29,9 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'reflection_service_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - _globals['_GETTOPTERMSRESPONSE_PERSEGMENTENTRY']._options = None +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_GETTOPTERMSRESPONSE_PERSEGMENTENTRY']._loaded_options = None _globals['_GETTOPTERMSRESPONSE_PERSEGMENTENTRY']._serialized_options = b'8\001' _globals['_GETTOPTERMSREQUEST']._serialized_start=41 _globals['_GETTOPTERMSREQUEST']._serialized_end=116 diff --git a/aiosumma/aiosumma/proto/reflection_service_pb2_grpc.py b/aiosumma/aiosumma/proto/reflection_service_pb2_grpc.py index 425aa203..507f1919 100644 --- a/aiosumma/aiosumma/proto/reflection_service_pb2_grpc.py +++ b/aiosumma/aiosumma/proto/reflection_service_pb2_grpc.py @@ -1,9 +1,29 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from . import reflection_service_pb2 as reflection__service__pb2 +GRPC_GENERATED_VERSION = '1.67.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in reflection_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class ReflectionApiStub(object): """Analyzes indices @@ -19,7 +39,7 @@ def __init__(self, channel): '/summa.proto.ReflectionApi/get_top_terms', request_serializer=reflection__service__pb2.GetTopTermsRequest.SerializeToString, response_deserializer=reflection__service__pb2.GetTopTermsResponse.FromString, - ) + _registered_method=True) class ReflectionApiServicer(object): @@ -44,6 +64,7 @@ def add_ReflectionApiServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'summa.proto.ReflectionApi', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('summa.proto.ReflectionApi', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -62,8 +83,18 @@ def get_top_terms(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.ReflectionApi/get_top_terms', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.ReflectionApi/get_top_terms', reflection__service__pb2.GetTopTermsRequest.SerializeToString, reflection__service__pb2.GetTopTermsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/aiosumma/aiosumma/proto/search_service_pb2.py b/aiosumma/aiosumma/proto/search_service_pb2.py index ce12df6f..37863ef9 100644 --- a/aiosumma/aiosumma/proto/search_service_pb2.py +++ b/aiosumma/aiosumma/proto/search_service_pb2.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: search_service.proto -# Protobuf Python Version: 4.25.1 +# Protobuf Python Version: 5.27.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 27, + 2, + '', + 'search_service.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -20,8 +30,8 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'search_service_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None _globals['_SEARCHAPI']._serialized_start=50 _globals['_SEARCHAPI']._serialized_end=130 # @@protoc_insertion_point(module_scope) diff --git a/aiosumma/aiosumma/proto/search_service_pb2_grpc.py b/aiosumma/aiosumma/proto/search_service_pb2_grpc.py index 346678ee..8b614956 100644 --- a/aiosumma/aiosumma/proto/search_service_pb2_grpc.py +++ b/aiosumma/aiosumma/proto/search_service_pb2_grpc.py @@ -1,9 +1,29 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from . import query_pb2 as query__pb2 +GRPC_GENERATED_VERSION = '1.67.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in search_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class SearchApiStub(object): """Searches documents in the stored indices @@ -19,7 +39,7 @@ def __init__(self, channel): '/summa.proto.SearchApi/search', request_serializer=query__pb2.SearchRequest.SerializeToString, response_deserializer=query__pb2.SearchResponse.FromString, - ) + _registered_method=True) class SearchApiServicer(object): @@ -45,6 +65,7 @@ def add_SearchApiServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'summa.proto.SearchApi', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('summa.proto.SearchApi', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -63,8 +84,18 @@ def search(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/summa.proto.SearchApi/search', + return grpc.experimental.unary_unary( + request, + target, + '/summa.proto.SearchApi/search', query__pb2.SearchRequest.SerializeToString, query__pb2.SearchResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/aiosumma/aiosumma/proto/unixfs_pb2.py b/aiosumma/aiosumma/proto/unixfs_pb2.py index db476123..2997ae30 100644 --- a/aiosumma/aiosumma/proto/unixfs_pb2.py +++ b/aiosumma/aiosumma/proto/unixfs_pb2.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: unixfs.proto -# Protobuf Python Version: 4.25.1 +# Protobuf Python Version: 5.27.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 27, + 2, + '', + 'unixfs.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -19,8 +29,8 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'unixfs_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None _globals['_DATA']._serialized_start=25 _globals['_DATA']._serialized_end=308 _globals['_DATA_DATATYPE']._serialized_start=176 diff --git a/aiosumma/aiosumma/proto/unixfs_pb2_grpc.py b/aiosumma/aiosumma/proto/unixfs_pb2_grpc.py index 2daafffe..c5d15ec0 100644 --- a/aiosumma/aiosumma/proto/unixfs_pb2_grpc.py +++ b/aiosumma/aiosumma/proto/unixfs_pb2_grpc.py @@ -1,4 +1,24 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings + +GRPC_GENERATED_VERSION = '1.67.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in unixfs_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/aiosumma/aiosumma/proto/utils_pb2.py b/aiosumma/aiosumma/proto/utils_pb2.py index 30b770ae..a0cafb55 100644 --- a/aiosumma/aiosumma/proto/utils_pb2.py +++ b/aiosumma/aiosumma/proto/utils_pb2.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: utils.proto -# Protobuf Python Version: 4.25.1 +# Protobuf Python Version: 5.27.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 27, + 2, + '', + 'utils.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -19,8 +29,8 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'utils_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None _globals['_ORDER']._serialized_start=37 _globals['_ORDER']._serialized_end=63 _globals['_EMPTY']._serialized_start=28 diff --git a/aiosumma/aiosumma/proto/utils_pb2_grpc.py b/aiosumma/aiosumma/proto/utils_pb2_grpc.py index 2daafffe..3eb59a86 100644 --- a/aiosumma/aiosumma/proto/utils_pb2_grpc.py +++ b/aiosumma/aiosumma/proto/utils_pb2_grpc.py @@ -1,4 +1,24 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings + +GRPC_GENERATED_VERSION = '1.67.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in utils_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/aiosumma/pyproject.toml b/aiosumma/pyproject.toml index 1adfcd06..225a3be5 100644 --- a/aiosumma/pyproject.toml +++ b/aiosumma/pyproject.toml @@ -1,10 +1,12 @@ + + [build-system] -requires = ["setuptools<65.0"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] name = "aiosumma" -version = "2.47.5" +version = "2.47.10" authors = [{ name = "Pasha Podolsky", email = "ppodolsky@me.com" }] description = "Async client for Summa Search" readme = "README.md" diff --git a/aiosumma/requirements.txt b/aiosumma/requirements.txt index e698402c..1a6e5120 100644 --- a/aiosumma/requirements.txt +++ b/aiosumma/requirements.txt @@ -2,4 +2,5 @@ aiogrpcclient >= 1.3.5 fire >= 0.3.1 izihawa_utils orjson >= 3.6.8 +protobuf==5.27.2 termcolor >= 1.1.0 diff --git a/summa-core/src/components/index_writer_holder.rs b/summa-core/src/components/index_writer_holder.rs index ef67dc84..354af76a 100644 --- a/summa-core/src/components/index_writer_holder.rs +++ b/summa-core/src/components/index_writer_holder.rs @@ -498,7 +498,11 @@ impl IndexWriterHolder { let index = index_writer.index().clone(); info!(action = "wait_merging_threads", mode = "threaded"); index_writer.wait_merging_threads().expect("cannot wait merging threads"); - info!(action = "merging_threads_finished", mode = "threaded"); + info!( + action = "merging_threads_finished", + mode = "threaded", + trace = ?std::backtrace::Backtrace::capture(), + ); let index_writer = index .writer_with_num_threads(self.writer_threads.threads() as usize, self.writer_heap_size_bytes) .expect("cannot create index writer_holder");