@@ -25,7 +25,7 @@ import scala.xml.Node
25
25
import akka .pattern .ask
26
26
import org .json4s .JValue
27
27
28
- import org .apache .spark .deploy .JsonProtocol
28
+ import org .apache .spark .deploy .{ ExecutorState , JsonProtocol }
29
29
import org .apache .spark .deploy .DeployMessages .{MasterStateResponse , RequestMasterState }
30
30
import org .apache .spark .deploy .master .ExecutorInfo
31
31
import org .apache .spark .ui .{WebUIPage , UIUtils }
@@ -57,43 +57,58 @@ private[spark] class ApplicationPage(parent: MasterWebUI) extends WebUIPage("app
57
57
})
58
58
59
59
val executorHeaders = Seq (" ExecutorID" , " Worker" , " Cores" , " Memory" , " State" , " Logs" )
60
- val executors = app.executorInfo
61
- val executorTable = UIUtils .listingTable(executorHeaders, executorRow, executors)
60
+ val allExecutors = (app.executors.values ++ app.removedExecutors).toSet.toSeq
61
+ val executors = allExecutors.filter { exec =>
62
+ ! ExecutorState .isFinished(exec.state) || exec.state == ExecutorState .EXITED
63
+ }
64
+ val removedExecutors = allExecutors.diff(executors)
65
+ val executorsTable = UIUtils .listingTable(executorHeaders, executorRow, executors)
66
+ val removedExecutorsTable = UIUtils .listingTable(executorHeaders, executorRow, removedExecutors)
62
67
63
68
val content =
64
- <div class =" row-fluid" >
65
- <div class =" span12" >
66
- <ul class =" unstyled" >
67
- <li ><strong >ID :</ strong> {app.id}</li >
68
- <li ><strong >Name :</ strong> {app.desc.name}</li >
69
- <li ><strong >User :</ strong> {app.desc.user}</li >
70
- <li ><strong >Cores :</ strong>
71
- {
72
- if (app.desc.maxCores.isEmpty) {
73
- " Unlimited (%s granted)" .format(app.coresGranted)
74
- } else {
75
- " %s (%s granted, %s left)" .format(
76
- app.desc.maxCores.get, app.coresGranted, app.coresLeft)
77
- }
69
+ <div class =" row-fluid" >
70
+ <div class =" span12" >
71
+ <ul class =" unstyled" >
72
+ <li ><strong >ID :</ strong> {app.id}</li >
73
+ <li ><strong >Name :</ strong> {app.desc.name}</li >
74
+ <li ><strong >User :</ strong> {app.desc.user}</li >
75
+ <li ><strong >Cores :</ strong>
76
+ {
77
+ if (app.desc.maxCores.isEmpty) {
78
+ " Unlimited (%s granted)" .format(app.coresGranted)
79
+ } else {
80
+ " %s (%s granted, %s left)" .format(
81
+ app.desc.maxCores.get, app.coresGranted, app.coresLeft)
78
82
}
79
- </ li >
80
- < li >
81
- < strong > Executor Memory :</ strong >
82
- { Utils .megabytesToString(app.desc.memoryPerSlave)}
83
- </ li >
84
- < li >< strong > Submit Date :</ strong > {app.submitDate} </li >
85
- <li ><strong >State :</ strong> {app.state }</li >
86
- <li ><strong >< a href = {app.desc.appUiUrl}> Application Detail UI </ a ></ strong > </li >
87
- </ ul >
88
- </div >
83
+ }
84
+ </ li >
85
+ < li >
86
+ < strong > Executor Memory :</ strong >
87
+ { Utils .megabytesToString(app.desc.memoryPerSlave)}
88
+ </li >
89
+ <li ><strong >Submit Date :</ strong> {app.submitDate }</li >
90
+ <li ><strong >State :</ strong > {app.state} </li >
91
+ <li >< strong >< a href ={app.desc.appUiUrl}> Application Detail UI </ a ></ strong ></ li >
92
+ </ul >
89
93
</div >
94
+ </div >
90
95
91
- <div class =" row-fluid" > <!-- Executors -->
92
- <div class =" span12" >
93
- <h4 > Executor Summary </h4 >
94
- {executorTable}
95
- </div >
96
- </div >;
96
+ <div class =" row-fluid" > <!-- Executors -->
97
+ <div class =" span12" >
98
+ <h4 > Executor Summary </h4 >
99
+ {
100
+ executorsTable ++
101
+ {
102
+ if (removedExecutors.nonEmpty) {
103
+ <h4 > Removed Executors </h4 > ++
104
+ removedExecutorsTable
105
+ } else {
106
+ Seq .empty[Node ]
107
+ }
108
+ }
109
+ }
110
+ </div >
111
+ </div >;
97
112
UIUtils .basicSparkPage(content, " Application: " + app.desc.name)
98
113
}
99
114
0 commit comments