Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/replayer/cli.py
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | if exclude_sha1_file: | ||||
def exclude_fn(obj): | def exclude_fn(obj): | ||||
return is_hash_in_bytearray(obj["sha1"], map_, nb_excluded_hashes) | return is_hash_in_bytearray(obj["sha1"], map_, nb_excluded_hashes) | ||||
else: | else: | ||||
exclude_fn = None | exclude_fn = None | ||||
journal_cfg = conf["journal_client"] | journal_cfg = conf["journal_client"] | ||||
journal_cfg.setdefault("cls", "kafka") | journal_cfg.setdefault("cls", "kafka") | ||||
if "error_reporter" in journal_cfg: | |||||
from redis import Redis | |||||
from swh.objstorage.replayer import replay | |||||
replay.REPORTER = Redis(**journal_cfg.pop("error_reporter")).set | |||||
client = get_journal_client( | client = get_journal_client( | ||||
**journal_cfg, stop_after_objects=stop_after_objects, object_types=("content",), | **journal_cfg, stop_after_objects=stop_after_objects, object_types=("content",), | ||||
) | ) | ||||
worker_fn = functools.partial( | worker_fn = functools.partial( | ||||
process_replay_objects_content, | process_replay_objects_content, | ||||
src=objstorage_src, | src=objstorage_src, | ||||
dst=objstorage_dst, | dst=objstorage_dst, | ||||
exclude_fn=exclude_fn, | exclude_fn=exclude_fn, | ||||
Show All 25 Lines |