jacek-lewandowski commented on code in PR #2064:
URL: https://github.com/apache/cassandra/pull/2064#discussion_r1082688742


##########
src/java/org/apache/cassandra/io/sstable/format/SSTableReaderBuilder.java:
##########
@@ -395,12 +393,13 @@ void load(boolean recreateBloomFilter,
                   StatsMetadata statsMetadata,
                   Set<Component> components) throws IOException
         {
-            try (FileHandle.Builder ibuilder = new 
FileHandle.Builder(descriptor.filenameFor(Component.PRIMARY_INDEX))
-                                               
.mmapped(DatabaseDescriptor.getIndexAccessMode() == Config.DiskAccessMode.mmap)
-                                               
.withChunkCache(ChunkCache.instance);
-                 FileHandle.Builder dbuilder = new 
FileHandle.Builder(descriptor.filenameFor(Component.DATA)).mmapped(DatabaseDescriptor.getDiskAccessMode()
 == Config.DiskAccessMode.mmap)
-                                                                               
                              .withChunkCache(ChunkCache.instance))
+            try
             {
+                FileHandle.Builder ibuilder = new 
FileHandle.Builder(descriptor.fileFor(Component.PRIMARY_INDEX))

Review Comment:
   What do you think about instead of managing it in a builder, creating a 
method in `FileHandle`, something like 
`duplicateWithExtendedLength(CompressionMetadata, long)`, which retrieves 
regions from the current rebufferer if applicable (or we could keep mmapped  
regions as a field in `FileHandle`)?
   
   This way, it should be super clear - we create a copy of regions when we 
really copy a file handle



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