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


##########
src/java/org/apache/cassandra/io/sstable/format/big/BigTableWriter.java:
##########
@@ -361,22 +357,27 @@ public SSTableReader openEarly()
             long indexFileLength = new 
File(descriptor.filenameFor(Component.PRIMARY_INDEX)).length();
             int indexBufferSize = 
optimizationStrategy.bufferSize(indexFileLength / indexSummary.size());
             ifile = 
iwriter.builder.bufferSize(indexBufferSize).complete(boundary.indexLength);
-            if (compression)
-                dbuilder.withCompressionMetadata(((CompressedSequentialWriter) 
dataFile).open(boundary.dataLength));
+            try (FileHandle.Builder dbuilder = new 
FileHandle.Builder(descriptor.filenameFor(Component.DATA)))

Review Comment:
   Doesn't this disable the only application of the `regions` reuse in the file 
handle builder?



##########
src/java/org/apache/cassandra/utils/Throwables.java:
##########
@@ -189,13 +189,19 @@ public static Throwable perform(Throwable accumulate, 
String filePath, FileOpTyp
     }
 
     public static void closeAndAddSuppressed(@Nonnull Throwable t, 
AutoCloseable... closeables)
+    {
+        closeAndAddSuppressed(t, Arrays.asList(closeables));
+    }
+
+    public static void closeAndAddSuppressed(@Nonnull Throwable t, 
Iterable<AutoCloseable> closeables)
     {
         Preconditions.checkNotNull(t);
         for (AutoCloseable closeable : closeables)
         {
             try
             {
-                closeable.close();
+                if (closeable != null)

Review Comment:
   I guess the comment applies to the method below then, but if we don't change 
it there it would be unexpected to skip here &mdash; unless we make the naming 
very clear about that difference.



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