nucliadb 6.4.0.post4283__py3-none-any.whl → 6.4.0.post4293__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.
- nucliadb/common/http_clients/processing.py +1 -1
- nucliadb/export_import/importer.py +2 -2
- nucliadb/export_import/utils.py +11 -18
- nucliadb/search/api/v1/catalog.py +2 -1
- {nucliadb-6.4.0.post4283.dist-info → nucliadb-6.4.0.post4293.dist-info}/METADATA +6 -6
- {nucliadb-6.4.0.post4283.dist-info → nucliadb-6.4.0.post4293.dist-info}/RECORD +9 -9
- {nucliadb-6.4.0.post4283.dist-info → nucliadb-6.4.0.post4293.dist-info}/WHEEL +0 -0
- {nucliadb-6.4.0.post4283.dist-info → nucliadb-6.4.0.post4293.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.4.0.post4283.dist-info → nucliadb-6.4.0.post4293.dist-info}/top_level.txt +0 -0
@@ -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
|
-
|
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
|
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])
|
nucliadb/export_import/utils.py
CHANGED
@@ -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
|
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:
|
@@ -184,7 +184,8 @@ async def catalog(
|
|
184
184
|
return HTTPClientError(status_code=exc.status_code, detail=exc.detail)
|
185
185
|
finally:
|
186
186
|
duration = time() - start_time
|
187
|
-
|
187
|
+
max_time = 5 if item.faceted else 2
|
188
|
+
if duration > max_time: # pragma: no cover
|
188
189
|
logger.warning(
|
189
190
|
"Slow catalog request",
|
190
191
|
extra={
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: nucliadb
|
3
|
-
Version: 6.4.0.
|
3
|
+
Version: 6.4.0.post4293
|
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.
|
24
|
-
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.4.0.
|
25
|
-
Requires-Dist: nucliadb-protos>=6.4.0.
|
26
|
-
Requires-Dist: nucliadb-models>=6.4.0.
|
27
|
-
Requires-Dist: nidx-protos>=6.4.0.
|
23
|
+
Requires-Dist: nucliadb-telemetry[all]>=6.4.0.post4293
|
24
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.4.0.post4293
|
25
|
+
Requires-Dist: nucliadb-protos>=6.4.0.post4293
|
26
|
+
Requires-Dist: nucliadb-models>=6.4.0.post4293
|
27
|
+
Requires-Dist: nidx-protos>=6.4.0.post4293
|
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=
|
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=
|
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=
|
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
|
@@ -213,7 +213,7 @@ nucliadb/search/utilities.py,sha256=9SsRDw0rJVXVoLBfF7rBb6q080h-thZc7u8uRcTiBeY,
|
|
213
213
|
nucliadb/search/api/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
214
214
|
nucliadb/search/api/v1/__init__.py,sha256=DH16OYnw9jQ38OpKlmdXeoq2j40ZPXZRtGvClKOkMhw,1239
|
215
215
|
nucliadb/search/api/v1/ask.py,sha256=b4tz33HNsfT5DXv_2DMc_jirnFsHuobreWkbAKkzj5o,5337
|
216
|
-
nucliadb/search/api/v1/catalog.py,sha256=
|
216
|
+
nucliadb/search/api/v1/catalog.py,sha256=W0cPWuC27Y4bO7Ifl1VQp8OPYfF5gv5yeWZBsuJMxUU,7721
|
217
217
|
nucliadb/search/api/v1/feedback.py,sha256=kNLc4dHz2SXHzV0PwC1WiRAwY88fDptPcP-kO0q-FrQ,2620
|
218
218
|
nucliadb/search/api/v1/find.py,sha256=C4sTGFRS9tQFF8v1zhnHQvnExJoGDYi78bZTRfwhGrc,10831
|
219
219
|
nucliadb/search/api/v1/graph.py,sha256=ItVpzJbqfDLjoIo2fTb2mKGCM1Z34sx7CBb3gNmj6IQ,4274
|
@@ -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.
|
372
|
-
nucliadb-6.4.0.
|
373
|
-
nucliadb-6.4.0.
|
374
|
-
nucliadb-6.4.0.
|
375
|
-
nucliadb-6.4.0.
|
371
|
+
nucliadb-6.4.0.post4293.dist-info/METADATA,sha256=-Dsk2JpP3WFTtfqDx92QjQqjbRhNV-wdkpcn14t1ttg,4223
|
372
|
+
nucliadb-6.4.0.post4293.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
373
|
+
nucliadb-6.4.0.post4293.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
374
|
+
nucliadb-6.4.0.post4293.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
375
|
+
nucliadb-6.4.0.post4293.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|