Github user harishreedharan commented on a diff in the pull request:
https://github.com/apache/spark/pull/4964#discussion_r26551717
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/scheduler/JobGenerator.scala
---
@@ -44,6 +49,14 @@ class JobGenerator(jobScheduler: JobScheduler) extends
Logging {
private val conf = ssc.conf
private val graph = ssc.graph
+ // Scala treeset makes it difficult to drop items while iterating over
the set. dropWhile
+ // creates a new set, which does not seem very efficient. So use Java
treeset instead.
+ private val activeBatches =
+ Collections.synchronizedSet[Time](new TreeSet[Time](new
TimeComparator()))
--- End diff --
Scala treeset does not have a way of dropping data based on some predicate.
`dropWhile` seems inefficient since it creates a new set - which seemed
unnecessary. An alternative would be using the iterator to drop, but the scala
iterator does not allow removing data.
---
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]