Page MenuHomeSoftware Heritage

Make OriginIndexer call storage.origin_get a single time for all origins.
ClosedPublic

Authored by vlorentz on Feb 6 2019, 5:03 PM.

Diff Detail

Repository
rDCIDX Object indexer
Branch
OriginIndexer-origin_get-single-query
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 4105
Build 5402: tox-on-jenkinsJenkins
Build 5401: arc lint + arc unit

Event Timeline

vlorentz created this revision.Feb 6 2019, 5:03 PM
douardda requested changes to this revision.Feb 7 2019, 10:04 AM
douardda added a subscriber: douardda.

I see no link between this hunk and the diff's title. Did I miss something?
BTW, I do prefer the version before the diff: easier to read.

This revision now requires changes to proceed.Feb 7 2019, 10:04 AM

I see no link between this hunk and the diff's title. Did I miss something?
BTW, I do prefer the version before the diff: easier to read.

Ok I spoke a bit too fast. This does indeed what it pretends. But it's a bit cryptic as is. The 'double loop' on ids is confusing (zip + list comprehension).

vlorentz updated this revision to Diff 3428.Feb 7 2019, 10:37 AM
  • Make the code more readable.
ardumont requested changes to this revision.Feb 7 2019, 10:47 AM
ardumont added a subscriber: ardumont.
ardumont added inline comments.
swh/indexer/indexer.py
582

You do not need the zip call, you can use origin['id'].

that might also avoid any problem in regards of inconsistency regarding the list's order

This revision now requires changes to proceed.Feb 7 2019, 10:47 AM
vlorentz marked an inline comment as done.Feb 7 2019, 12:28 PM
vlorentz added inline comments.
swh/indexer/indexer.py
582

origin can be None.

ardumont accepted this revision.Feb 7 2019, 3:00 PM
ardumont added inline comments.
swh/indexer/indexer.py
582

ok, so the zip call is for logging the missing origin id.

vlorentz marked 2 inline comments as done.Feb 7 2019, 3:39 PM
douardda accepted this revision.Feb 7 2019, 4:43 PM
This revision is now accepted and ready to land.Feb 7 2019, 4:43 PM
vlorentz updated this revision to Diff 3476.Feb 8 2019, 10:32 AM
  • rebase
This revision was automatically updated to reflect the committed changes.