Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/cassandra/storage.py
Show First 20 Lines • Show All 341 Lines • ▼ Show 20 Lines | def directory_add(self, directories: List[Directory]) -> Dict: | ||||
{**entry.to_dict(), "directory_id": directory.id} | {**entry.to_dict(), "directory_id": directory.id} | ||||
) | ) | ||||
# 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(directory.id) | self._cql_runner.directory_add_one(directory.id) | ||||
return {"directory:add": len(missing)} | return {"directory:add": len(directories)} | ||||
def directory_missing(self, directories): | 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(self, dentry: DirectoryEntry) -> Dict[str, Any]: | def _join_dentry_to_content(self, dentry: DirectoryEntry) -> Dict[str, Any]: | ||||
keys = ( | keys = ( | ||||
"status", | "status", | ||||
"sha1", | "sha1", | ||||
"sha1_git", | "sha1_git", | ||||
"sha256", | "sha256", | ||||
▲ Show 20 Lines • Show All 879 Lines • Show Last 20 Lines |