jiexray commented on code in PR #25996:
URL: https://github.com/apache/flink/pull/25996#discussion_r1920130658
##########
flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/windowing/WindowWordCount.java:
##########
@@ -118,15 +129,33 @@ public static void main(String[] args) throws Exception {
// Using a keyBy allows performing aggregations and
other
// stateful transformations over data on a per-key
basis.
// This is similar to a GROUP BY clause in a SQL query.
- .keyBy(value -> value.f0)
- // create windows of windowSize records slided every
slideSize records
- .countWindow(windowSize, slideSize)
- // For each key, we perform a simple sum of the "1"
field, the count.
- // If the input data set is bounded, sum will output a
final count for
- // each word. If it is unbounded, it will continuously
output updates
- // each time it sees a new instance of each word in
the stream.
- .sum(1)
- .name("counter");
+ .keyBy(value -> value.f0);
+
+ DataStream<Tuple2<String, Integer>> counts;
+ if (params.isAsyncState()) {
+ counts =
+ keyedStream
+ .enableAsyncState()
+ // create windows of windowSize records slided
every slideSize records
+ .asyncCountWindow(windowSize, slideSize)
Review Comment:
Resolved, I have removed this API. countWindow() + enableAsyncState() will
trigger DataStream using AsyncWindowOperator.
--
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]