Skip to content

Commit

Permalink
[SPARK-22990][CORE] Fix method isFairScheduler in JobsTab and StagesTab
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

In current implementation, the function `isFairScheduler` is always false, since it is comparing String with `SchedulingMode`

Author: Wang Gengliang <[email protected]>

Closes #20186 from gengliangwang/isFairScheduler.
  • Loading branch information
gengliangwang authored and cloud-fan committed Jan 9, 2018
1 parent 68ce792 commit 849043c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions core/src/main/scala/org/apache/spark/ui/jobs/JobsTab.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ private[ui] class JobsTab(parent: SparkUI, store: AppStatusStore)
val killEnabled = parent.killEnabled

def isFairScheduler: Boolean = {
store.environmentInfo().sparkProperties.toMap
.get("spark.scheduler.mode")
.map { mode => mode == SchedulingMode.FAIR }
.getOrElse(false)
store
.environmentInfo()
.sparkProperties
.contains(("spark.scheduler.mode", SchedulingMode.FAIR.toString))
}

def getSparkUser: String = parent.getSparkUser
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/scala/org/apache/spark/ui/jobs/StagesTab.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ private[ui] class StagesTab(val parent: SparkUI, val store: AppStatusStore)
attachPage(new PoolPage(this))

def isFairScheduler: Boolean = {
store.environmentInfo().sparkProperties.toMap
.get("spark.scheduler.mode")
.map { mode => mode == SchedulingMode.FAIR }
.getOrElse(false)
store
.environmentInfo()
.sparkProperties
.contains(("spark.scheduler.mode", SchedulingMode.FAIR.toString))
}

def handleKillRequest(request: HttpServletRequest): Unit = {
Expand Down

0 comments on commit 849043c

Please sign in to comment.