Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/in_memory.py
Show First 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | ) -> Iterable[Tuple[int, ContentRow]]: | ||||
(token, row) | (token, row) | ||||
for (token, partition) in self._contents.data.items() | for (token, partition) in self._contents.data.items() | ||||
for (clustering_key, row) in partition.items() | for (clustering_key, row) in partition.items() | ||||
if start <= token <= end | if start <= token <= end | ||||
] | ] | ||||
matches.sort() | matches.sort() | ||||
return matches[0:limit] | return matches[0:limit] | ||||
def content_missing_from_hashes( | |||||
self, contents_hashes: List[Dict[str, bytes]] | |||||
) -> Iterator[Dict[str, bytes]]: | |||||
for content_hashes in contents_hashes: | |||||
if not self.content_get_from_pk(content_hashes): | |||||
yield content_hashes | |||||
########################## | ########################## | ||||
# 'content_by_*' tables | # 'content_by_*' tables | ||||
########################## | ########################## | ||||
def content_missing_by_sha1_git(self, ids: List[bytes]) -> List[bytes]: | def content_missing_by_sha1_git(self, ids: List[bytes]) -> List[bytes]: | ||||
missing = [] | missing = [] | ||||
for id_ in ids: | for id_ in ids: | ||||
if id_ not in self._content_indexes["sha1_git"]: | if id_ not in self._content_indexes["sha1_git"]: | ||||
▲ Show 20 Lines • Show All 501 Lines • Show Last 20 Lines |