Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private[deploy] object DeployMessages {
assert (port > 0)

def uri: String = "spark://" + host + ":" + port
def restUri: Option[String] = restPort.map { p => "spark://" + host + ":" + p }
def restUri: Option[String] = restPort.map { p => "http://" + host + ":" + p }
}

// WorkerWebUI to Worker
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/scala/org/apache/spark/deploy/JsonProtocol.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ private[deploy] object JsonProtocol {

def writeMasterState(obj: MasterStateResponse): JObject = {
("url" -> obj.uri) ~
("workers" -> obj.workers.toList.map(writeWorkerInfo)) ~
("cores" -> obj.workers.map(_.cores).sum) ~
("coresused" -> obj.workers.map(_.coresUsed).sum) ~
("memory" -> obj.workers.map(_.memory).sum) ~
("memoryused" -> obj.workers.map(_.memoryUsed).sum) ~
("workers" -> obj.workers.filter(_.isAlive()).toList.map(writeWorkerInfo)) ~
("cores" -> obj.workers.filter(_.isAlive()).map(_.cores).sum) ~
("coresused" -> obj.workers.filter(_.isAlive()).map(_.coresUsed).sum) ~
("memory" -> obj.workers.filter(_.isAlive()).map(_.memory).sum) ~
("memoryused" -> obj.workers.filter(_.isAlive()).map(_.memoryUsed).sum) ~
("activeapps" -> obj.activeApps.toList.map(writeApplicationInfo)) ~
("completedapps" -> obj.completedApps.toList.map(writeApplicationInfo)) ~
("activedrivers" -> obj.activeDrivers.toList.map(writeDriverInfo)) ~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,8 @@ private[spark] class WorkerInfo(
def setState(state: WorkerState.Value): Unit = {
this.state = state
}

def isAlive(): Boolean={
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add spaces before and after the =

this.state == WorkerState.ALIVE
}
}