yjshen commented on issue #5866: Flink event time based windowing functions not 
working with pulsar
URL: https://github.com/apache/pulsar/issues/5866#issuecomment-568965375
 
 
   1. since you are using `MovingAvgTimestampExtractor` which is an implement 
of `AssignerWithPeriodicWatermarks`, you should set 
`env.setAutoWatermarkInterval()` to make flink emit watermarks periodically in 
your `FlinkWindowApp`.
   
   2. The definition of `MovingAverageTrigger` is vague here. Since you are 
doing watermark based window computation, check `EventTimeTrigger` which is the 
default trigger for `SlidingEventTimeWindows` if you really need to overwrite 
its behavior.
   
   3. If you want to read a partitioned topic in parallel (the max parallelism 
you could achieve currently equals to the number of the partition), you need to 
create a pulsar source for each partition and create datastream for each of 
them:
   
   ```
   DataStream<String> stream0 = env.addSource(consumer read partition 
0).setParallelism(1);
   DataStream<String> stream1 = env.addSource(consumer read partition 
1).setParallelism(1);
   DataStream<String> streamn = env.addSource(consumer read partition 
n).setParallelism(1);
   
   DataStream<String> finalStream = stream0.union(stream1, stream2, ... , 
stream n);
   ```
    and use finalStream as your return value for `addSourceTopics`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to