Github user kl0u commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2259#discussion_r71155772
  
    --- Diff: 
flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/windowing/TopSpeedWindowing.scala
 ---
    @@ -72,7 +74,34 @@ object TopSpeedWindowing {
           } else {
             println("Executing TopSpeedWindowing example with default inputs 
data set.")
             println("Use --input to specify file input.")
    -        env.fromCollection(genCarStream())
    +        env.addSource(new SourceFunction[CarEvent]() {
    +
    +          val speeds = Array.fill[Integer](numOfCars)(50)
    +          val distances = Array.fill[Double](numOfCars)(0d)
    +          @Transient lazy val rand = new Random()
    +
    +          var counter = 0
    +          var isRunning:Boolean = true
    +
    +          override def run(ctx: SourceContext[CarEvent]) = {
    +            while (isRunning && counter < numOfEvents) {
    --- End diff --
    
    The reason for this is to be the same as the java TopSpeedWindowing 
example. 
    I suggest that if we change the one, we should also change the other too, 
as the user would expect the same behavior from both.
    
    What do you think?


---
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.
---

Reply via email to