mukul1987 commented on a change in pull request #2303:
URL: https://github.com/apache/ozone/pull/2303#discussion_r682762322
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsUtils.java
##########
@@ -612,4 +615,11 @@ public static String format(List<String> nodes) {
public static long getShutDownTimeOut(ConfigurationSource conf) {
return
conf.getObject(OzoneServiceConfig.class).getServiceShutdownTimeout();
}
+
+ /**
+ * Utility method to round up bytes into the nearest MB.
+ */
+ public static int roundupMb(long bytes) {
+ return Math.toIntExact((bytes - 1) / ONE_MB + 1);
Review comment:
This will always compute to a long, and this will not be a floating
point number. Also I think there should be a utility to perform this.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]