sharkbite 1.4.2__tar.gz → 1.4.3__tar.gz
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.
- {sharkbite-1.4.2/src/sharkbite.egg-info → sharkbite-1.4.3}/PKG-INFO +67 -95
- sharkbite-1.4.3/README.md +96 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/pyproject.toml +1 -1
- sharkbite-1.4.3/src/sharkbite/_version.py +1 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3/src/sharkbite.egg-info}/PKG-INFO +67 -95
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_release.py +4 -1
- sharkbite-1.4.2/README.md +0 -124
- sharkbite-1.4.2/src/sharkbite/_version.py +0 -1
- {sharkbite-1.4.2 → sharkbite-1.4.3}/LICENSE +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/MANIFEST.in +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/setup.cfg +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/setup.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/pysharkbite/__init__.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/__init__.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/_native.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/admin.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/client.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/compatibility.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/configuration.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/data.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/errors.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/py.typed +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/storage.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite/writer.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite.egg-info/SOURCES.txt +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite.egg-info/dependency_links.txt +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/sharkbite.egg-info/top_level.txt +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/shoal/__init__.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/shoal/_compat.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/shoal/document.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/shoal/errors.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/shoal/graph.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/shoal/retrieval.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/src/shoal/types.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_artifact_preview.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_compiled_library.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_cross_cutting.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_cross_platform_artifacts.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_data_model.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_document.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_errors.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_foundation.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_graph.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_retrieval.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_storage.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_streaming_compat.py +0 -0
- {sharkbite-1.4.2 → sharkbite-1.4.3}/tests/test_writer_admin.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sharkbite
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.3
|
|
4
4
|
Summary: Accumulo-compatible Python bindings
|
|
5
5
|
Author: Shoal contributors
|
|
6
6
|
License: Apache License
|
|
@@ -220,62 +220,47 @@ Description-Content-Type: text/markdown
|
|
|
220
220
|
License-File: LICENSE
|
|
221
221
|
Dynamic: license-file
|
|
222
222
|
|
|
223
|
-
#
|
|
223
|
+
# Sharkbite Python client
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
and `pysharkbite`, backed by the Shoal stable C ABI.
|
|
228
|
-
The [normative scope ADR](../docs/sharkbite-client-scope.md) currently records
|
|
229
|
-
394 required rows, 390 satisfied rows, and 4 explicit core gaps; optional
|
|
230
|
-
Torch, pandas, embedded, historical C++, and deferred native macOS surfaces do
|
|
231
|
-
not block this package.
|
|
225
|
+
Sharkbite is a Python client for Accumulo-compatible storage, backed by the
|
|
226
|
+
Shoal stable C ABI. The package keeps the established import names:
|
|
232
227
|
|
|
233
|
-
|
|
228
|
+
```python
|
|
229
|
+
import sharkbite
|
|
230
|
+
import pysharkbite
|
|
231
|
+
|
|
232
|
+
assert pysharkbite.Client is sharkbite.Client
|
|
233
|
+
```
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
- stable status-to-exception mapping, including Sharkbite `ClientException`;
|
|
237
|
-
- owned handle/result cleanup and idempotent context-manager close;
|
|
238
|
-
- `Connector`, `Client`, `Scanner`, `BatchScanner`, restartable sync/async
|
|
239
|
-
`Results`, `Key`, and bounded scans through the streaming C ABI;
|
|
240
|
-
- binary-safe `Mutation` and `BatchWriter` APIs with deterministic
|
|
241
|
-
flush/close and structured write-failure status mapping;
|
|
242
|
-
- table, namespace, and security administration through both direct
|
|
243
|
-
connector helpers and Sharkbite-shaped `tableOps`, `namespaceOps`, and
|
|
244
|
-
`securityOps` objects;
|
|
245
|
-
- context-managed HDFS clients and typed/raw streams, using Hadoop
|
|
246
|
-
configuration rather than accepting credentials in Python;
|
|
247
|
-
- context-managed RFile sequential readers/writers, including named locality
|
|
248
|
-
groups.
|
|
235
|
+
## Install
|
|
249
236
|
|
|
250
|
-
|
|
251
|
-
raise `NotImplementedError` with a stable message. They never fabricate data.
|
|
237
|
+
For supported Linux x86-64 systems, install the published wheel:
|
|
252
238
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
operations may run from multiple Python threads, while close/free must not race
|
|
257
|
-
with arbitrary use of the same wrapper.
|
|
239
|
+
```bash
|
|
240
|
+
python -m pip install sharkbite
|
|
241
|
+
```
|
|
258
242
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
before entering Go and raises `ForkSafetyError` in a fork child. Do not close,
|
|
262
|
-
free, or otherwise reuse inherited objects there. Use `subprocess`, the
|
|
263
|
-
`spawn`/`forkserver` multiprocessing start methods, or immediate `exec()` and
|
|
264
|
-
construct fresh Shoal objects in the new interpreter. The parent process and
|
|
265
|
-
fresh exec-created subprocesses remain supported.
|
|
243
|
+
That wheel includes the verified Shoal native library. You do **not** need to
|
|
244
|
+
build Shoal separately.
|
|
266
245
|
|
|
267
|
-
|
|
246
|
+
Source installs and platforms without a published native wheel use an existing
|
|
247
|
+
Shoal shared library. Give its absolute path explicitly:
|
|
268
248
|
|
|
269
|
-
```
|
|
270
|
-
python -m pip install ./python
|
|
271
|
-
|
|
249
|
+
```bash
|
|
250
|
+
python -m pip install sharkbite # or: python -m pip install ./python
|
|
251
|
+
export SHOAL_LIBRARY=/opt/shoal/libshoal.so
|
|
272
252
|
```
|
|
273
253
|
|
|
274
|
-
On
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
254
|
+
On Windows, use an absolute path to `shoal.dll`; on macOS, use an absolute path
|
|
255
|
+
to `libshoal.dylib`. System-library discovery is disabled unless you explicitly
|
|
256
|
+
set `SHOAL_ALLOW_SYSTEM_LIBRARY=1`. The loader never searches the current
|
|
257
|
+
working directory or repository build directories.
|
|
258
|
+
|
|
259
|
+
The loader verifies the bundled library checksum, checks ABI major version 1,
|
|
260
|
+
checks the minimum supported ABI version, and resolves capabilities before an
|
|
261
|
+
operation is allowed.
|
|
262
|
+
|
|
263
|
+
## Quick example
|
|
279
264
|
|
|
280
265
|
```python
|
|
281
266
|
from sharkbite import Client
|
|
@@ -286,61 +271,48 @@ with Client("accumulo", "zk1:2181", "root", "secret", table="events") as client:
|
|
|
286
271
|
print(key.row, value)
|
|
287
272
|
```
|
|
288
273
|
|
|
289
|
-
|
|
290
|
-
5/21/22 for scans, 6/7/8 for writes, and 9/10/11/12/19 for administration.
|
|
291
|
-
Storage uses capabilities 16 (RFile), 27 (HDFS), and 28 (named locality
|
|
292
|
-
groups). Capability 29 adds the exact buffered-writer queue accessor and
|
|
293
|
-
process-wide logging control.
|
|
274
|
+
## What is included
|
|
294
275
|
|
|
295
|
-
|
|
296
|
-
`PythonIterator` remain import-compatible but raise stable `NotImplementedError`
|
|
297
|
-
messages when applied. These are approved divergences: use normal RPC scans,
|
|
298
|
-
`RFileOperations` for explicit RFile access, and Shoal's Go iterator runtime.
|
|
299
|
-
Shoal accepts Accumulo 4 configurations only, never exposes password read-back
|
|
300
|
-
or generated Thrift exceptions, and scopes transport pools per connector.
|
|
276
|
+
The current binding provides:
|
|
301
277
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
278
|
+
- deterministic native-library discovery and ABI/capability negotiation;
|
|
279
|
+
- stable status-to-exception mapping, including `ClientException`;
|
|
280
|
+
- owned handles and results with idempotent context-manager cleanup;
|
|
281
|
+
- `Connector`, `Client`, `Scanner`, `BatchScanner`, synchronous and
|
|
282
|
+
asynchronous results, `Key`, and bounded scans;
|
|
283
|
+
- binary-safe `Mutation` and `BatchWriter` operations with structured failure
|
|
284
|
+
reporting;
|
|
285
|
+
- table, namespace, and security administration through connector helpers and
|
|
286
|
+
`tableOps`, `namespaceOps`, and `securityOps`;
|
|
287
|
+
- context-managed HDFS clients and typed or raw streams;
|
|
288
|
+
- context-managed RFile readers and writers, including named locality groups.
|
|
309
289
|
|
|
310
|
-
|
|
311
|
-
|
|
290
|
+
The package accepts Accumulo 4 configurations. It does not expose generated
|
|
291
|
+
Thrift exceptions or password read-back. Transport pools are scoped per
|
|
292
|
+
connector.
|
|
312
293
|
|
|
313
|
-
|
|
314
|
-
with hdfs.write("/tmp/value") as out:
|
|
315
|
-
out.writeString("hello")
|
|
316
|
-
with hdfs.read("/tmp/value") as source:
|
|
317
|
-
assert source.readString() == "hello"
|
|
294
|
+
## Concurrency and process safety
|
|
318
295
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
writer.append(KeyValue(Key(b"a", b"named", b"", b"", 1), b"n"))
|
|
323
|
-
```
|
|
296
|
+
Blocking native calls release the Python GIL. Shared operations may run from
|
|
297
|
+
multiple Python threads, but closing or freeing a wrapper must not race with
|
|
298
|
+
use of that wrapper.
|
|
324
299
|
|
|
325
|
-
|
|
326
|
-
|
|
300
|
+
A fork child cannot reuse inherited native state. In a fork child, construct
|
|
301
|
+
fresh objects after `exec()`, or use the `spawn` or `forkserver` multiprocessing
|
|
302
|
+
start method. The parent process and a fresh exec-created child remain
|
|
303
|
+
supported.
|
|
327
304
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
writer.addMutation(mutation)
|
|
335
|
-
connector.securityOps().grant_table_permission(
|
|
336
|
-
"analyst", "events", TablePermissions.READ
|
|
337
|
-
)
|
|
338
|
-
```
|
|
305
|
+
## Compatibility boundaries
|
|
306
|
+
|
|
307
|
+
Some historical entry points remain importable for discovery but raise
|
|
308
|
+
`NotImplementedError` with a stable message. This includes hedged reads,
|
|
309
|
+
RFile-only scanner mode, and Python iterators; use normal RPC scans,
|
|
310
|
+
`RFileOperations`, and Shoal's Go iterator runtime instead.
|
|
339
311
|
|
|
340
312
|
Online compaction, legacy chunked iterators, and other surfaces without an
|
|
341
|
-
equivalent stable C ABI remain
|
|
313
|
+
equivalent stable C ABI remain outside the binding. Live-cluster timeout,
|
|
314
|
+
consistency, and retry parity are tracked in [issue #74](https://github.com/phrocker/sharkbite/issues/74).
|
|
342
315
|
|
|
343
|
-
See the
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
checksums, and signing.
|
|
316
|
+
See the [release policy](https://github.com/phrocker/sharkbite/blob/main/docs/python-release.md)
|
|
317
|
+
for supported platforms, reproducible builds, artifact verification, checksums,
|
|
318
|
+
attestations, and the pre-release container chaos gate.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Sharkbite Python client
|
|
2
|
+
|
|
3
|
+
Sharkbite is a Python client for Accumulo-compatible storage, backed by the
|
|
4
|
+
Shoal stable C ABI. The package keeps the established import names:
|
|
5
|
+
|
|
6
|
+
```python
|
|
7
|
+
import sharkbite
|
|
8
|
+
import pysharkbite
|
|
9
|
+
|
|
10
|
+
assert pysharkbite.Client is sharkbite.Client
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
For supported Linux x86-64 systems, install the published wheel:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python -m pip install sharkbite
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
That wheel includes the verified Shoal native library. You do **not** need to
|
|
22
|
+
build Shoal separately.
|
|
23
|
+
|
|
24
|
+
Source installs and platforms without a published native wheel use an existing
|
|
25
|
+
Shoal shared library. Give its absolute path explicitly:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python -m pip install sharkbite # or: python -m pip install ./python
|
|
29
|
+
export SHOAL_LIBRARY=/opt/shoal/libshoal.so
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
On Windows, use an absolute path to `shoal.dll`; on macOS, use an absolute path
|
|
33
|
+
to `libshoal.dylib`. System-library discovery is disabled unless you explicitly
|
|
34
|
+
set `SHOAL_ALLOW_SYSTEM_LIBRARY=1`. The loader never searches the current
|
|
35
|
+
working directory or repository build directories.
|
|
36
|
+
|
|
37
|
+
The loader verifies the bundled library checksum, checks ABI major version 1,
|
|
38
|
+
checks the minimum supported ABI version, and resolves capabilities before an
|
|
39
|
+
operation is allowed.
|
|
40
|
+
|
|
41
|
+
## Quick example
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from sharkbite import Client
|
|
45
|
+
|
|
46
|
+
with Client("accumulo", "zk1:2181", "root", "secret", table="events") as client:
|
|
47
|
+
with client.scanner() as scanner:
|
|
48
|
+
for key, value in scanner.scan(b"a", b"z"):
|
|
49
|
+
print(key.row, value)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## What is included
|
|
53
|
+
|
|
54
|
+
The current binding provides:
|
|
55
|
+
|
|
56
|
+
- deterministic native-library discovery and ABI/capability negotiation;
|
|
57
|
+
- stable status-to-exception mapping, including `ClientException`;
|
|
58
|
+
- owned handles and results with idempotent context-manager cleanup;
|
|
59
|
+
- `Connector`, `Client`, `Scanner`, `BatchScanner`, synchronous and
|
|
60
|
+
asynchronous results, `Key`, and bounded scans;
|
|
61
|
+
- binary-safe `Mutation` and `BatchWriter` operations with structured failure
|
|
62
|
+
reporting;
|
|
63
|
+
- table, namespace, and security administration through connector helpers and
|
|
64
|
+
`tableOps`, `namespaceOps`, and `securityOps`;
|
|
65
|
+
- context-managed HDFS clients and typed or raw streams;
|
|
66
|
+
- context-managed RFile readers and writers, including named locality groups.
|
|
67
|
+
|
|
68
|
+
The package accepts Accumulo 4 configurations. It does not expose generated
|
|
69
|
+
Thrift exceptions or password read-back. Transport pools are scoped per
|
|
70
|
+
connector.
|
|
71
|
+
|
|
72
|
+
## Concurrency and process safety
|
|
73
|
+
|
|
74
|
+
Blocking native calls release the Python GIL. Shared operations may run from
|
|
75
|
+
multiple Python threads, but closing or freeing a wrapper must not race with
|
|
76
|
+
use of that wrapper.
|
|
77
|
+
|
|
78
|
+
A fork child cannot reuse inherited native state. In a fork child, construct
|
|
79
|
+
fresh objects after `exec()`, or use the `spawn` or `forkserver` multiprocessing
|
|
80
|
+
start method. The parent process and a fresh exec-created child remain
|
|
81
|
+
supported.
|
|
82
|
+
|
|
83
|
+
## Compatibility boundaries
|
|
84
|
+
|
|
85
|
+
Some historical entry points remain importable for discovery but raise
|
|
86
|
+
`NotImplementedError` with a stable message. This includes hedged reads,
|
|
87
|
+
RFile-only scanner mode, and Python iterators; use normal RPC scans,
|
|
88
|
+
`RFileOperations`, and Shoal's Go iterator runtime instead.
|
|
89
|
+
|
|
90
|
+
Online compaction, legacy chunked iterators, and other surfaces without an
|
|
91
|
+
equivalent stable C ABI remain outside the binding. Live-cluster timeout,
|
|
92
|
+
consistency, and retry parity are tracked in [issue #74](https://github.com/phrocker/sharkbite/issues/74).
|
|
93
|
+
|
|
94
|
+
See the [release policy](https://github.com/phrocker/sharkbite/blob/main/docs/python-release.md)
|
|
95
|
+
for supported platforms, reproducible builds, artifact verification, checksums,
|
|
96
|
+
attestations, and the pre-release container chaos gate.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.4.3"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sharkbite
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.3
|
|
4
4
|
Summary: Accumulo-compatible Python bindings
|
|
5
5
|
Author: Shoal contributors
|
|
6
6
|
License: Apache License
|
|
@@ -220,62 +220,47 @@ Description-Content-Type: text/markdown
|
|
|
220
220
|
License-File: LICENSE
|
|
221
221
|
Dynamic: license-file
|
|
222
222
|
|
|
223
|
-
#
|
|
223
|
+
# Sharkbite Python client
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
and `pysharkbite`, backed by the Shoal stable C ABI.
|
|
228
|
-
The [normative scope ADR](../docs/sharkbite-client-scope.md) currently records
|
|
229
|
-
394 required rows, 390 satisfied rows, and 4 explicit core gaps; optional
|
|
230
|
-
Torch, pandas, embedded, historical C++, and deferred native macOS surfaces do
|
|
231
|
-
not block this package.
|
|
225
|
+
Sharkbite is a Python client for Accumulo-compatible storage, backed by the
|
|
226
|
+
Shoal stable C ABI. The package keeps the established import names:
|
|
232
227
|
|
|
233
|
-
|
|
228
|
+
```python
|
|
229
|
+
import sharkbite
|
|
230
|
+
import pysharkbite
|
|
231
|
+
|
|
232
|
+
assert pysharkbite.Client is sharkbite.Client
|
|
233
|
+
```
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
- stable status-to-exception mapping, including Sharkbite `ClientException`;
|
|
237
|
-
- owned handle/result cleanup and idempotent context-manager close;
|
|
238
|
-
- `Connector`, `Client`, `Scanner`, `BatchScanner`, restartable sync/async
|
|
239
|
-
`Results`, `Key`, and bounded scans through the streaming C ABI;
|
|
240
|
-
- binary-safe `Mutation` and `BatchWriter` APIs with deterministic
|
|
241
|
-
flush/close and structured write-failure status mapping;
|
|
242
|
-
- table, namespace, and security administration through both direct
|
|
243
|
-
connector helpers and Sharkbite-shaped `tableOps`, `namespaceOps`, and
|
|
244
|
-
`securityOps` objects;
|
|
245
|
-
- context-managed HDFS clients and typed/raw streams, using Hadoop
|
|
246
|
-
configuration rather than accepting credentials in Python;
|
|
247
|
-
- context-managed RFile sequential readers/writers, including named locality
|
|
248
|
-
groups.
|
|
235
|
+
## Install
|
|
249
236
|
|
|
250
|
-
|
|
251
|
-
raise `NotImplementedError` with a stable message. They never fabricate data.
|
|
237
|
+
For supported Linux x86-64 systems, install the published wheel:
|
|
252
238
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
operations may run from multiple Python threads, while close/free must not race
|
|
257
|
-
with arbitrary use of the same wrapper.
|
|
239
|
+
```bash
|
|
240
|
+
python -m pip install sharkbite
|
|
241
|
+
```
|
|
258
242
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
before entering Go and raises `ForkSafetyError` in a fork child. Do not close,
|
|
262
|
-
free, or otherwise reuse inherited objects there. Use `subprocess`, the
|
|
263
|
-
`spawn`/`forkserver` multiprocessing start methods, or immediate `exec()` and
|
|
264
|
-
construct fresh Shoal objects in the new interpreter. The parent process and
|
|
265
|
-
fresh exec-created subprocesses remain supported.
|
|
243
|
+
That wheel includes the verified Shoal native library. You do **not** need to
|
|
244
|
+
build Shoal separately.
|
|
266
245
|
|
|
267
|
-
|
|
246
|
+
Source installs and platforms without a published native wheel use an existing
|
|
247
|
+
Shoal shared library. Give its absolute path explicitly:
|
|
268
248
|
|
|
269
|
-
```
|
|
270
|
-
python -m pip install ./python
|
|
271
|
-
|
|
249
|
+
```bash
|
|
250
|
+
python -m pip install sharkbite # or: python -m pip install ./python
|
|
251
|
+
export SHOAL_LIBRARY=/opt/shoal/libshoal.so
|
|
272
252
|
```
|
|
273
253
|
|
|
274
|
-
On
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
254
|
+
On Windows, use an absolute path to `shoal.dll`; on macOS, use an absolute path
|
|
255
|
+
to `libshoal.dylib`. System-library discovery is disabled unless you explicitly
|
|
256
|
+
set `SHOAL_ALLOW_SYSTEM_LIBRARY=1`. The loader never searches the current
|
|
257
|
+
working directory or repository build directories.
|
|
258
|
+
|
|
259
|
+
The loader verifies the bundled library checksum, checks ABI major version 1,
|
|
260
|
+
checks the minimum supported ABI version, and resolves capabilities before an
|
|
261
|
+
operation is allowed.
|
|
262
|
+
|
|
263
|
+
## Quick example
|
|
279
264
|
|
|
280
265
|
```python
|
|
281
266
|
from sharkbite import Client
|
|
@@ -286,61 +271,48 @@ with Client("accumulo", "zk1:2181", "root", "secret", table="events") as client:
|
|
|
286
271
|
print(key.row, value)
|
|
287
272
|
```
|
|
288
273
|
|
|
289
|
-
|
|
290
|
-
5/21/22 for scans, 6/7/8 for writes, and 9/10/11/12/19 for administration.
|
|
291
|
-
Storage uses capabilities 16 (RFile), 27 (HDFS), and 28 (named locality
|
|
292
|
-
groups). Capability 29 adds the exact buffered-writer queue accessor and
|
|
293
|
-
process-wide logging control.
|
|
274
|
+
## What is included
|
|
294
275
|
|
|
295
|
-
|
|
296
|
-
`PythonIterator` remain import-compatible but raise stable `NotImplementedError`
|
|
297
|
-
messages when applied. These are approved divergences: use normal RPC scans,
|
|
298
|
-
`RFileOperations` for explicit RFile access, and Shoal's Go iterator runtime.
|
|
299
|
-
Shoal accepts Accumulo 4 configurations only, never exposes password read-back
|
|
300
|
-
or generated Thrift exceptions, and scopes transport pools per connector.
|
|
276
|
+
The current binding provides:
|
|
301
277
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
278
|
+
- deterministic native-library discovery and ABI/capability negotiation;
|
|
279
|
+
- stable status-to-exception mapping, including `ClientException`;
|
|
280
|
+
- owned handles and results with idempotent context-manager cleanup;
|
|
281
|
+
- `Connector`, `Client`, `Scanner`, `BatchScanner`, synchronous and
|
|
282
|
+
asynchronous results, `Key`, and bounded scans;
|
|
283
|
+
- binary-safe `Mutation` and `BatchWriter` operations with structured failure
|
|
284
|
+
reporting;
|
|
285
|
+
- table, namespace, and security administration through connector helpers and
|
|
286
|
+
`tableOps`, `namespaceOps`, and `securityOps`;
|
|
287
|
+
- context-managed HDFS clients and typed or raw streams;
|
|
288
|
+
- context-managed RFile readers and writers, including named locality groups.
|
|
309
289
|
|
|
310
|
-
|
|
311
|
-
|
|
290
|
+
The package accepts Accumulo 4 configurations. It does not expose generated
|
|
291
|
+
Thrift exceptions or password read-back. Transport pools are scoped per
|
|
292
|
+
connector.
|
|
312
293
|
|
|
313
|
-
|
|
314
|
-
with hdfs.write("/tmp/value") as out:
|
|
315
|
-
out.writeString("hello")
|
|
316
|
-
with hdfs.read("/tmp/value") as source:
|
|
317
|
-
assert source.readString() == "hello"
|
|
294
|
+
## Concurrency and process safety
|
|
318
295
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
writer.append(KeyValue(Key(b"a", b"named", b"", b"", 1), b"n"))
|
|
323
|
-
```
|
|
296
|
+
Blocking native calls release the Python GIL. Shared operations may run from
|
|
297
|
+
multiple Python threads, but closing or freeing a wrapper must not race with
|
|
298
|
+
use of that wrapper.
|
|
324
299
|
|
|
325
|
-
|
|
326
|
-
|
|
300
|
+
A fork child cannot reuse inherited native state. In a fork child, construct
|
|
301
|
+
fresh objects after `exec()`, or use the `spawn` or `forkserver` multiprocessing
|
|
302
|
+
start method. The parent process and a fresh exec-created child remain
|
|
303
|
+
supported.
|
|
327
304
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
writer.addMutation(mutation)
|
|
335
|
-
connector.securityOps().grant_table_permission(
|
|
336
|
-
"analyst", "events", TablePermissions.READ
|
|
337
|
-
)
|
|
338
|
-
```
|
|
305
|
+
## Compatibility boundaries
|
|
306
|
+
|
|
307
|
+
Some historical entry points remain importable for discovery but raise
|
|
308
|
+
`NotImplementedError` with a stable message. This includes hedged reads,
|
|
309
|
+
RFile-only scanner mode, and Python iterators; use normal RPC scans,
|
|
310
|
+
`RFileOperations`, and Shoal's Go iterator runtime instead.
|
|
339
311
|
|
|
340
312
|
Online compaction, legacy chunked iterators, and other surfaces without an
|
|
341
|
-
equivalent stable C ABI remain
|
|
313
|
+
equivalent stable C ABI remain outside the binding. Live-cluster timeout,
|
|
314
|
+
consistency, and retry parity are tracked in [issue #74](https://github.com/phrocker/sharkbite/issues/74).
|
|
342
315
|
|
|
343
|
-
See the
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
checksums, and signing.
|
|
316
|
+
See the [release policy](https://github.com/phrocker/sharkbite/blob/main/docs/python-release.md)
|
|
317
|
+
for supported platforms, reproducible builds, artifact verification, checksums,
|
|
318
|
+
attestations, and the pre-release container chaos gate.
|
|
@@ -33,7 +33,10 @@ class ReleasePolicyTests(unittest.TestCase):
|
|
|
33
33
|
self.assertNotRegex(workflow, r"(?m)^\s+password:")
|
|
34
34
|
|
|
35
35
|
def test_import_names_share_version_and_public_api(self):
|
|
36
|
-
|
|
36
|
+
project = tomllib.loads(
|
|
37
|
+
(Path(__file__).parents[1] / "pyproject.toml").read_text(encoding="utf-8")
|
|
38
|
+
)["project"]
|
|
39
|
+
self.assertEqual(sharkbite.__version__, project["version"])
|
|
37
40
|
self.assertEqual(pysharkbite.__version__, sharkbite.__version__)
|
|
38
41
|
self.assertIs(pysharkbite.Connector, sharkbite.Connector)
|
|
39
42
|
self.assertIn("__version__", sharkbite.__all__)
|
sharkbite-1.4.2/README.md
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# Shoal Python binding
|
|
2
|
-
|
|
3
|
-
This is an independently usable **incremental binding** for the canonical
|
|
4
|
-
`sharkbite` distribution. It installs the import-compatible modules `sharkbite`
|
|
5
|
-
and `pysharkbite`, backed by the Shoal stable C ABI.
|
|
6
|
-
The [normative scope ADR](../docs/sharkbite-client-scope.md) currently records
|
|
7
|
-
394 required rows, 390 satisfied rows, and 4 explicit core gaps; optional
|
|
8
|
-
Torch, pandas, embedded, historical C++, and deferred native macOS surfaces do
|
|
9
|
-
not block this package.
|
|
10
|
-
|
|
11
|
-
Supported now:
|
|
12
|
-
|
|
13
|
-
- deterministic Shoal shared-library discovery and ABI/capability negotiation;
|
|
14
|
-
- stable status-to-exception mapping, including Sharkbite `ClientException`;
|
|
15
|
-
- owned handle/result cleanup and idempotent context-manager close;
|
|
16
|
-
- `Connector`, `Client`, `Scanner`, `BatchScanner`, restartable sync/async
|
|
17
|
-
`Results`, `Key`, and bounded scans through the streaming C ABI;
|
|
18
|
-
- binary-safe `Mutation` and `BatchWriter` APIs with deterministic
|
|
19
|
-
flush/close and structured write-failure status mapping;
|
|
20
|
-
- table, namespace, and security administration through both direct
|
|
21
|
-
connector helpers and Sharkbite-shaped `tableOps`, `namespaceOps`, and
|
|
22
|
-
`securityOps` objects;
|
|
23
|
-
- context-managed HDFS clients and typed/raw streams, using Hadoop
|
|
24
|
-
configuration rather than accepting credentials in Python;
|
|
25
|
-
- context-managed RFile sequential readers/writers, including named locality
|
|
26
|
-
groups.
|
|
27
|
-
|
|
28
|
-
Unsupported legacy entry points are present only where useful for discovery and
|
|
29
|
-
raise `NotImplementedError` with a stable message. They never fabricate data.
|
|
30
|
-
|
|
31
|
-
Python loads Shoal with `ctypes.CDLL`, so blocking native calls release the GIL;
|
|
32
|
-
Python result copying and exception construction run only after the GIL is
|
|
33
|
-
reacquired. The native handle concurrency rules still apply: supported shared
|
|
34
|
-
operations may run from multiple Python threads, while close/free must not race
|
|
35
|
-
with arbitrary use of the same wrapper.
|
|
36
|
-
|
|
37
|
-
On Unix, inherited native state is intentionally unusable after `fork()`.
|
|
38
|
-
Every bound native function and `NativeAPI` construction checks the process
|
|
39
|
-
before entering Go and raises `ForkSafetyError` in a fork child. Do not close,
|
|
40
|
-
free, or otherwise reuse inherited objects there. Use `subprocess`, the
|
|
41
|
-
`spawn`/`forkserver` multiprocessing start methods, or immediate `exec()` and
|
|
42
|
-
construct fresh Shoal objects in the new interpreter. The parent process and
|
|
43
|
-
fresh exec-created subprocesses remain supported.
|
|
44
|
-
|
|
45
|
-
## Install and load
|
|
46
|
-
|
|
47
|
-
```text
|
|
48
|
-
python -m pip install ./python
|
|
49
|
-
set SHOAL_LIBRARY=C:\path\to\shoal.dll
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
On Linux/macOS set `SHOAL_LIBRARY` to `libshoal.so`/`libshoal.dylib`.
|
|
53
|
-
Platform wheels load their checksum-verified private `.libs` library. Source
|
|
54
|
-
installs require an explicit absolute `SHOAL_LIBRARY` path. System loader
|
|
55
|
-
search is disabled unless `SHOAL_ALLOW_SYSTEM_LIBRARY=1`; the current working
|
|
56
|
-
directory and repository build paths are never searched implicitly.
|
|
57
|
-
|
|
58
|
-
```python
|
|
59
|
-
from sharkbite import Client
|
|
60
|
-
|
|
61
|
-
with Client("accumulo", "zk1:2181", "root", "secret", table="events") as client:
|
|
62
|
-
with client.scanner() as scanner:
|
|
63
|
-
for key, value in scanner.scan(b"a", b"z"):
|
|
64
|
-
print(key.row, value)
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
The library must expose ABI major 1. APIs check their exact capability set:
|
|
68
|
-
5/21/22 for scans, 6/7/8 for writes, and 9/10/11/12/19 for administration.
|
|
69
|
-
Storage uses capabilities 16 (RFile), 27 (HDFS), and 28 (named locality
|
|
70
|
-
groups). Capability 29 adds the exact buffered-writer queue accessor and
|
|
71
|
-
process-wide logging control.
|
|
72
|
-
|
|
73
|
-
`ScannerOptions.HedgedReads`, `ScannerOptions.RFileScanOnly`, and
|
|
74
|
-
`PythonIterator` remain import-compatible but raise stable `NotImplementedError`
|
|
75
|
-
messages when applied. These are approved divergences: use normal RPC scans,
|
|
76
|
-
`RFileOperations` for explicit RFile access, and Shoal's Go iterator runtime.
|
|
77
|
-
Shoal accepts Accumulo 4 configurations only, never exposes password read-back
|
|
78
|
-
or generated Thrift exceptions, and scopes transport pools per connector.
|
|
79
|
-
|
|
80
|
-
`tableOps(name).createScanner(auths=(), threads=10)` returns a deferred
|
|
81
|
-
`BatchScanner`. Add copied ranges with `addRange`/`withRange`, then call
|
|
82
|
-
`getResultSet()`; each synchronous or asynchronous iteration opens a fresh
|
|
83
|
-
cursor, and scanner/result context managers close blocked work safely.
|
|
84
|
-
Live-cluster server timeout/consistency and retry parity remain tracked by
|
|
85
|
-
[issue #74](https://github.com/phrocker/sharkbite/issues/74); unit and compiled
|
|
86
|
-
ABI tests do not claim that external evidence.
|
|
87
|
-
|
|
88
|
-
```python
|
|
89
|
-
from sharkbite import Hdfs, Key, KeyValue, RFileOperations
|
|
90
|
-
|
|
91
|
-
with Hdfs("namenode", 8020) as hdfs:
|
|
92
|
-
with hdfs.write("/tmp/value") as out:
|
|
93
|
-
out.writeString("hello")
|
|
94
|
-
with hdfs.read("/tmp/value") as source:
|
|
95
|
-
assert source.readString() == "hello"
|
|
96
|
-
|
|
97
|
-
with RFileOperations.openForWrite("example.rf") as writer:
|
|
98
|
-
writer.append(KeyValue(Key(b"z", b"default", b"", b"", 1), b"d"))
|
|
99
|
-
writer.addLocalityGroup("named")
|
|
100
|
-
writer.append(KeyValue(Key(b"a", b"named", b"", b"", 1), b"n"))
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
```python
|
|
104
|
-
from sharkbite import Connector, Mutation, TablePermissions
|
|
105
|
-
|
|
106
|
-
with Connector("accumulo", "zk1:2181", "root", "secret") as connector:
|
|
107
|
-
table = connector.tableOps("events")
|
|
108
|
-
table.create(recreate=True)
|
|
109
|
-
with table.createWriter([], 4) as writer:
|
|
110
|
-
with Mutation(b"row", _api=connector._api) as mutation:
|
|
111
|
-
mutation.put(b"cf", b"cq", b"A", 7, b"value")
|
|
112
|
-
writer.addMutation(mutation)
|
|
113
|
-
connector.securityOps().grant_table_permission(
|
|
114
|
-
"analyst", "events", TablePermissions.READ
|
|
115
|
-
)
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Online compaction, legacy chunked iterators, and other surfaces without an
|
|
119
|
-
equivalent stable C ABI remain explicit `NotImplementedError` paths.
|
|
120
|
-
|
|
121
|
-
See the repository's
|
|
122
|
-
[release policy](https://github.com/phrocker/sharkbite/blob/main/docs/python-release.md)
|
|
123
|
-
for platform status, reproducible build commands, artifact verification,
|
|
124
|
-
checksums, and signing.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.4.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|