samueldlightfoot commented on code in PR #4178: URL: https://github.com/apache/cassandra/pull/4178#discussion_r2108687192
########## src/java/org/apache/cassandra/io/util/ChannelProxy.java: ########## @@ -40,30 +42,55 @@ */ public final class ChannelProxy extends SharedCloseableImpl { + + public enum IOMode + { + BUFFERED, + DIRECT + } + private final File file; private final String filePath; private final FileChannel channel; - public static FileChannel openChannel(File file) + public static FileChannel openChannel(File file, OpenOption... openOptions) { try { - return FileChannel.open(file.toPath(), StandardOpenOption.READ); + return FileChannel.open(file.toPath(), openOptions); } catch (IOException e) { throw new RuntimeException(e); } } + private static OpenOption[] openOptions(IOMode ioMode) + { + switch (ioMode) + { + case DIRECT: + return new OpenOption[]{ StandardOpenOption.READ, ExtendedOpenOption.DIRECT }; Review Comment: Yes - confirmed with blktrace and async-prof shows bypassing of the page cache. -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org