Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/2852#discussion_r19300885
--- Diff: core/src/main/scala/org/apache/spark/ui/storage/RDDPage.scala ---
@@ -19,16 +19,47 @@ package org.apache.spark.ui.storage
import javax.servlet.http.HttpServletRequest
-import scala.xml.Node
+import scala.xml.{Text, Node}
import org.apache.spark.storage.{BlockId, BlockStatus, StorageStatus,
StorageUtils}
-import org.apache.spark.ui.{WebUIPage, UIUtils}
+import org.apache.spark.ui.{UITableBuilder, UITable, WebUIPage, UIUtils}
import org.apache.spark.util.Utils
/** Page showing storage details for a given RDD */
private[ui] class RDDPage(parent: StorageTab) extends WebUIPage("rdd") {
private val listener = parent.listener
+ private val workerTable: UITable[(Int, StorageStatus)] = {
+ val builder = new UITableBuilder[(Int, StorageStatus)]()
+ import builder._
+ col("Host") { case (_, status) =>
+ s"${status.blockManagerId.host}:${status.blockManagerId.port}"
+ }
+ def getMemUsed(x: (Int, StorageStatus)): String =
x._2.memUsedByRdd(x._1).toString
+ customCol(
+ "Memory usage",
+ sortKey = Some(getMemUsed)) { case (rddId, status) =>
+ val used = Utils.bytesToString(status.memUsedByRdd(rddId))
+ val remaining = Utils.bytesToString(status.memRemaining)
+ Text(s"$used ($remaining Remaining)")
+ }
+ memCol("Disk Usage") { case (rddId, status) =>
status.diskUsedByRdd(rddId) }
+ build
+ }
+
+ val blockTable: UITable[(BlockId, BlockStatus, Seq[String])] = {
--- End diff --
can this one be private? (i haven't looked at the context so maybe you
cannot do that)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]