mike-tr-adamson commented on code in PR #2540:
URL: https://github.com/apache/cassandra/pull/2540#discussion_r1290148714


##########
src/java/org/apache/cassandra/index/sai/disk/v1/sortedterms/SortedTermsWriter.java:
##########
@@ -179,36 +173,29 @@ public void close() throws IOException
     {
         try (IndexOutput output = metadataWriter.builder(componentName))
         {
-            long trieFilePointer = this.trieWriter.complete();
-            SAICodecUtils.writeFooter(trieOutput);
             SAICodecUtils.writeFooter(termsOutput);
-            SortedTermsMeta.write(output, trieFilePointer, pointId, maxLength);
+            SortedTermsMeta.write(output, pointId, maxTermLength);
             // Don't close the offsets writer quietly because of the work it 
does
             // during its close. We need to propagate the error.
             offsetsWriter.close();
         }
         finally
         {
-            FileUtils.closeQuietly(Arrays.asList(trieWriter, trieOutput, 
termsOutput));
+            FileUtils.closeQuietly(termsOutput);

Review Comment:
   Agreed. I have also moved the closing of the `offsetsWriter` into the 
`finally` block because, currently, if the footer write or metadata write 
fails, it doesn't get closed.



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