File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # src/zarr/storage/_protocols.py
2+ from __future__ import annotations
3+
4+ from typing import TYPE_CHECKING , Protocol , runtime_checkable
5+
6+ if TYPE_CHECKING :
7+ from collections .abc import AsyncIterator , Iterable , Sequence
8+
9+ from zarr .abc .store import ByteRequest
10+ from zarr .core .buffer import Buffer , BufferPrototype
11+
12+
13+ @runtime_checkable
14+ class SupportsGetRanges (Protocol ):
15+ """Stores that satisfy this protocol can efficiently read many byte ranges
16+ from a single key in a single call, typically via coalescing and concurrent fetch.
17+
18+ Private / unstable. Shape may change before being made public.
19+ """
20+
21+ def get_ranges (
22+ self ,
23+ key : str ,
24+ byte_ranges : Iterable [ByteRequest | None ],
25+ * ,
26+ prototype : BufferPrototype ,
27+ ) -> AsyncIterator [Sequence [tuple [int , Buffer | None ]]]:
28+ """Read many byte ranges from ``key``.
29+
30+ Each yield corresponds to one underlying I/O operation.
31+
32+ See :func:`zarr.core._coalesce.coalesced_get` for full semantics.
33+ """
34+ ...
You can’t perform that action at this time.
0 commit comments