LakshSingla commented on code in PR #13319:
URL: https://github.com/apache/druid/pull/13319#discussion_r1015303484


##########
processing/src/main/java/org/apache/druid/frame/key/RowKey.java:
##########
@@ -109,8 +109,12 @@ public String toString()
     return Arrays.toString(key);
   }
 
-  public int getNumberOfBytes()
+  /**
+   * Estimate number of bytes taken by an object of {@link RowKey}. Only 
returns an estimate and does not account for
+   * platform or JVM specific implementation.
+   */
+  public int estimatedObjectSize()

Review Comment:
   I think we should also append a memory unit to the method name like 
`estimatedObjectSizeBytes`



##########
processing/src/main/java/org/apache/druid/frame/key/RowKey.java:
##########
@@ -109,8 +109,12 @@ public String toString()
     return Arrays.toString(key);
   }
 
-  public int getNumberOfBytes()
+  /**
+   * Estimate number of bytes taken by an object of {@link RowKey}. Only 
returns an estimate and does not account for
+   * platform or JVM specific implementation.
+   */
+  public int estimatedObjectSize()
   {
-    return array().length;
+    return 44 + array().length; // Constant to account for hashcode and object 
overhead

Review Comment:
   ```suggestion
       private static final int OBJECT_OVERHEAD_SIZE_BYTES = 44;
       return OBJECT_OVERHEAD_SIZE_BYTES + array().length; // Constant to 
account for hashcode and object overhead
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to