HeartSaVioR commented on a change in pull request #28997:
URL: https://github.com/apache/spark/pull/28997#discussion_r449932500
##########
File path: core/src/main/scala/org/apache/spark/storage/DiskBlockManager.scala
##########
@@ -69,9 +70,7 @@ private[spark] class DiskBlockManager(conf: SparkConf,
deleteFilesOnStop: Boolea
old
} else {
val newDir = new File(localDirs(dirId), "%02x".format(subDirId))
- if (!newDir.exists() && !newDir.mkdir()) {
- throw new IOException(s"Failed to create local dir in $newDir.")
- }
+ Files.createDirectory(newDir.toPath)
Review comment:
Yeah, either `exists()` -> `Files.createDirectory` or just
`Files.createDirectories` would do the trick. The side-effect of latter is that
it would also create non-existence parent directories.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]