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


##########
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:
   Patched by Maxwell in CASSANDRA-20692 - resolving.



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

Reply via email to