Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_backfill.py
Show First 20 Lines • Show All 237 Lines • ▼ Show 20 Lines | journal1 = { | ||||
"auto_flush": False, | "auto_flush": False, | ||||
} | } | ||||
swh_storage_backend_config["journal_writer"] = journal1 | swh_storage_backend_config["journal_writer"] = journal1 | ||||
storage = get_storage(**swh_storage_backend_config) | storage = get_storage(**swh_storage_backend_config) | ||||
# fill the storage and the journal (under prefix1) | # fill the storage and the journal (under prefix1) | ||||
for object_type, objects in TEST_OBJECTS.items(): | for object_type, objects in TEST_OBJECTS.items(): | ||||
method = getattr(storage, object_type + "_add") | method = getattr(storage, object_type + "_add") | ||||
method(objects) | method(objects) | ||||
assert storage.journal_writer is not None | storage.journal_writer.journal.flush() # type: ignore[attr-defined] | ||||
storage.journal_writer.journal.flush() | |||||
# now apply the backfiller on the storage to fill the journal under prefix2 | # now apply the backfiller on the storage to fill the journal under prefix2 | ||||
backfiller_config = { | backfiller_config = { | ||||
"journal_writer": { | "journal_writer": { | ||||
"brokers": [kafka_server], | "brokers": [kafka_server], | ||||
"client_id": "kafka_writer-2", | "client_id": "kafka_writer-2", | ||||
"prefix": prefix2, | "prefix": prefix2, | ||||
"auto_flush": False, | "auto_flush": False, | ||||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |