Skip to content

Commit f8b5eaf

Browse files
committed
[SPARK-19824][Core] Standalone master JSON not showing cores for running applications
This fix tries to address the issue raised in SPARK-19824 where the JSON API of the standalone master ("/json") does not show the number of cores for a running (active) application, which is available on the master UI. The reason was that in master UI, `coresGranted` was used: https://github.com/apache/spark/blob/v2.1.0/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala#L220 while in JSON API, the `desc.maxCores` was used. In case there is no limit on `maxCores`, this filed will be missing on JSON API. (Master UI show cores granted so the field is always available). This fix address the discrepancy by changing JSON API to use `coredGranted` so that UI and JSON API are consistent. Signed-off-by: Yong Tang <[email protected]>
1 parent 207067e commit f8b5eaf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private[deploy] object JsonProtocol {
4444
("starttime" -> obj.startTime) ~
4545
("id" -> obj.id) ~
4646
("name" -> obj.desc.name) ~
47-
("cores" -> obj.desc.maxCores) ~
47+
("cores" -> obj.coresGranted) ~
4848
("user" -> obj.desc.user) ~
4949
("memoryperslave" -> obj.desc.memoryPerExecutorMB) ~
5050
("submitdate" -> obj.submitDate.toString) ~

0 commit comments

Comments
 (0)