Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/cassandra/cql.py
Show All 40 Lines | from swh.model.model import ( | ||||
SkippedContent, | SkippedContent, | ||||
OriginVisit, | OriginVisit, | ||||
OriginVisitStatus, | OriginVisitStatus, | ||||
Origin, | Origin, | ||||
) | ) | ||||
from .common import Row, TOKEN_BEGIN, TOKEN_END, hash_url | from .common import Row, TOKEN_BEGIN, TOKEN_END, hash_url | ||||
from .schema import CREATE_TABLES_QUERIES, HASH_ALGORITHMS | from .schema import CREATE_TABLES_QUERIES, HASH_ALGORITHMS | ||||
from .. import extrinsic_metadata | |||||
logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||
_execution_profiles = { | _execution_profiles = { | ||||
EXEC_PROFILE_DEFAULT: ExecutionProfile( | EXEC_PROFILE_DEFAULT: ExecutionProfile( | ||||
load_balancing_policy=TokenAwarePolicy(DCAwareRoundRobinPolicy()) | load_balancing_policy=TokenAwarePolicy(DCAwareRoundRobinPolicy()) | ||||
▲ Show 20 Lines • Show All 859 Lines • ▼ Show 20 Lines | ): | ||||
authority_url, | authority_url, | ||||
discovery_date, | discovery_date, | ||||
fetcher_name, | fetcher_name, | ||||
fetcher_version, | fetcher_version, | ||||
format, | format, | ||||
metadata, | metadata, | ||||
] | ] | ||||
params.extend( | |||||
context.get(key) for key in extrinsic_metadata.CONTEXT_KEYS[object_type] | |||||
) | |||||
return self._execute_with_retries(statement, params,) | return self._execute_with_retries(statement, params,) | ||||
@_prepared_statement( | @_prepared_statement( | ||||
"SELECT * from object_metadata " | "SELECT * from object_metadata " | ||||
"WHERE id=? AND authority_url=? AND discovery_date>? AND authority_type=?" | "WHERE id=? AND authority_url=? AND discovery_date>? AND authority_type=?" | ||||
) | ) | ||||
def object_metadata_get_after_date( | def object_metadata_get_after_date( | ||||
self, | self, | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |