LantaoJin commented on a change in pull request #29378:
URL: https://github.com/apache/spark/pull/29378#discussion_r467666430
##########
File path: core/src/main/scala/org/apache/spark/storage/DiskBlockManager.scala
##########
@@ -81,17 +99,29 @@ private[spark] class DiskBlockManager(conf: SparkConf,
deleteFilesOnStop: Boolea
new File(subDir, filename)
}
- def getFile(blockId: BlockId): File = getFile(blockId.name)
+ /**
+ * Used only for testing.
+ */
+ private[spark] def getFile(filename: String): File =
+ getFile(localDirs, subDirs, subDirsPerLocalDir, filename)
+
+ def getFile(blockId: BlockId): File = {
+ if (containerDirEnabled && blockId.isTemp) {
+ getFile(containerDirs, subContainerDirs, subDirsPerLocalDir,
blockId.name)
+ } else {
+ getFile(localDirs, subDirs, subDirsPerLocalDir, blockId.name)
+ }
+ }
/** Check if disk block manager has a block. */
def containsBlock(blockId: BlockId): Boolean = {
- getFile(blockId.name).exists()
Review comment:
Now I refactor the test case and remove `def getFile(filename: String)`
now!
----------------------------------------------------------------
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]