Skip to content
Snippets Groups Projects
Commit c7628771 authored by meiyoula's avatar meiyoula Committed by Josh Rosen
Browse files

[SPARK-4792] Add error message when making local dir unsuccessfully

Author: meiyoula <1039320815@qq.com>

Closes #3635 from XuTingjun/master and squashes the following commits:

dd1c66d [meiyoula] when old is deleted, it will throw an exception where call it
2a55bc2 [meiyoula] Update DiskBlockManager.scala
1483a4a [meiyoula] Delete multiple retries to make dir
67f7902 [meiyoula] Try some times to make dir maybe more reasonable
1c51a0c [meiyoula] Update DiskBlockManager.scala
parent 81112e4b
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
package org.apache.spark.storage package org.apache.spark.storage
import java.io.File import java.io.{IOException, File}
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.{Date, Random, UUID} import java.util.{Date, Random, UUID}
...@@ -71,7 +71,9 @@ private[spark] class DiskBlockManager(blockManager: BlockManager, conf: SparkCon ...@@ -71,7 +71,9 @@ private[spark] class DiskBlockManager(blockManager: BlockManager, conf: SparkCon
old old
} else { } else {
val newDir = new File(localDirs(dirId), "%02x".format(subDirId)) val newDir = new File(localDirs(dirId), "%02x".format(subDirId))
newDir.mkdir() if (!newDir.exists() && !newDir.mkdir()) {
throw new IOException(s"Failed to create local dir in $newDir.")
}
subDirs(dirId)(subDirId) = newDir subDirs(dirId)(subDirId) = newDir
newDir newDir
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment