You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/08 11:01:14 UTC

[GitHub] [spark] dtarima commented on a change in pull request #33251: [SPARK-36036] [CORE] Fix cleanup of DownloadFile resources.

dtarima commented on a change in pull request #33251:
URL: https://github.com/apache/spark/pull/33251#discussion_r666090966



##########
File path: common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/DownloadFile.java
##########
@@ -27,12 +27,10 @@
  */
 public interface DownloadFile {
   /**
-   * Delete the file.
-   *
-   * @return  <code>true</code> if and only if the file or directory is
-   *          successfully deleted; <code>false</code> otherwise
+   * Creates a new {@link DownloadFileDeleter} for the underlying resources of
+   * the {@link DownloadFile}.
    */
-  boolean delete();
+  DownloadFileDeleter deleter();

Review comment:
       Yes, that's a good alternative, but in this case we'd have to deal with `throws Exception` in its signature.
   The client side would look like this then:
   ```
     try {
       targetFile.deleter().call();
     } catch (Exception e) {
       throw new IOException("Failed to delete file", e);
     }
   ```
   Is there a different `Callable` interface without checked `Exception` declaration?




-- 
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: reviews-unsubscribe@spark.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org