spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrewor14 <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-8029] Robust shuffle writer
Date Fri, 13 Nov 2015 02:18:21 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message