javeme commented on code in PR #2862:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2862#discussion_r2328667470


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/id/IdGenerator.java:
##########
@@ -128,14 +129,19 @@ public static int compareType(Id id1, Id id2) {
     public static class StringId implements Id {
 
         protected String id;
+        protected byte[] bytes;

Review Comment:
   At present, I haven't found any scenarios where this would cause problems. 
It's safe even if multiple assignments occur at the same time.



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/memory/consumer/impl/id/StringIdOffHeap.java:
##########
@@ -70,6 +70,7 @@ public void serializeSelfToByteBuf(MemoryPool memoryPool) {
     @Override
     public void releaseOriginalVarsOnHeap() {
         this.id = null;
+        this.bytes = null;

Review Comment:
   in serializeSelfToByteBuf we can set stringBytes = this.bytes if this.bytes 
!= null



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/id/IdGenerator.java:
##########
@@ -128,14 +129,19 @@ public static int compareType(Id id1, Id id2) {
     public static class StringId implements Id {
 
         protected String id;
+        protected byte[] bytes;
 
         public StringId(String id) {

Review Comment:
   id is null is not allowed in this constructor



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org
For additional commands, e-mail: issues-h...@hugegraph.apache.org

Reply via email to