samueldlightfoot commented on code in PR #4178:
URL: https://github.com/apache/cassandra/pull/4178#discussion_r2111198700


##########
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:
   Thanks for the links. This definitely seems applicable to the write path, 
but ChannelProxy is for a read only channel, which I do not believe requires 
the O_SYNC flag or similar, as there's no control data to flush.
   
   We will currently still perform compaction writes with buffered IO (for now).



-- 
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

Reply via email to