Github user jinxing64 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18565#discussion_r126178968
  
    --- Diff: 
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java
 ---
    @@ -151,15 +152,27 @@ private void failRemainingBlocks(String[] 
failedBlockIds, Throwable e) {
         }
       }
     
    +  private static synchronized boolean renameFile(File src, File dest) {
    +    if (dest.exists()) {
    +      if (!dest.delete()) {
    +        return false;
    +      }
    +    }
    +    return src.renameTo(dest);
    +  }
    +
       private class DownloadCallback implements StreamCallback {
     
         private WritableByteChannel channel = null;
         private File targetFile = null;
    +    private File tmpFile = null;
         private int chunkIndex;
     
    -    DownloadCallback(File targetFile, int chunkIndex) throws IOException {
    -      this.targetFile = targetFile;
    -      this.channel = Channels.newChannel(new FileOutputStream(targetFile));
    +    DownloadCallback(int chunkIndex) throws IOException {
    --- End diff --
    
    This is unrelated, just remove a redundant param.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to