Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/2259#discussion_r71155160
--- 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 --
I think we shouldn't limit the number of emitted events. It is a streaming
example and as such it should continuously run.
---
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.
---