You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/11/28 03:09:32 UTC

[GitHub] [rocketmq] zongtanghu commented on a change in pull request #1144: [RIP-7] Fix some issue and Optimization code for multiple_disk_dir

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_r351576142
 
 

 ##########
 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:
   If this method isn't necessary,you can remove it! @wangshaojie4039 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services