Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | ) -> Iterable[bytes]: | ||||
Returns: | Returns: | ||||
iterable of missing content ids (as per the `key_hash` column) | iterable of missing content ids (as per the `key_hash` column) | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("content/missing/sha1") | @remote_api_endpoint("content/missing/sha1") | ||||
def content_missing_per_sha1(self, contents): | def content_missing_per_sha1(self, contents: List[bytes]) -> Iterable[bytes]: | ||||
"""List content missing from storage based only on sha1. | """List content missing from storage based only on sha1. | ||||
Args: | Args: | ||||
contents: List of sha1 to check for absence. | contents: List of sha1 to check for absence. | ||||
Returns: | |||||
iterable: missing ids | |||||
Raises: | Raises: | ||||
TODO: an exception when we get a hash collision. | TODO: an exception when we get a hash collision. | ||||
Returns: | |||||
Iterable of missing content ids (sha1) | |||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("content/missing/sha1_git") | @remote_api_endpoint("content/missing/sha1_git") | ||||
def content_missing_per_sha1_git(self, contents): | def content_missing_per_sha1_git( | ||||
self, contents: List[Sha1Git] | |||||
) -> Iterable[Sha1Git]: | |||||
"""List content missing from storage based only on sha1_git. | """List content missing from storage based only on sha1_git. | ||||
Args: | Args: | ||||
contents (List): An iterable of content id (sha1_git) | contents (List): An iterable of content id (sha1_git) | ||||
Yields: | Yields: | ||||
missing contents sha1_git | missing contents sha1_git | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("content/present") | @remote_api_endpoint("content/present") | ||||
def content_find(self, content: Dict[str, Any]) -> List[Content]: | def content_find(self, content: Dict[str, Any]) -> List[Content]: | ||||
"""Find a content hash in db. | """Find a content hash in db. | ||||
Args: | Args: | ||||
▲ Show 20 Lines • Show All 994 Lines • Show Last 20 Lines |