Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/storage.py
Show First 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | ) -> Dict[str, Any]: | ||||
} | } | ||||
@timed | @timed | ||||
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: str = None, | page_token: Optional[str] = None, | ||||
): | ) -> Dict[str, Any]: | ||||
if limit is None: | if limit is None: | ||||
raise StorageArgumentException("limit should not be None") | raise StorageArgumentException("limit should not be None") | ||||
(start, end) = get_partition_bounds_bytes( | (start, end) = get_partition_bounds_bytes( | ||||
partition_id, nb_partitions, SHA1_SIZE | partition_id, nb_partitions, SHA1_SIZE | ||||
) | ) | ||||
if page_token: | if page_token: | ||||
start = hash_to_bytes(page_token) | start = hash_to_bytes(page_token) | ||||
if end is None: | if end is None: | ||||
▲ Show 20 Lines • Show All 1,100 Lines • Show Last 20 Lines |