diff --git a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java index 87af9323df2b39393a0ed6d0653888dd7619ecfd..5462e76bfba38807390236385797b9009763f223 100644 --- a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java +++ b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java @@ -804,13 +804,22 @@ public class DefaultMessageStore implements MessageStore { return this.storeStatsService.toString(); } + private String getStorePathPhysic() { + String storePathPhysic = ""; + if (DefaultMessageStore.this.getMessageStoreConfig().isEnableDLegerCommitLog()) { + storePathPhysic = ((DLedgerCommitLog)DefaultMessageStore.this.getCommitLog()).getdLedgerServer().getdLedgerConfig().getDataStorePath(); + } else { + storePathPhysic = DefaultMessageStore.this.getMessageStoreConfig().getStorePathCommitLog(); + } + return storePathPhysic; + } + @Override public HashMap getRuntimeInfo() { HashMap result = this.storeStatsService.getRuntimeInfo(); { - String storePathPhysic = DefaultMessageStore.this.getMessageStoreConfig().getStorePathCommitLog(); - double physicRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathPhysic); + double physicRatio = UtilAll.getDiskPartitionSpaceUsedPercent(getStorePathPhysic()); result.put(RunningStats.commitLogDiskRatio.name(), String.valueOf(physicRatio)); } @@ -1676,8 +1685,7 @@ public class DefaultMessageStore implements MessageStore { cleanImmediately = false; { - String storePathPhysic = DefaultMessageStore.this.getMessageStoreConfig().getStorePathCommitLog(); - double physicRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathPhysic); + double physicRatio = UtilAll.getDiskPartitionSpaceUsedPercent(getStorePathPhysic()); if (physicRatio > diskSpaceWarningLevelRatio) { boolean diskok = DefaultMessageStore.this.runningFlags.getAndMakeDiskFull(); if (diskok) {