Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/8153#discussion_r36936462
--- Diff:
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
@@ -204,13 +204,21 @@ private[history] class FsHistoryProvider(conf:
SparkConf, clock: Clock)
mod1 >= mod2
}
+ val tasks = mutable.ListBuffer.empty[Future[_]]
logInfos.sliding(20, 20).foreach { batch =>
--- End diff --
you can avoid all mutability with
```scala
val tasks: Seq[Future[_]] = logInfos.grouped(20).map{ batch =>
replayExecutor.submit(new Runnable {
override def run(): Unit = mergeApplicationListing(batch)
})
}
```
(I know the change to `grouped` is unrelated, but everytime I look at this
code it confuses me for a second why we have overlapping sliding windows --
might as well as clean it up while you are messing around here)
---
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]