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 = ("sha1", "sha1_git", "sha256", "blake2s256") | PARTITION_KEY: ClassVar[Tuple[str, ...]] = ( | ||||
"sha1", | |||||
"sha1_git", | |||||
"sha256", | |||||
"blake2s256", | |||||
) | |||||
sha1: bytes | sha1: bytes | ||||
sha1_git: bytes | sha1_git: bytes | ||||
sha256: bytes | sha256: bytes | ||||
blake2s256: bytes | blake2s256: bytes | ||||
length: int | length: int | ||||
ctime: datetime.datetime | ctime: datetime.datetime | ||||
status: str | status: str | ||||
▲ Show 20 Lines • Show All 239 Lines • Show Last 20 Lines |