swh.scrubber.base_checker module#

class swh.scrubber.base_checker.BaseChecker(db: ScrubberDb, config_id: int)[source]#

Bases: ABC

Base Checker class wrapping common features.

property config: ConfigEntry#

Returns a ConfigEntry instance containing checker configuration.

property datastore: Datastore#

Returns a Datastore instance representing the source of data being checked.

property statsd: Statsd#

Returns a Statsd instance to send statsd metrics.

property object_type: ObjectType#

Returns the type of object being checked.

property check_hashes: bool#
property check_references: bool#
abstract run() None[source]#

Run the checker processing, derived classes must implement this method.

class swh.scrubber.base_checker.BasePartitionChecker(db: ScrubberDb, config_id: int, limit: int = 0)[source]#

Bases: BaseChecker

Base class for checkers processing partition of objects.

property nb_partitions: int#

Returns the number of partitions set in configuration.

run() None[source]#

Runs on all objects of object_type in each partition between start_partition_id (inclusive) and end_partition_id (exclusive).

abstract check_partition(object_type: ObjectType, partition_id: int) None[source]#

Abstract method that derived classes must implement to check objects in partition.