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 2021/09/22 08:10:39 UTC

[GitHub] [rocketmq] yuz10 commented on a change in pull request #3357: RIP-7 Multiple Directories Storage Support

yuz10 commented on a change in pull request #3357:
URL: https://github.com/apache/rocketmq/pull/3357#discussion_r713696805



##########
File path: broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java
##########
@@ -635,8 +636,16 @@ public SocketAddress getStoreHost() {
     }
 
     private String diskUtil() {
-        String storePathPhysic = this.brokerController.getMessageStoreConfig().getStorePathCommitLog();
-        double physicRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathPhysic);
+        double physicRatio = 100;
+        String storePath = this.brokerController.getMessageStoreConfig().getStorePathCommitLog();
+        if (storePath.contains(MessageStoreConfig.MULTI_PATH_SPLITTER)) {
+            String[] paths = storePath.trim().split(MessageStoreConfig.MULTI_PATH_SPLITTER);
+            for (String storePathPhysic : paths) {
+                physicRatio = Math.min(physicRatio, UtilAll.getDiskPartitionSpaceUsedPercent(storePathPhysic));
+            }
+        } else {
+            physicRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePath);

Review comment:
       this if branch is not necessary, could use the same code with MULTI_PATH branch




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org