Ngone51 commented on a change in pull request #32007:
URL: https://github.com/apache/spark/pull/32007#discussion_r637978835
##########
File path: core/src/main/scala/org/apache/spark/storage/DiskBlockManager.scala
##########
@@ -83,6 +105,35 @@ private[spark] class DiskBlockManager(conf: SparkConf,
deleteFilesOnStop: Boolea
def getFile(blockId: BlockId): File = getFile(blockId.name)
+ /**
+ * This should be in sync with
+ * @see
[[org.apache.spark.network.shuffle.RemoteBlockPushResolver#getFile(java.lang.String,
+ * java.lang.String)]]
+ */
+ def getMergedShuffleFile(blockId: BlockId): File = {
+ blockId match {
+ case mergedBlockId: ShuffleMergedBlockId =>
+ getMergedShuffleFile(mergedBlockId.name)
+ case mergedIndexBlockId: ShuffleMergedIndexBlockId =>
+ getMergedShuffleFile(mergedIndexBlockId.name)
+ case mergedMetaBlockId: ShuffleMergedMetaBlockId =>
+ getMergedShuffleFile(mergedMetaBlockId.name)
+ case _ =>
+ throw new IllegalArgumentException(
+ s"Only merged block ID is supported, but got $blockId")
+ }
+ }
+
+ private def getMergedShuffleFile(filename: String): File = {
+ if (activeMergedShuffleDirs.isEmpty) {
+ throw new IllegalArgumentException(
+ s"Cannot read $filename because active merged shuffle dirs is empty")
+ }
+ val localDirsForMergedShuffleBlock = activeMergedShuffleDirs.map(_.getPath)
+ ExecutorDiskUtils.getFile(localDirsForMergedShuffleBlock,
subDirsPerLocalDir, filename)
+ }
+
+
Review comment:
nit: redundant blank line.
--
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]