Serwios commented on code in PR #18162:
URL: https://github.com/apache/kafka/pull/18162#discussion_r1887282935
##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -572,9 +572,13 @@ public static String formatAddress(String host, Integer
port) {
}
/**
- * Formats a byte number as a human-readable String ("3.2 MB")
- * @param bytes some size in bytes
- * @return
+ * Formats a byte value into a human-readable string with an appropriate
unit
+ * (e.g., "3.2 KB", "1.5 MB", "2.1 GB"). The format includes two decimal
places.
+ *
+ * @param bytes the size in bytes
+ * @return a string representing the size with the appropriate unit (e.g.,
"3.2 KB", "1.5 MB").
+ * If the value is negative, the input is returned as a string
(e.g., "-500").
+ * If the number is too large for the predefined units, the raw
byte value is returned.
Review Comment:
Fixed in next commit
--
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]