nucliadb 6.4.0.post4283__py3-none-any.whl → 6.4.0.post4287__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -188,7 +188,7 @@ JSON_HEADERS = {"Content-Type": "application/json"}
188
188
 
189
189
 
190
190
  class ProcessingHTTPClient:
191
- def __init__(self):
191
+ def __init__(self) -> None:
192
192
  self.session = aiohttp.ClientSession()
193
193
  self.base_url = get_processing_api_url()
194
194
  self.base_url_v2 = get_processing_api_v2_url()
@@ -31,7 +31,7 @@ from nucliadb.export_import.utils import (
31
31
  ExportStreamReader,
32
32
  TaskRetryHandler,
33
33
  import_binary,
34
- import_broker_message,
34
+ restore_broker_message,
35
35
  set_entities_groups,
36
36
  set_labels,
37
37
  )
@@ -64,7 +64,7 @@ async def import_kb(
64
64
  items_count += 1
65
65
  if item_type == ExportedItemType.RESOURCE:
66
66
  bm = cast(writer_pb2.BrokerMessage, data)
67
- await import_broker_message(context, kbid, bm)
67
+ await restore_broker_message(context, kbid, bm)
68
68
 
69
69
  elif item_type == ExportedItemType.BINARY:
70
70
  cf = cast(resources_pb2.CloudFile, data[0])
@@ -104,39 +104,32 @@ BM_FIELDS = {
104
104
  }
105
105
 
106
106
 
107
- async def import_broker_message(
108
- context: ApplicationContext, kbid: str, bm: writer_pb2.BrokerMessage
109
- ) -> None:
110
- bm.kbid = kbid
111
- partition = context.partitioning.generate_partition(kbid, bm.uuid)
112
- for pb in [get_writer_bm(bm), get_processor_bm(bm)]:
113
- await transaction_commit(context, pb, partition)
114
-
115
-
116
107
  async def restore_broker_message(
117
108
  context: ApplicationContext, kbid: str, bm: writer_pb2.BrokerMessage
118
109
  ) -> None:
110
+ bm.kbid = kbid
119
111
  await send_writer_bm(context, bm)
120
112
  await send_processor_bm(context, bm)
121
113
 
122
114
 
123
- @backoff.on_exception(backoff.expo, (Exception,), jitter=backoff.random_jitter, max_tries=8)
124
115
  async def send_writer_bm(context: ApplicationContext, bm: writer_pb2.BrokerMessage) -> None:
116
+ await process_bm_grpc(context, get_writer_bm(bm))
117
+
118
+
119
+ async def send_processor_bm(context: ApplicationContext, bm: writer_pb2.BrokerMessage) -> None:
120
+ await process_bm_grpc(context, get_processor_bm(bm))
121
+
122
+
123
+ @backoff.on_exception(backoff.expo, (Exception,), jitter=backoff.random_jitter, max_tries=8)
124
+ async def process_bm_grpc(context: ApplicationContext, bm: writer_pb2.BrokerMessage) -> None:
125
125
  async def _iterator() -> AsyncIterator[writer_pb2.BrokerMessage]:
126
- yield get_writer_bm(bm)
126
+ yield bm
127
127
 
128
128
  ingest_grpc: WriterStub = get_ingest()
129
129
  response: writer_pb2.OpStatusWriter = await ingest_grpc.ProcessMessage(_iterator()) # type: ignore
130
130
  assert response.status == writer_pb2.OpStatusWriter.Status.OK, "Failed to process broker message"
131
131
 
132
132
 
133
- async def send_processor_bm(context: ApplicationContext, bm: writer_pb2.BrokerMessage) -> None:
134
- # Then enqueue the processor part asynchronously
135
- processor_bm = get_processor_bm(bm)
136
- partition = context.partitioning.generate_partition(bm.kbid, bm.uuid)
137
- await transaction_commit(context, processor_bm, partition)
138
-
139
-
140
133
  async def transaction_commit(
141
134
  context: ApplicationContext, bm: writer_pb2.BrokerMessage, partition: int
142
135
  ) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb
3
- Version: 6.4.0.post4283
3
+ Version: 6.4.0.post4287
4
4
  Summary: NucliaDB
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License: AGPL
@@ -20,11 +20,11 @@ Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3 :: Only
21
21
  Requires-Python: <4,>=3.9
22
22
  Description-Content-Type: text/markdown
23
- Requires-Dist: nucliadb-telemetry[all]>=6.4.0.post4283
24
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.4.0.post4283
25
- Requires-Dist: nucliadb-protos>=6.4.0.post4283
26
- Requires-Dist: nucliadb-models>=6.4.0.post4283
27
- Requires-Dist: nidx-protos>=6.4.0.post4283
23
+ Requires-Dist: nucliadb-telemetry[all]>=6.4.0.post4287
24
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.4.0.post4287
25
+ Requires-Dist: nucliadb-protos>=6.4.0.post4287
26
+ Requires-Dist: nucliadb-models>=6.4.0.post4287
27
+ Requires-Dist: nidx-protos>=6.4.0.post4287
28
28
  Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
29
29
  Requires-Dist: nuclia-models>=0.24.2
30
30
  Requires-Dist: uvicorn[standard]
@@ -101,7 +101,7 @@ nucliadb/common/external_index_providers/settings.py,sha256=EGHnIkwxqe6aypwKegXT
101
101
  nucliadb/common/http_clients/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
102
102
  nucliadb/common/http_clients/auth.py,sha256=srfpgAbs2wmqA9u_l-HxsV4YoO77Tse4y3gm3q2YvYM,2112
103
103
  nucliadb/common/http_clients/exceptions.py,sha256=47Y8OjkaGV_F18G07FpJhOzgWKUIexhlILyuVtICz8s,1100
104
- nucliadb/common/http_clients/processing.py,sha256=VzxzFArNsHWGmFoX0c5OrQB3vFW841aeyuP5NgzPQGo,9581
104
+ nucliadb/common/http_clients/processing.py,sha256=crLfKo_2RJr9Uo2vuq11MWFa9tV2njA_v7ZBd95tjNU,9589
105
105
  nucliadb/common/http_clients/pypi.py,sha256=VHIUjwJEJVntVUo_FRoXIo8sLmluy7sa9-iXSITcrMY,1540
106
106
  nucliadb/common/http_clients/utils.py,sha256=yGUkHNS41abHiBoHqo_Mg3QSqGsS7rUtbfGftbEC57U,1529
107
107
  nucliadb/common/maindb/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
@@ -117,10 +117,10 @@ nucliadb/export_import/__init__.py,sha256=y-Is0Bxa8TMV6UiOW0deC_D3U465P65CQ5RjBj
117
117
  nucliadb/export_import/datamanager.py,sha256=xL8b0xvk45q6wx1l7J32JgPmpyjnF6fKiJi2F2B_UQY,6968
118
118
  nucliadb/export_import/exceptions.py,sha256=Dw8WqfG4r6MPJc5TPfbjMvCgXXWTcTOecGHRVU1h3kM,1949
119
119
  nucliadb/export_import/exporter.py,sha256=k2QVx1EjqFlDYiggriWiEJzwtMXzHbldsqWdpGQM3_U,7074
120
- nucliadb/export_import/importer.py,sha256=v5cq9Nn8c2zrY_K_00mydR52f8mdFxR7tLdtNLQ0qvk,4229
120
+ nucliadb/export_import/importer.py,sha256=GNDMt4hdjbcLWdydVq8XFQKefzNJkQ1eTzhshUX64rk,4231
121
121
  nucliadb/export_import/models.py,sha256=dbjScNkiMRv4X3Ktudy1JRliD25bfoDTy3JmEZgQSCc,2121
122
122
  nucliadb/export_import/tasks.py,sha256=DWbdqY97ffoyfipelGXz3Jqz1iam6JCjQSh367Fc3NA,2947
123
- nucliadb/export_import/utils.py,sha256=8XOVMYXXw8b4ikojG7RjQ4tKN3Xu7nfu2yCUOqD50sk,23216
123
+ nucliadb/export_import/utils.py,sha256=iutS86YblS8aLQ9PCZUyTJMN6lDV4DjcjaptQVBfBNA,22874
124
124
  nucliadb/ingest/__init__.py,sha256=fsw3C38VP50km3R-nHL775LNGPpJ4JxqXJ2Ib1f5SqE,1011
125
125
  nucliadb/ingest/app.py,sha256=Eympy8nbz09VDNPF28MuIeKMb7wgB9cTSOObS8uvL0o,8372
126
126
  nucliadb/ingest/partitions.py,sha256=2NIhMYbNT0TNBL6bX1UMSi7vxFGICstCKEqsB0TXHOE,2410
@@ -368,8 +368,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
368
368
  nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
369
369
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
370
370
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
371
- nucliadb-6.4.0.post4283.dist-info/METADATA,sha256=qNXC_Jl6XRiEVh5KfaC09owsizR7ozLE3OJ2FG_Ygsg,4223
372
- nucliadb-6.4.0.post4283.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
373
- nucliadb-6.4.0.post4283.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
374
- nucliadb-6.4.0.post4283.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
375
- nucliadb-6.4.0.post4283.dist-info/RECORD,,
371
+ nucliadb-6.4.0.post4287.dist-info/METADATA,sha256=5QNnOEzt2bbjxt2hVf853EWspV23p_WQLeNr7FL9IQk,4223
372
+ nucliadb-6.4.0.post4287.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
373
+ nucliadb-6.4.0.post4287.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
374
+ nucliadb-6.4.0.post4287.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
375
+ nucliadb-6.4.0.post4287.dist-info/RECORD,,