cloud-fan commented on a change in pull request #24892: [SPARK-25341][Core] 
Support rolling back a shuffle map stage and re-generate the shuffle files
URL: https://github.com/apache/spark/pull/24892#discussion_r297010198
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/storage/DiskBlockManager.scala
 ##########
 @@ -77,7 +77,14 @@ private[spark] class DiskBlockManager(conf: SparkConf, 
deleteFilesOnStop: Boolea
     new File(subDir, filename)
   }
 
-  def getFile(blockId: BlockId): File = getFile(blockId.name)
+  def getFile(blockId: BlockId, shuffleGenerationId: Int = -1): File = {
+    val generationId = if (shuffleGenerationId != -1) {
+      "_" + shuffleGenerationId
+    } else {
+      ""
+    }
+    getFile(blockId.name.replace(".", generationId + "."))
 
 Review comment:
   this looks hacky. Can we do this at the caller side when we need the 
`shuffleGenerationId`? Or we can create a `getFile(shuffleId: Int, 
shuffleGenerationId: Int, ...)` method if there are many callers.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to