reswqa commented on code in PR #21774:
URL: https://github.com/apache/flink/pull/21774#discussion_r1242060124
##########
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 also some consensus that usage of advanced windows with triggers
and evictors is somewhat discouraged and should not be promoted.
Agree on this point.
BTW, Whether removing or improving this example, it should not block this
migrate ATM.
##########
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 also some consensus that usage of advanced windows with triggers
and evictors is somewhat discouraged and should not be promoted.
Agree on this point.
BTW, Whether removing or improving this example, it should not block this
migration ATM.
--
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]