-
Notifications
You must be signed in to change notification settings - Fork 504
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
Reduce the storage of vertex/edge id #661
Conversation
Codecov Report
@@ Coverage Diff @@
## master #661 +/- ##
============================================
- Coverage 72.96% 72.35% -0.61%
- Complexity 3944 4400 +456
============================================
Files 219 220 +1
Lines 17867 19474 +1607
Branches 2569 3021 +452
============================================
+ Hits 13036 14091 +1055
- Misses 3489 3984 +495
- Partials 1342 1399 +57
Continue to review full report at Codecov.
|
Change-Id: I374deb904ae8ca20b5768ebc7976f831ec558e3e
Change-Id: I5a2647820a8931644526ae3f6b828556211eaf02
fd66c40
to
9224f6e
Compare
Change-Id: I65f061c47a1de58197abbb642e0c4524c08481e6
@@ -85,7 +85,7 @@ public void primaryKeys(Id... ids) { | |||
|
|||
Builder useCustomizeNumberId(); | |||
|
|||
Builder useCustomizeUUid(); |
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.
I think UUID is ok
private static final String NUMBER_PREFIX = "L"; | ||
private static final String STRING_PREFIX = "S"; | ||
public static String writeStoredString(Id id) { | ||
String string; |
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.
rename to idContent or idString
@@ -132,14 +133,12 @@ public String asString() { | |||
this.cache = SplicingIdGenerator.concat( | |||
IdUtil.writeString(this.ownerVertexId), | |||
this.direction.type().string(), | |||
this.edgeLabelId.asString(), | |||
this.sortValues, | |||
IdUtil.writeLong(this.edgeLabelId), this.sortValues, |
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.
let this.sortValues in an single line is more clear
IdUtil.writeString(this.otherVertexId)); | ||
} else { | ||
this.cache = SplicingIdGenerator.concat( | ||
IdUtil.writeString(this.sourceVertexId()), | ||
this.edgeLabelId.asString(), | ||
this.sortValues, | ||
IdUtil.writeLong(this.edgeLabelId), this.sortValues, |
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.
ditto
EdgeId eid = (EdgeId) id; | ||
return SplicingIdGenerator.concat( | ||
IdUtil.writeStoredString(eid.sourceVertexId()), | ||
IdGenerator.asStoredString(eid.edgeLabelId()), eid.sortValues(), |
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.
ditto
EDGE; | ||
|
||
public char prefix() { | ||
return this.name().charAt(0); |
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.
handle UNKNOWN and UUID
Change-Id: I9962b0b1c45676e96b06ea9b85fcb7073c05c6bf
Change-Id: I374deb904ae8ca20b5768ebc7976f831ec558e3e