reswqa commented on code in PR #21774:
URL: https://github.com/apache/flink/pull/21774#discussion_r1241869995
##########
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:
> There is consensus that this example does not really serve its purpose, so
I don't think it makes sense to put much effort into "fixing" it, it is enough
that it produces data and compiles.
As for this `TopSpeedWindowing` example, it is fair enough as I'm also not a
fan of this. Perhaps we should show users a more intuitive example that cover
the core logic of this in the future.
--
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]