PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1922187989
##########
hbase-server/src/main/resources/hbase-webapps/master/snapshotsStats.jsp:
##########
@@ -32,6 +32,18 @@
import="org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription"
%>
<%@ page import="org.apache.hadoop.hbase.util.PrettyPrinter" %>
+<%!
+ /**
+ * Note: This method was taken from
org.apache.hadoop.util.StringUtils.humanReadableInt(long).
+ * Given an integer, return a string that is in an approximate, but human
+ * readable format.
+ * @param number the number to format
+ * @return a human readable form of the integer
+ */
+ private static String humanReadableInt(long number) {
+ return StringUtils.TraditionalBinaryPrefix.long2String(number, "", 1);
+ }
Review Comment:
Should I maybe rather extract this method to a util class as it is now
duplicated in these 2 JSP files?
Maybe it can be extracted to `org.apache.hadoop.hbase.util.Strings` util
class.
What do you think?
--
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]