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

    https://github.com/apache/spark/pull/9610#discussion_r44743641
  
    --- Diff: 
core/src/main/scala/org/apache/spark/shuffle/FileShuffleBlockResolver.scala ---
    @@ -84,17 +86,8 @@ private[spark] class FileShuffleBlockResolver(conf: 
SparkConf)
             Array.tabulate[DiskBlockObjectWriter](numReducers) { bucketId =>
               val blockId = ShuffleBlockId(shuffleId, mapId, bucketId)
               val blockFile = blockManager.diskBlockManager.getFile(blockId)
    -          // Because of previous failures, the shuffle file may already 
exist on this machine.
    -          // If so, remove it.
    -          if (blockFile.exists) {
    -            if (blockFile.delete()) {
    -              logInfo(s"Removed existing shuffle file $blockFile")
    -            } else {
    -              logWarning(s"Failed to remove existing shuffle file 
$blockFile")
    -            }
    -          }
    -          blockManager.getDiskWriter(blockId, blockFile, 
serializerInstance, bufferSize,
    -            writeMetrics)
    +          val tmp = new File(blockFile.getAbsolutePath + "." + 
UUID.randomUUID())
    --- End diff --
    
    why not use your new method `Utils.withTempFile`


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to