zongtanghu commented on a change in pull request #1144: [RIP-7] Fix some issue
and Optimization code for multiple_disk_dir
URL: https://github.com/apache/rocketmq/pull/1144#discussion_r351570657
##########
File path: common/src/main/java/org/apache/rocketmq/common/UtilAll.java
##########
@@ -220,6 +222,36 @@ public static double
getDiskPartitionSpaceUsedPercent(final String path) {
return -1;
}
+// public static double getMaxDiskPartitionSpaceUsedPercent(final String
paths) {
+// if (null == paths || paths.isEmpty()) {
+// return -1;
+// }
+//
+// String[] pathArr = paths.trim().split(";");
+// try {
+//
+// double maxUsedPercent = 0;
+// for (int i = 0; i < pathArr.length; i++) {
+// File file = new File(pathArr[i]);
+// if (!file.exists()) {
+// continue;
+// }
+// long totalSpace = file.getTotalSpace();
+// long freeSpace = file.getFreeSpace();
+// double usedPercent = (totalSpace - freeSpace) / (double)
totalSpace;
+// if (usedPercent > maxUsedPercent) {
+// maxUsedPercent = usedPercent;
+// }
+// }
+// return maxUsedPercent;
+// } catch (Exception e) {
+// return -1;
+// }
+// }
+
+
+
+
Review comment:
Why do you add code annotation in this place.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services