Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix weighted shortest path NPE #1250

Merged
merged 4 commits into from
Nov 10, 2020
Merged

Fix weighted shortest path NPE #1250

merged 4 commits into from
Nov 10, 2020

Conversation

zhoney
Copy link
Contributor

@zhoney zhoney commented Nov 10, 2020

No description provided.

Change-Id: Ic0fba1a0dea58b322cf864ac7212e0d311199b6f
Change-Id: I1675790480f5499c076bfea5a0d562261eaa5b68
@zhoney zhoney changed the title Fix wsp npe Fix weighted shortest path NPE Nov 10, 2020
@@ -94,7 +94,7 @@ public String get(@Context GraphManager manager,
sourceId, targetId, dir, edgeLabel, weight,
degree, skipDegree, capacity);
Iterator<Vertex> iterator = QueryResults.emptyIterator();
if (withVertex) {
if (path != null && withVertex) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert path is not empty

@@ -278,7 +278,9 @@ public String writeSimilars(SimilarsMap similars,
@Override
public String writeWeightedPath(NodeWithWeight path,
Iterator<Vertex> vertices) {
return JsonUtil.toJson(ImmutableMap.of("path", path.toMap(),
Map<String, Object> pathMap = path == null?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add space

Change-Id: Ic126213dde571e51f716aa0d2cb5b52d260d7c9d
@codecov
Copy link

codecov bot commented Nov 10, 2020

Codecov Report

Merging #1250 (3189005) into master (645f1a3) will increase coverage by 0.73%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1250      +/-   ##
============================================
+ Coverage     61.67%   62.40%   +0.73%     
- Complexity     5713     5758      +45     
============================================
  Files           374      374              
  Lines         31285    31291       +6     
  Branches       4393     4395       +2     
============================================
+ Hits          19295    19528     +233     
+ Misses        10008     9779     -229     
- Partials       1982     1984       +2     
Impacted Files Coverage Δ Complexity Δ
...a/com/baidu/hugegraph/api/traversers/CountAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ph/api/traversers/SingleSourceShortestPathAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...egraph/api/traversers/WeightedShortestPathAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...com/baidu/hugegraph/serializer/JsonSerializer.java 41.05% <0.00%> (-0.89%) 0.00 <0.00> (ø)
...aidu/hugegraph/backend/store/mysql/MysqlTable.java 81.54% <0.00%> (+0.55%) 96.00% <0.00%> (+1.00%)
...va/com/baidu/hugegraph/task/ServerInfoManager.java 70.78% <0.00%> (+0.56%) 51.00% <0.00%> (+1.00%)
...aidu/hugegraph/backend/tx/AbstractTransaction.java 73.24% <0.00%> (+1.91%) 53.00% <0.00%> (+1.00%)
...u/hugegraph/backend/store/mysql/MysqlSessions.java 68.49% <0.00%> (+2.73%) 27.00% <0.00%> (ø%)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 645f1a3...3189005. Read the comment docs.

javeme
javeme previously approved these changes Nov 10, 2020
Change-Id: I51674d1d2a41f07f6cba025f12f32b0f611fd413
@zhoney zhoney merged commit 2f6147f into master Nov 10, 2020
@zhoney zhoney deleted the fix-WSP-NPE branch November 10, 2020 13:26
tmljob pushed a commit to tmljob/hugegraph that referenced this pull request Dec 10, 2020
* fix NPE of weighted shortest path if no results
* add check for skip degree > 80w
* add NO_LIMIT check in adjacentEdges()
* fix template path error

Change-Id: Ic0fba1a0dea58b322cf864ac7212e0d311199b6f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants