Skip to content

Commit

Permalink
remove synchronized
Browse files Browse the repository at this point in the history
  • Loading branch information
lianhuiwang committed Dec 2, 2015
1 parent b106cfe commit 47255fa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ private[v1] class ExecutorListResource(ui: SparkUI) {
@GET
def executorList(): Seq[ExecutorSummary] = {
val listener = ui.executorsListener
listener.synchronized {
val storageStatusList = listener.activeStorageStatusList
(0 until storageStatusList.size).map { statusId =>
ExecutorsPage.getExecInfo(listener, statusId, true)
}
val storageStatusList = listener.activeStorageStatusList
(0 until storageStatusList.size).map { statusId =>
ExecutorsPage.getExecInfo(listener, statusId, true)
}
}
}
22 changes: 10 additions & 12 deletions core/src/main/scala/org/apache/spark/ui/exec/ExecutorsPage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,17 @@ private[ui] class ExecutorsPage(
private val listener = parent.listener

def render(request: HttpServletRequest): Seq[Node] = {
listener.synchronized {
val activeStorageStatusList = listener.activeStorageStatusList
val activeExecutorsTable = listingExecTable(activeStorageStatusList, true)
val deadStorageStatusList = listener.deadStorageStatusList
val deadExecutorsTable = listingExecTable(deadStorageStatusList, false)
val content =
<span>
<h4>ActiveExecutors({activeStorageStatusList.size})</h4> {activeExecutorsTable}
<h4>DeadExecutors({deadStorageStatusList.size})</h4> {deadExecutorsTable}
</span>
val activeStorageStatusList = listener.activeStorageStatusList
val activeExecutorsTable = listingExecTable(activeStorageStatusList, true)
val deadStorageStatusList = listener.deadStorageStatusList
val deadExecutorsTable = listingExecTable(deadStorageStatusList, false)
val content =
<span>
<h4>ActiveExecutors({activeStorageStatusList.size})</h4> {activeExecutorsTable}
<h4>DeadExecutors({deadStorageStatusList.size})</h4> {deadExecutorsTable}
</span>

UIUtils.headerSparkPage("Executors", content, parent)
}
UIUtils.headerSparkPage("Executors", content, parent)
}

private def listingExecTable(storageStatusList: Seq[StorageStatus], isActive: Boolean)
Expand Down

0 comments on commit 47255fa

Please sign in to comment.