Page MenuHomeSoftware Heritage

swh-graph: refactor algo implementations
ClosedPublic

Authored by haltode on Jul 9 2019, 2:10 PM.

Details

Reviewers
zack
Summary

This is the first part of T1898, refactoring the neighbors traversal code logic
into a custom iterator. Next step is to merge the algorithms into a
Traversal.java (this will be easier to review separately).

Diff Detail

Repository
rDGRPH Compressed graph representation
Branch
code-refactoring
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 6805
Build 9524: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jul 9 2019, 2:51 PM

This is still WIP, the idea is to refactor algo/* class files into a single Traversal.java file. Biggest problem so far is endpoints too specific to simply use dfs/bfs/backtracking interface (eg: visit, leaves).

I think this is good enough for now.

While we are at it, note that in view of T1904 the various methods refactored here will need docstrings (but it can totally wait a separate diff, as this one doesn't make things worse in that respect).

Merged into master to ease further development and integration with others branches. FYI unit tests are not fully updated, I am waiting on some tests for the new node types map for a second refactoring/code cleaning.