Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/cassandra/storage.py
Show First 20 Lines • Show All 254 Lines • ▼ Show 20 Lines | ) -> Iterable[bytes]: | ||||
"key_hash should be one of {','.join(DEFAULT_ALGORITHMS)}" | "key_hash should be one of {','.join(DEFAULT_ALGORITHMS)}" | ||||
) | ) | ||||
for content in contents: | for content in contents: | ||||
res = self.content_find(content) | res = self.content_find(content) | ||||
if not res: | if not res: | ||||
yield content[key_hash] | yield content[key_hash] | ||||
def content_missing_per_sha1(self, contents): | def content_missing_per_sha1(self, contents: List[bytes]) -> Iterable[bytes]: | ||||
return self.content_missing([{"sha1": c for c in contents}]) | return self.content_missing([{"sha1": c for c in contents}]) | ||||
def content_missing_per_sha1_git(self, contents): | def content_missing_per_sha1_git(self, contents): | ||||
return self.content_missing( | return self.content_missing( | ||||
[{"sha1_git": c for c in contents}], key_hash="sha1_git" | [{"sha1_git": c for c in contents}], key_hash="sha1_git" | ||||
) | ) | ||||
def content_get_random(self) -> Sha1Git: | def content_get_random(self) -> Sha1Git: | ||||
▲ Show 20 Lines • Show All 964 Lines • Show Last 20 Lines |