petersomogyi commented on code in PR #153:
URL:
https://github.com/apache/hbase-operator-tools/pull/153#discussion_r2410648280
##########
hbase-table-reporter/src/main/java/org/apache/hbase/reporter/TableReporter.java:
##########
@@ -317,55 +314,16 @@ public Thread newThread(Runnable r) {
}
/**
- * This is an estimate of the heap space occupied by a cell. When the cell
is of type
- * {@link HeapSize} we call {@link HeapSize#heapSize()} so cell can give a
correct value. In other
- * cases we just consider the bytes occupied by the cell components ie. row,
CF, qualifier,
- * timestamp, type, value and tags. Note that this can be the JVM heap space
(on-heap) or the OS
- * heap (off-heap)
- * @return estimate of the heap space
+ * Returns the heap space occupied by a cell. If the cell is of type {@link
HeapSize}, calls
+ * {@link HeapSize#heapSize()} to get the value. Otherwise, returns 0. This
value can represent
+ * either JVM heap space (on-heap) or OS heap (off-heap).
+ * @return the heap space used by the cell
*/
public static long estimatedSizeOfCell(final Cell cell) {
- if (cell instanceof HeapSize) {
- return ((HeapSize) cell).heapSize();
+ if (cell != null) {
+ return cell.heapSize();
}
- // TODO: Add sizing of references that hold the row, family, etc., arrays.
- return estimatedSerializedSizeOf(cell);
Review Comment:
Cell implements HeapSize so the `estimatedSerializedSizeOf` is never called.
With this, the removed `cell.getTagsLength();` is not needed anymore.
--
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]