Copilot commented on code in PR #8389:
URL: https://github.com/apache/hbase/pull/8389#discussion_r3455321930
##########
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java:
##########
@@ -116,6 +116,17 @@ public interface MetricsRegionServerWrapper {
*/
long getStoreFileSize();
+ /**
+ * Get the total uncompressed size of the store files this region server is
serving from.
+ */
+ long getStoreFileUncompressedSize();
+
+ /**
+ * Get the compression ratio of store files on this region server. This is
the ratio of compressed
+ * on-disk size to uncompressed data size. Returns 1.0 when there is no data.
+ */
+ double getStoreFileCompressionRatio();
Review Comment:
The Javadoc for the new compression ratio method doesn’t mention that the
“uncompressed” side comes from HFile trailer totalUncompressedBytes (which
excludes index/trailer overhead). As a result, the ratio can be > 1.0 (e.g.
empty HFiles or compression=NONE), so the current wording may mislead operators.
##########
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSource.java:
##########
@@ -244,6 +246,10 @@ public interface MetricsRegionServerSource extends
BaseSource, JvmPauseMonitorSo
String STOREFILE_SIZE_DESC = "Size of storefiles being served.";
String STOREFILE_SIZE_GROWTH_RATE_DESC =
"Bytes per second by which the size of storefiles being served grows.";
+ String STOREFILE_UNCOMPRESSED_SIZE_DESC = "Total uncompressed size of
storefiles being served.";
+ String STOREFILE_COMPRESSION_RATIO_DESC =
+ "Compression ratio of storefiles (compressed/uncompressed). Lower values
indicate better"
+ + " compression. Returns 1.0 when there is no data.";
Review Comment:
The metric description for storeFileCompressionRatio currently implies a
simple compressed/uncompressed ratio, but in practice the numerator includes
full on-disk HFile size (including trailer/index overhead) while the
denominator is trailer totalUncompressedBytes. This can yield ratios > 1.0, so
the description should call that out to avoid confusion.
--
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]