samueldlightfoot commented on code in PR #4178:
URL: https://github.com/apache/cassandra/pull/4178#discussion_r2658970626
##########
src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java:
##########
@@ -1402,7 +1418,27 @@ public RandomAccessReader openDataReader()
public RandomAccessReader openDataReaderForScan()
{
- return dfile.createReaderForScan();
+ return openDataReaderForScan(dfile.diskAccessMode());
+ }
+
+ public RandomAccessReader openDataReaderForScan(DiskAccessMode
diskAccessMode)
+ {
+ if (diskAccessMode == dfile.diskAccessMode())
+ {
+ return dfile.createReaderForScan(OnReaderClose.RETAIN_FILE_OPEN);
+ }
+
+ if (diskAccessMode == DiskAccessMode.direct && !directIOSupported)
+ {
+ return dfile.createReaderForScan(OnReaderClose.RETAIN_FILE_OPEN);
+ }
+
+ //noinspection resource - The FileHandle lifecycle is managed by the
returned RandomAccessReader
+ FileHandle dataFile = dfile.toBuilder()
Review Comment:
Added exception handling and resolved two other usages of complete without
handling.
--
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]