afedulov commented on code in PR #21774:
URL: https://github.com/apache/flink/pull/21774#discussion_r1241820920


##########
flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/windowing/TopSpeedWindowing.java:
##########
@@ -99,7 +104,20 @@ public static void main(String[] args) throws Exception {
                             .map(new ParseCarData())
                             .name("parse-input");
         } else {
-            carData = 
env.addSource(CarSource.create(2)).name("in-memory-source");
+            CarGeneratorFunction carGenerator = new CarGeneratorFunction(2);
+            DataGeneratorSource<Tuple4<Integer, Integer, Double, Long>> 
carGeneratorSource =
+                    new DataGeneratorSource<>(
+                            carGenerator,
+                            Long.MAX_VALUE,
+                            parallelismIgnored -> new GuavaRateLimiter(1),
+                            TypeInformation.of(
+                                    new TypeHint<Tuple4<Integer, Integer, 
Double, Long>>() {}));
+            carData =
+                    env.fromSource(
+                            carGeneratorSource,
+                            WatermarkStrategy.noWatermarks(),

Review Comment:
   Yes, and the watermarks are assigned here 
https://github.com/apache/flink/pull/21774/files#diff-227d83380c24406389c12d4d3116ced03c15493d638b029595431051695c2549L109
 because of this if-else block
   
https://github.com/apache/flink/pull/21774/files#diff-227d83380c24406389c12d4d3116ced03c15493d638b029595431051695c2549L86
 and the file source which parses data in a separate map function. There is 
some consensus that this example does not really serve its purpose, so I don't 
think it makes sense to put too much effort into "fixing" it: 
https://github.com/apache/flink/pull/20049#issuecomment-1407553971



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to