Page MenuHomeSoftware Heritage

Add DirectKafkaWriter, which collaborates with the Storage to write to Kafka.
ClosedPublic

Authored by vlorentz on Apr 1 2019, 3:05 PM.

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

I don't remember what's for. As it's not explained in the diff, i might be offtrack here.

Why don't you open a cli endpoint to make that runnable from there?

Requested change to at least have a docstring explaining this.

Thanks.

swh/journal/direct_writer.py
15

Adding docstring to explain the goal would be nice.

40

for my information, what's the meaning of the _ at the end?

I guess the _ as prefix is for private scope meaning, feel free to correct me ;)

This revision now requires changes to proceed.Apr 2 2019, 12:43 AM
vlorentz marked an inline comment as done.
  • Add docstring to DirectKafkaWriter.
swh/journal/direct_writer.py
40

To avoid name shadowing. This is inspired by the PEP8 recommendation for argument names:

If a function argument's name clashes with a reserved keyword, it is generally better to append a single trailing underscore rather than use an abbreviation or spelling corruption. Thus class_ is better than clss. (Perhaps better is to avoid such clashes by using a synonym.)

Sounds fine.

Maybe wait and adapt for D1329 ;)

swh/journal/direct_writer.py
40

Thanks!

swh/journal/tests/test_direct_writer.py
81

That will break with your change in D1329.

This revision is now accepted and ready to land.Apr 3 2019, 2:13 PM
  • Rebase + add support for origin_visit.
swh/journal/tests/test_direct_writer.py
81

snapshot?

Actually add missing object_type.

This revision was landed with ongoing or failed builds.Apr 4 2019, 12:25 PM
This revision was automatically updated to reflect the committed changes.