blambov commented on code in PR #2064:
URL: https://github.com/apache/cassandra/pull/2064#discussion_r1072011575


##########
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:
   `FileHandleBuilder` being closeable always annoyed me; I do prefer to make 
it a trivial builder that cannot fail or that doesn't manage any state. 
However, we will have to manage that state explicitly in its users 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: [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