Maxwell-Guo commented on code in PR #4178:
URL: https://github.com/apache/cassandra/pull/4178#discussion_r2758362485
##########
src/java/org/apache/cassandra/io/util/FileUtils.java:
##########
@@ -740,14 +741,54 @@ public static void deleteDirectoryIfEmpty(Path path)
throws IOException
}
}
+ public static boolean isDirectIOSupported(File file)
+ {
+ File testFile = null;
+ try
+ {
+ File dir = file.isDirectory() ? file : file.parent();
+ testFile = createTempFile("direct-io-test", ".tmp", dir);
+
+ // Direct IO requires knowing the block size for buffer alignment
+ if (blockSize(testFile) <= 0)
+ return false;
+
+ try (FileChannel channel = FileChannel.open(testFile.toPath(),
Review Comment:
you are right.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]