Page MenuHomeSoftware Heritage

writer: move the InMemoryJournalWriter from swh.storage in swh.journal
ClosedPublic

Authored by douardda on Sep 17 2019, 11:40 AM.

Details

Summary

and put both JournalWriter implementations in a swh.journal.writer package.
Also move the get_journal_writer() function from storage.

Keep a swh.journal.direct_writer module for bw compat.

This prevents a dependecy loop between swh.storage and swh.journal.

Diff Detail

Repository
rDJNL Journal infrastructure
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vlorentz added inline comments.
swh/journal/writer/__init__.py
11

might as well rename it KafkaWriter while we're at it. "direct" was to be opposed to the pg listener and journal publisher, which were both dropped from the codebase, so it no long makes sense.

This revision is now accepted and ready to land.Sep 17 2019, 11:47 AM
ardumont added inline comments.
swh/journal/writer/__init__.py
11

Even JournalWriter directly?
This would be consistent with the in-memory version.

swh/journal/writer/__init__.py
13

I know it's existing stuff we are moving around...
Might as well fix it now though 'Unknown journal writer class'...

This revision now requires changes to proceed.Sep 17 2019, 12:11 PM

writer: rename writer.direct.DirectKafkaWriter as writer.kafka.KafkaJournalWriter

This revision is now accepted and ready to land.Sep 17 2019, 1:28 PM
This revision was automatically updated to reflect the committed changes.