Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/cassandra/storage.py
Show First 20 Lines • Show All 498 Lines • ▼ Show 20 Lines | def directory_add(self, directories: List[Directory]) -> Dict[str, int]: | ||||
raise ValueError( | raise ValueError( | ||||
f"Unexpected value for directory_entries_insert_algo: " | f"Unexpected value for directory_entries_insert_algo: " | ||||
f"{self._directory_entries_insert_algo}" | f"{self._directory_entries_insert_algo}" | ||||
) | ) | ||||
# Add the directory *after* adding all the entries, so someone | # Add the directory *after* adding all the entries, so someone | ||||
# calling snapshot_get_branch in the meantime won't end up | # calling snapshot_get_branch in the meantime won't end up | ||||
# with half the entries. | # with half the entries. | ||||
self._cql_runner.directory_add_one(DirectoryRow(id=directory.id)) | self._cql_runner.directory_add_one( | ||||
DirectoryRow(id=directory.id, raw_manifest=directory.raw_manifest) | |||||
) | |||||
return {"directory:add": len(directories)} | return {"directory:add": len(directories)} | ||||
@timed | @timed | ||||
def directory_missing(self, directories: List[Sha1Git]) -> Iterable[Sha1Git]: | def directory_missing(self, directories: List[Sha1Git]) -> Iterable[Sha1Git]: | ||||
return self._cql_runner.directory_missing(directories) | return self._cql_runner.directory_missing(directories) | ||||
def _join_dentry_to_content( | def _join_dentry_to_content( | ||||
▲ Show 20 Lines • Show All 1,196 Lines • Show Last 20 Lines |