This is an automated email from the ASF dual-hosted git repository. blerer pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/cassandra.git
commit ebce74ee2d186359bbd83c33b96f5b6c3ae1f856 Merge: d389620 be1684b Author: Benjamin Lerer <b.le...@gmail.com> AuthorDate: Thu Oct 14 15:29:37 2021 +0200 Merge branch cassandra-4.0 into trunk CHANGES.txt | 1 + .../apache/cassandra/db/commitlog/CommitLog.java | 31 ++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --cc src/java/org/apache/cassandra/db/commitlog/CommitLog.java index 5f386d1,d18f19b..a4be769 --- a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java +++ b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java @@@ -17,11 -17,9 +17,12 @@@ */ package org.apache.cassandra.db.commitlog; -import java.io.*; + +import java.io.IOException; import java.nio.ByteBuffer; ++import java.nio.file.FileStore; import java.util.*; +import java.util.function.BiPredicate; import java.util.function.Function; import java.util.zip.CRC32; @@@ -41,6 -38,6 +42,7 @@@ import org.apache.cassandra.io.util.Buf import org.apache.cassandra.io.util.DataOutputBuffer; import org.apache.cassandra.io.util.DataOutputBufferFixed; import org.apache.cassandra.io.util.FileUtils; ++import org.apache.cassandra.io.util.PathUtils; import org.apache.cassandra.metrics.CommitLogMetrics; import org.apache.cassandra.net.MessagingService; import org.apache.cassandra.schema.CompressionParams; @@@ -492,6 -488,11 +494,11 @@@ public class CommitLog implements Commi return start().recoverSegmentsOnDisk(); } + public static long freeDiskSpace() + { - return FileUtils.getFreeSpace(new File(DatabaseDescriptor.getCommitLogLocation())); ++ return PathUtils.tryGetSpace(new File(DatabaseDescriptor.getCommitLogLocation()).toPath(), FileStore::getTotalSpace); + } + @VisibleForTesting public static boolean handleCommitError(String message, Throwable t) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org