bbeaudreault commented on code in PR #5192:
URL: https://github.com/apache/hbase/pull/5192#discussion_r1172469067
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottlingException.java:
##########
@@ -130,10 +130,19 @@ public static void throwWriteCapacityUnitExceeded(final
long waitInterval)
private static void throwThrottlingException(final Type type, final long
waitInterval)
throws RpcThrottlingException {
- String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT +
StringUtils.formatTime(waitInterval);
+ String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT +
stringFromMillis(waitInterval);
throw new RpcThrottlingException(type, waitInterval, msg);
}
+ private static String stringFromMillis(long millis) {
+ if (millis >= 1000) {
+ return StringUtils.formatTime(millis);
Review Comment:
Actually, I realize this will continue to be misleading for values greater
than 1s. For example 1.9s is almost double what would be shown by formatTime.
It matters less for values in the 10s of seconds or higher, but I think it will
be very common to have values mostly in the single digit seconds.
We could copy the impl of formatTime here and add ms, or use the existing
formatTime and append a ms part, or look for a different "humanize"
method/library (as long as it's already a dep)
--
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]