Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/in_memory.py
Show First 20 Lines • Show All 593 Lines • ▼ Show 20 Lines | def raw_extrinsic_metadata_get_after_date( | ||||
authority_url: str, | authority_url: str, | ||||
after: datetime.datetime, | after: datetime.datetime, | ||||
) -> Iterable[RawExtrinsicMetadataRow]: | ) -> Iterable[RawExtrinsicMetadataRow]: | ||||
metadata = self.raw_extrinsic_metadata_get( | metadata = self.raw_extrinsic_metadata_get( | ||||
target, authority_type, authority_url | target, authority_type, authority_url | ||||
) | ) | ||||
return (m for m in metadata if m.discovery_date > after) | return (m for m in metadata if m.discovery_date > after) | ||||
def raw_extrinsic_metadata_get_after_date_and_fetcher( | def raw_extrinsic_metadata_get_after_date_and_id( | ||||
self, | self, | ||||
target: str, | target: str, | ||||
authority_type: str, | authority_type: str, | ||||
authority_url: str, | authority_url: str, | ||||
after_date: datetime.datetime, | after_date: datetime.datetime, | ||||
after_fetcher_name: str, | after_id: bytes, | ||||
after_fetcher_version: str, | |||||
) -> Iterable[RawExtrinsicMetadataRow]: | ) -> Iterable[RawExtrinsicMetadataRow]: | ||||
metadata = self._raw_extrinsic_metadata.get_from_partition_key((target,)) | metadata = self._raw_extrinsic_metadata.get_from_partition_key((target,)) | ||||
after_tuple = (after_date, after_fetcher_name, after_fetcher_version) | after_tuple = (after_date, after_id) | ||||
return ( | return ( | ||||
m | m | ||||
for m in metadata | for m in metadata | ||||
if m.authority_type == authority_type | if m.authority_type == authority_type | ||||
and m.authority_url == authority_url | and m.authority_url == authority_url | ||||
and (m.discovery_date, m.fetcher_name, m.fetcher_version) > after_tuple | and (m.discovery_date, m.id) > after_tuple | ||||
) | ) | ||||
def raw_extrinsic_metadata_get( | def raw_extrinsic_metadata_get( | ||||
self, target: str, authority_type: str, authority_url: str | self, target: str, authority_type: str, authority_url: str | ||||
) -> Iterable[RawExtrinsicMetadataRow]: | ) -> Iterable[RawExtrinsicMetadataRow]: | ||||
metadata = self._raw_extrinsic_metadata.get_from_partition_key((target,)) | metadata = self._raw_extrinsic_metadata.get_from_partition_key((target,)) | ||||
return ( | return ( | ||||
m | m | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |