Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/cassandra/cql.py
Show First 20 Lines • Show All 1,010 Lines • ▼ Show 20 Lines | ) -> Iterable[RawExtrinsicMetadataRow]: | ||||
self._execute_with_retries( | self._execute_with_retries( | ||||
statement, [target, authority_url, after, authority_type] | statement, [target, authority_url, after, authority_type] | ||||
), | ), | ||||
) | ) | ||||
@_prepared_select_statement( | @_prepared_select_statement( | ||||
RawExtrinsicMetadataRow, | RawExtrinsicMetadataRow, | ||||
"WHERE target=? AND authority_type=? AND authority_url=? " | "WHERE target=? AND authority_type=? AND authority_url=? " | ||||
"AND (discovery_date, fetcher_name, fetcher_version) > (?, ?, ?)", | "AND (discovery_date, id) > (?, ?)", | ||||
) | ) | ||||
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, | |||||
*, | *, | ||||
statement, | statement, | ||||
) -> Iterable[RawExtrinsicMetadataRow]: | ) -> Iterable[RawExtrinsicMetadataRow]: | ||||
return map( | return map( | ||||
RawExtrinsicMetadataRow.from_dict, | RawExtrinsicMetadataRow.from_dict, | ||||
self._execute_with_retries( | self._execute_with_retries( | ||||
statement, | statement, | ||||
[ | [target, authority_type, authority_url, after_date, after_id,], | ||||
target, | |||||
authority_type, | |||||
authority_url, | |||||
after_date, | |||||
after_fetcher_name, | |||||
after_fetcher_version, | |||||
], | |||||
), | ), | ||||
) | ) | ||||
@_prepared_select_statement( | @_prepared_select_statement( | ||||
RawExtrinsicMetadataRow, | RawExtrinsicMetadataRow, | ||||
"WHERE target=? AND authority_url=? AND authority_type=?", | "WHERE target=? AND authority_url=? AND authority_type=?", | ||||
) | ) | ||||
def raw_extrinsic_metadata_get( | def raw_extrinsic_metadata_get( | ||||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |