Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/4875#discussion_r25982687
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/dstream/WindowedDStream.scala
---
@@ -62,7 +65,22 @@ class WindowedDStream[T: ClassTag](
override def compute(validTime: Time): Option[RDD[T]] = {
val currentWindow = new Interval(validTime - windowDuration +
parent.slideDuration, validTime)
- val rddsInWindow = parent.slice(currentWindow)
+ val parentRddsInWindow = parent.slice(currentWindow)
+ val rddsInWindow = _initialWindow match {
+ case None => {
+ parentRddsInWindow
+ }
+ case Some (initialWindowRDD) => {
+ if(parentRddsInWindow.length - windowBatchCount == 0) {
--- End diff --
These condition can be simplified isnt it?
```
val rddsInWindow = if (parentRddsInWindow.length < windowBatchCount &&
!initialWindow.exists) { ... } else { ... }
}
---
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]