-
Notifications
You must be signed in to change notification settings - Fork 521
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(core): edge cache not clear when update or delete associated vertex #1780
Conversation
1. fix the bug when vertex updated, but the edge cache associated with that vertex was not updated. Here we simply clear all edge cache when any vertex changes.
1.add two test case for the fixing
1. fix the bug when vertex updated, but the edge cache associated with that vertex was not updated. Here we simply clear all edge cache when any vertex changes.
Codecov Report
@@ Coverage Diff @@
## master #1780 +/- ##
============================================
+ Coverage 66.86% 70.79% +3.93%
+ Complexity 972 970 -2
============================================
Files 443 443
Lines 37748 37749 +1
Branches 5383 5384 +1
============================================
+ Hits 25240 26726 +1486
+ Misses 9784 8302 -1482
+ Partials 2724 2721 -3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, a little comments for it.
For code style problems, if you use IDEA as your IDE, you can directly import our code style configuration file.
|
||
|
||
@Test | ||
public void testClearEdgeCacheWhenDeleteVertex(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testClearEdgeCacheXx --> testEdgeCacheClearXx
or testEdgeCacheEmptyXx
seems better, same as another test method
// Update edge cache if any vertex or edge change | ||
// for vertex change, the edge associated with that vertex should also be updated | ||
// here we just clear all the edge cache , before we use a more precise strategy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some typo:
- we could use
/* xx */
and let them looks like a paragraph - vertex change --> vertex
changed
- here xx, before xxx -->
Before xx. now we just xx
import com.baidu.hugegraph.structure.HugeEdge; | ||
import com.baidu.hugegraph.structure.HugeVertexProperty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could move the import lines after 35, recommend using our code-style config to avoid these changes~
.idStrategy(IdStrategy.CUSTOMIZE_NUMBER) | ||
.properties("name").nullableKeys("name") | ||
.checkExist(false) | ||
.create(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could keep original format. so as other lines (align lines)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! The code logic looks good, can we adjust the code style?
You can refer to the code style guide: https://github.com/hugegraph/hugegraph-doc/wiki/HugeGraph%E4%BB%A3%E7%A0%81%E9%A3%8E%E6%A0%BC%E6%8C%87%E5%8D%97
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove useless line
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove useless line
} | ||
|
||
@Test | ||
public void testClearEdgeCacheWhenUpdateVertex(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing test cases
format code using hugegraph code style
format code using hugegraph code style
have reformated code style |
/* | ||
* Update edge cache if any vertex or edge changed | ||
* For vertex change, the edges linked with should also be updated | ||
* Before we use a more precise strategy,now we just clear all the edge cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enhance to--> Before we find a more precise strategy, just clear all the edge cache now (expect a space after ,
)
PS: For convenience, u can edit the file directly on github page 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
enhance the comment
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one blank line is ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
remove one blank line
CLA Assistant Lite bot Good! All Contributors have signed the CLA. |
I have read the CLA Document and I hereby sign the CLA |
recheck |
fix #1779