Commit fdad095
committed
[SPARK-45474][CORE][WEBUI] Support top-level filtering in MasterPage JSON API
### What changes were proposed in this pull request?
This PR aims to support `top-level` filtering in `MasterPage` JSON API.
### Why are the changes needed?
**BEFORE**
Since Apache Spark's `MasterPage` JSON API always returns a full information, we need a post-processing like the following via `jq`.
```
$ curl -s -k http://localhost:8080/json/ | jq .completedapps
[
{
"id": "app-20231009193946-0000",
"starttime": 1696905586694,
"name": "Spark shell",
"cores": 10,
"user": "dongjoon",
"memoryperexecutor": 1024,
"memoryperslave": 1024,
"resourcesperexecutor": [],
"resourcesperslave": [],
"submitdate": "Mon Oct 09 19:39:46 PDT 2023",
"state": "FINISHED",
"duration": 115686
}
]
```
**AFTER**
Apache Spark `MasterPage` provided a filtered result via REST API style for the top-level fields.
```
$ curl -s -k http://localhost:8080/json/completedapps
{
"completedapps" : [ {
"id" : "app-20231009193946-0000",
"starttime" : 1696905586694,
"name" : "Spark shell",
"cores" : 10,
"user" : "dongjoon",
"memoryperexecutor" : 1024,
"memoryperslave" : 1024,
"resourcesperexecutor" : [ ],
"resourcesperslave" : [ ],
"submitdate" : "Mon Oct 09 19:39:46 PDT 2023",
"state" : "FINISHED",
"duration" : 115686
} ]
}
```
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass the CIs with a new test case.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes apache#43303 from dongjoon-hyun/SPARK-45474.
Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>1 parent 0f9ed95 commit fdad095
3 files changed
Lines changed: 77 additions & 18 deletions
File tree
- core/src
- main/scala/org/apache/spark/deploy
- master/ui
- test/scala/org/apache/spark/deploy
Lines changed: 56 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
212 | 214 | | |
213 | | - | |
| 215 | + | |
214 | 216 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
229 | 268 | | |
230 | 269 | | |
231 | 270 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
79 | 95 | | |
80 | 96 | | |
81 | 97 | | |
| |||
0 commit comments