Page MenuHomeSoftware Heritage

Large unreviewable swh-graph refactor
ClosedPublic

Authored by seirl on Thu, Sep 3, 10:18 PM.

Details

Summary

I don't expect this to be entirely reviewed, but it's basically doing
this:

  1. reorganizing a ton of classes in better folders
  2. inlining classes that are only used at a single place
  3. replacing wrappers by more idiomatic versions like the Neighbors class
  4. rewriting the Graph class to avoid passing booleans around on whether to work on the transpose version or not

It simplifies the java api a lot, e.g:

before: algo(graph, useTransposed=True), after: algo(graph.transpose()) (same performance)
before: new Neighbors(graph, allowedEdges, id), after: graph.successors(id, allowedEdges)

Test Plan

make test

Diff Detail

Repository
rDGRPH Graph service
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

seirl created this revision.Thu, Sep 3, 10:18 PM

Build is green

Patch application report for D3878 (id=13676)

Rebasing onto 2bbfbd8500...

Current branch diff-target is up to date.
Changes applied before test
commit 6fc7487f0c5b60c7af7e3bacfadc4f3205abc68b
Author: Antoine Pietri <antoine.pietri1@gmail.com>
Date:   Thu Sep 3 22:10:55 2020 +0200

    java: large refactor, move classes around and remove Neighbors

commit 23832653e04f16ff7245219674b959c25f3d4e57
Author: Antoine Pietri <antoine.pietri1@gmail.com>
Date:   Thu Sep 3 17:02:00 2020 +0200

    java: refactor Graph to extend ImmutableGraph

See https://jenkins.softwareheritage.org/job/DGRPH/job/tests-on-diff/21/ for more details.

vlorentz added inline comments.
java/pom.xml
104–108 ↗(On Diff #13676)

what is this for?

seirl updated this revision to Diff 13677.Thu, Sep 3, 10:35 PM

Fix useless dependency

seirl marked an inline comment as done.Thu, Sep 3, 10:36 PM
seirl added inline comments.
java/pom.xml
104–108 ↗(On Diff #13676)

Fixed

Build is green

Patch application report for D3878 (id=13677)

Rebasing onto 2bbfbd8500...

Current branch diff-target is up to date.
Changes applied before test
commit 8fe92cb8d2082aa7290e5857a7f875191d6cdc8d
Author: Antoine Pietri <antoine.pietri1@gmail.com>
Date:   Thu Sep 3 22:10:55 2020 +0200

    java: large refactor, move classes around and remove Neighbors

commit df3ee47706e9dc9448873ca16b8c4f462e4af418
Author: Antoine Pietri <antoine.pietri1@gmail.com>
Date:   Thu Sep 3 17:02:00 2020 +0200

    java: refactor Graph to extend ImmutableGraph

See https://jenkins.softwareheritage.org/job/DGRPH/job/tests-on-diff/22/ for more details.

haltode accepted this revision.Thu, Sep 3, 10:53 PM
haltode added a subscriber: haltode.

This is a "light" approval since I did not get to play with the diff/code locally, but it's pretty good-looking! \o/

This revision is now accepted and ready to land.Thu, Sep 3, 10:53 PM
This revision was automatically updated to reflect the committed changes.
seirl marked an inline comment as done.