Skip to content

Commit 21e0f77

Browse files
andrewor14pwendell
authored andcommitted
[SPARK-2307] SparkUI - storage tab displays incorrect RDDs
The issue here is that the `StorageTab` listens for updates from the `StorageStatusListener`, but when a block is kicked out of the cache, `StorageStatusListener` removes it from its list. Thus, there is no way for the `StorageTab` to know whether a block has been dropped. This issue was introduced in #1080, which was itself a bug fix. Here we revert that PR and offer a different fix for the original bug (SPARK-2144). Author: Andrew Or <[email protected]> Closes #1249 from andrewor14/storage-ui-fix and squashes the following commits: af019ce [Andrew Or] Fix SPARK-2307
1 parent 18f29b9 commit 21e0f77

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

core/src/main/scala/org/apache/spark/storage/StorageStatusListener.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ class StorageStatusListener extends SparkListener {
3737
val filteredStatus = storageStatusList.find(_.blockManagerId.executorId == execId)
3838
filteredStatus.foreach { storageStatus =>
3939
updatedBlocks.foreach { case (blockId, updatedStatus) =>
40-
if (updatedStatus.storageLevel == StorageLevel.NONE) {
41-
storageStatus.blocks.remove(blockId)
42-
} else {
43-
storageStatus.blocks(blockId) = updatedStatus
44-
}
40+
storageStatus.blocks(blockId) = updatedStatus
4541
}
4642
}
4743
}

core/src/main/scala/org/apache/spark/ui/exec/ExecutorsPage.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletRequest
2121

2222
import scala.xml.Node
2323

24+
import org.apache.spark.storage.StorageLevel
2425
import org.apache.spark.ui.{WebUIPage, UIUtils}
2526
import org.apache.spark.util.Utils
2627

@@ -107,7 +108,9 @@ private[ui] class ExecutorsPage(parent: ExecutorsTab) extends WebUIPage("") {
107108
val status = listener.storageStatusList(statusId)
108109
val execId = status.blockManagerId.executorId
109110
val hostPort = status.blockManagerId.hostPort
110-
val rddBlocks = status.blocks.size
111+
val rddBlocks = status.blocks.count { case (_, blockStatus) =>
112+
blockStatus.storageLevel != StorageLevel.NONE
113+
}
111114
val memUsed = status.memUsed
112115
val maxMem = status.maxMem
113116
val diskUsed = status.diskUsed

0 commit comments

Comments
 (0)