Skip to content

Commit 379567f

Browse files
jerryshaomateiz
authored andcommitted
fix block manager UI display issue when enable spark.cleaner.ttl
Conflicts: core/src/main/scala/spark/storage/StorageUtils.scala
1 parent 2462b40 commit 379567f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

core/src/main/scala/spark/storage/StorageUtils.scala

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,19 @@ object StorageUtils {
5151

5252
// For each RDD, generate an RDDInfo object
5353
groupedRddBlocks.map { case(rddKey, rddBlocks) =>
54-
5554
// Add up memory and disk sizes
5655
val memSize = rddBlocks.map(_.memSize).reduce(_ + _)
5756
val diskSize = rddBlocks.map(_.diskSize).reduce(_ + _)
5857

5958
// Find the id of the RDD, e.g. rdd_1 => 1
6059
val rddId = rddKey.split("_").last.toInt
6160
// Get the friendly name for the rdd, if available.
62-
val rdd = sc.persistentRdds(rddId)
63-
val rddName = Option(rdd.name).getOrElse(rddKey)
64-
val rddStorageLevel = rdd.getStorageLevel
65-
66-
RDDInfo(rddId, rddName, rddStorageLevel, rddBlocks.length, rdd.partitions.size, memSize, diskSize)
67-
}.toArray
61+
sc.persistentRdds.get(rddId).map { r =>
62+
val rddName = Option(r.name).getOrElse(rddKey)
63+
val rddStorageLevel = r.getStorageLevel
64+
RDDInfo(rddId, rddName, rddStorageLevel, rddBlocks.length, r.partitions.size, memSize, diskSize)
65+
}
66+
}.flatMap(x => x).toArray.sortBy(_.id)
6867
}
6968

7069
/* Removes all BlockStatus object that are not part of a block prefix */

0 commit comments

Comments
 (0)