You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/03/11 21:40:18 UTC

[GitHub] [beam] kennknowles commented on a change in pull request #12681: reduce disk usage in NativeFileSorter

kennknowles commented on a change in pull request #12681:
URL: https://github.com/apache/beam/pull/12681#discussion_r592741168



##########
File path: sdks/java/extensions/sorter/src/main/java/org/apache/beam/sdk/extensions/sorter/NativeFileSorter.java
##########
@@ -139,6 +139,7 @@ public void add(byte[] key, byte[] value) throws IOException {
       }
     } finally {
       inputStream.close();
+      dataFile.delete();

Review comment:
       So spotbugs is suggesting that you ought to do something like
   
   ```
   if (!dataFile.delete()) {
     // Log a warning? Throw an exception?
   }
   ```

##########
File path: sdks/java/extensions/sorter/src/main/java/org/apache/beam/sdk/extensions/sorter/NativeFileSorter.java
##########
@@ -139,6 +139,7 @@ public void add(byte[] key, byte[] value) throws IOException {
       }
     } finally {
       inputStream.close();
+      dataFile.delete();

Review comment:
       So spotbugs is suggesting that you ought to do something like
   
   ```java
   if (!dataFile.delete()) {
     // Log a warning? Throw an exception?
   }
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org