Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/4830#discussion_r27076974
--- Diff:
core/src/main/scala/org/apache/spark/ui/jobs/JobProgressListener.scala ---
@@ -140,7 +143,16 @@ class JobProgressListener(conf: SparkConf) extends
SparkListener with Logging {
if (jobs.size > retainedJobs) {
val toRemove = math.max(retainedJobs / 10, 1)
jobs.take(toRemove).foreach { job =>
- jobIdToData.remove(job.jobId)
+ for (
+ removedJob <- jobIdToData.remove(job.jobId);
+ jobGroupId = removedJob.jobGroup.orNull;
+ jobsInGroup <- jobGroupToJobIds.get(jobGroupId)
--- End diff --
this mix and match of `<-` and `=` took me a while to figure out what's
going on. Can we rewrite this:
```
jobs.take(toRemove).foreach { job =>
jobIdToData.remove(job.jobId).foreach { removedJob =>
val jobGroupId = removedJob.jobGroup.orNull
val jobsInGroup = jobGroupToJobIds.get(jobGroupId)
jobsInGroup.remove(job.jobId)
...
}
}
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]