Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | ) -> Iterable[Optional[Dict[str, bytes]]]: | ||||
Streams of contents as dict with their raw data: | Streams of contents as dict with their raw data: | ||||
- sha1 (bytes): content id | - sha1 (bytes): content id | ||||
- data (bytes): content's raw data | - data (bytes): content's raw data | ||||
""" | """ | ||||
... | ... | ||||
@deprecated | |||||
@remote_api_endpoint("content/range") | |||||
def content_get_range( | |||||
self, start: bytes, end: bytes, limit: int = 1000 | |||||
) -> Dict[str, Any]: | |||||
"""Retrieve contents within range [start, end] bound by limit. | |||||
Note that this function may return more than one blob per hash. The | |||||
limit is enforced with multiplicity (ie. two blobs with the same hash | |||||
will count twice toward the limit). | |||||
Args: | |||||
**start**: Starting identifier range (expected smaller | |||||
than end) | |||||
**end**: Ending identifier range (expected larger | |||||
than start) | |||||
**limit**: Limit result (default to 1000) | |||||
Returns: | |||||
a dict with keys: | |||||
- contents [dict]: iterable of contents in between the range. | |||||
- next (bytes): There remains content in the range | |||||
starting from this next sha1 | |||||
""" | |||||
... | |||||
@remote_api_endpoint("content/partition") | @remote_api_endpoint("content/partition") | ||||
def content_get_partition( | def content_get_partition( | ||||
self, | self, | ||||
partition_id: int, | partition_id: int, | ||||
nb_partitions: int, | nb_partitions: int, | ||||
limit: int = 1000, | limit: int = 1000, | ||||
page_token: Optional[str] = None, | page_token: Optional[str] = None, | ||||
) -> Dict[str, Any]: | ) -> Dict[str, Any]: | ||||
▲ Show 20 Lines • Show All 1,109 Lines • Show Last 20 Lines |