Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/cassandra/model.py
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | class BaseRow: | ||||
def to_dict(self) -> Dict[str, Any]: | def to_dict(self) -> Dict[str, Any]: | ||||
return dataclasses.asdict(self) | return dataclasses.asdict(self) | ||||
@dataclasses.dataclass | @dataclasses.dataclass | ||||
class ContentRow(BaseRow): | class ContentRow(BaseRow): | ||||
TABLE = "content" | TABLE = "content" | ||||
PARTITION_KEY: ClassVar[Tuple[str, ...]] = ( | PARTITION_KEY: ClassVar[Tuple[str, ...]] = ("sha256",) | ||||
CLUSTERING_KEY = ( | |||||
"sha1", | "sha1", | ||||
"sha1_git", | "sha1_git", | ||||
"sha256", | |||||
"blake2s256", | "blake2s256", | ||||
) | ) | ||||
sha1: bytes | sha1: bytes | ||||
sha1_git: bytes | sha1_git: bytes | ||||
sha256: bytes | sha256: bytes | ||||
blake2s256: bytes | blake2s256: bytes | ||||
length: int | length: int | ||||
▲ Show 20 Lines • Show All 252 Lines • Show Last 20 Lines |