Skip to content

Commit b252e7a

Browse files
committed
small cleanup of accidental changes
1 parent d1a8c92 commit b252e7a

File tree

14 files changed

+5
-95
lines changed

14 files changed

+5
-95
lines changed

core/src/main/scala/org/apache/spark/deploy/JsonProtocol.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import org.json4s.JsonDSL._
2222
import org.apache.spark.deploy.DeployMessages.{MasterStateResponse, WorkerStateResponse}
2323
import org.apache.spark.deploy.master.{ApplicationInfo, DriverInfo, WorkerInfo}
2424
import org.apache.spark.deploy.worker.ExecutorRunner
25-
import org.json4s._
2625

2726
private[spark] object JsonProtocol {
2827
def writeWorkerInfo(obj: WorkerInfo) = {

core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ package org.apache.spark.deploy.history
1919

2020
import javax.servlet.http.HttpServletRequest
2121

22-
import org.json4s.JValue
23-
import org.json4s.JsonDSL._
24-
2522
import scala.xml.Node
2623

2724
import org.apache.spark.ui.{WebUIPage, UIUtils}

core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ class HistoryServer(
115115
* this UI with the event logs in the provided base directory.
116116
*/
117117
def initialize() {
118-
//earlier handlers take precedence
119118
attachPage(new HistoryPage(this))
120119

121120
val jsonHandler = new JsonRequestHandler(this, securityManager)

core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,13 @@ package org.apache.spark.ui.env
1919

2020
import javax.servlet.http.HttpServletRequest
2121

22-
import org.json4s.{JObject, JValue}
23-
import org.json4s.JsonDSL._
24-
2522
import scala.xml.Node
2623

2724
import org.apache.spark.ui.{UIUtils, WebUIPage}
2825

2926
private[ui] class EnvironmentPage(parent: EnvironmentTab) extends WebUIPage("") {
3027
private val listener = parent.listener
3128

32-
override def renderJson(request: HttpServletRequest): JValue = {
33-
val jvmInfoJson =
34-
("Runtime Information" -> listener.jvmInformation.foldLeft(JObject())(_ ~ _))
35-
val sparkPropertiesJson =
36-
("Spark Properties" -> listener.sparkProperties.foldLeft(JObject())(_ ~ _))
37-
val systemPropertiesJson =
38-
("System Properties" -> listener.systemProperties.foldLeft(JObject())(_ ~ _))
39-
val classPathEntriesJson =
40-
("Classpath Entries" -> listener.classpathEntries.foldLeft(JObject())(_ ~ _))
41-
42-
val environmentJson =
43-
jvmInfoJson ~
44-
sparkPropertiesJson ~
45-
systemPropertiesJson ~
46-
classPathEntriesJson
47-
48-
environmentJson
49-
}
50-
5129
def render(request: HttpServletRequest): Seq[Node] = {
5230
val runtimeInformationTable = UIUtils.listingTable(
5331
propertyHeader, jvmRow, listener.jvmInformation, fixedWidth = true)

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ import org.apache.spark.status.api.ExecutorSummary
2424

2525
import scala.xml.Node
2626

27-
import org.json4s.JValue
28-
import org.json4s.JsonDSL._
29-
3027
import org.apache.spark.ui.{ToolTips, UIUtils, WebUIPage}
3128
import org.apache.spark.util.Utils
3229

@@ -159,6 +156,7 @@ private[ui] class ExecutorsPage(
159156
}
160157

161158
private[spark] object ExecutorsPage {
159+
/** Represent an executor's info as a map given a storage status index */
162160
def getExecInfo(listener: ExecutorsListener, statusId: Int): ExecutorSummary = {
163161
val status = listener.storageStatusList(statusId)
164162
val execId = status.blockManagerId.executorId

core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717

1818
package org.apache.spark.ui.jobs
1919

20-
import org.json4s.{JInt, JNothing, JObject, JString, JValue}
21-
import org.json4s.JsonDSL._
22-
2320
import scala.xml.{Node, NodeSeq}
2421

2522
import javax.servlet.http.HttpServletRequest

core/src/main/scala/org/apache/spark/ui/jobs/AllStagesPage.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ package org.apache.spark.ui.jobs
1919

2020
import javax.servlet.http.HttpServletRequest
2121

22-
import org.apache.spark.util.JsonProtocol
23-
import org.json4s.JValue
24-
import org.json4s.JsonDSL._
25-
2622
import scala.xml.{Node, NodeSeq}
2723

2824
import org.apache.spark.scheduler.Schedulable

core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717

1818
package org.apache.spark.ui.jobs
1919

20-
import org.apache.spark.util.JsonProtocol
21-
import org.json4s.{JNothing, JValue}
22-
import org.json4s.JsonDSL._
23-
2420
import scala.collection.mutable
2521
import scala.xml.{NodeSeq, Node}
2622

core/src/main/scala/org/apache/spark/ui/jobs/PoolPage.scala

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,16 @@ package org.apache.spark.ui.jobs
1919

2020
import javax.servlet.http.HttpServletRequest
2121

22-
import org.apache.spark.util.JsonProtocol
23-
2422
import scala.xml.Node
2523

26-
import org.json4s.JValue
27-
import org.json4s.JsonDSL._
28-
29-
import org.apache.spark.scheduler.{Schedulable, StageInfo}
24+
import org.apache.spark.scheduler.StageInfo
3025
import org.apache.spark.ui.{WebUIPage, UIUtils}
3126

3227
/** Page showing specific pool details */
3328
private[ui] class PoolPage(parent: StagesTab) extends WebUIPage("pool") {
3429
private val sc = parent.sc
3530
private val listener = parent.listener
3631

37-
override def renderJson(request: HttpServletRequest): JValue = {
38-
listener.synchronized {
39-
val poolName = request.getParameter("poolname")
40-
val poolToActiveStages = listener.poolToActiveStages
41-
val activeStages = poolToActiveStages.get(poolName) match {
42-
case Some(s) => s.values.map {
43-
case info: StageInfo =>
44-
JsonProtocol.stageInfoToJson(info)
45-
}
46-
case None => Seq[JValue]()
47-
}
48-
49-
val pools:Option[Schedulable] = sc.flatMap{_.getPoolForName(poolName)}
50-
51-
val poolListJson =
52-
pools.map { schedulable =>
53-
("Pool Name" -> schedulable.name) ~
54-
("Minimum Share" -> schedulable.minShare) ~
55-
("Pool Weight" -> schedulable.weight) ~
56-
("Active Stages" -> activeStages) ~
57-
("Running Tasks" -> schedulable.runningTasks) ~
58-
("Scheduling Mode" -> schedulable.schedulingMode.toString)
59-
}
60-
61-
poolListJson
62-
}
63-
}
64-
6532
def render(request: HttpServletRequest): Seq[Node] = {
6633
listener.synchronized {
6734
val poolName = request.getParameter("poolname")

core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,9 @@ import org.apache.commons.lang3.StringEscapeUtils
2626

2727
import org.apache.spark.executor.TaskMetrics
2828
import org.apache.spark.scheduler.{AccumulableInfo, TaskInfo}
29-
30-
import org.json4s.{JNothing, JValue}
31-
3229
import org.apache.spark.ui.{ToolTips, WebUIPage, UIUtils}
3330
import org.apache.spark.ui.jobs.UIData._
34-
import org.apache.spark.util.{JsonProtocol, Utils, Distribution}
31+
import org.apache.spark.util.{Utils, Distribution}
3532

3633
/** Page showing statistics and task list for a given stage */
3734
private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {

0 commit comments

Comments
 (0)