You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Elias Levy <fe...@gmail.com> on 2018/08/01 01:02:54 UTC

Re: Counting elements that appear "behind" the watermark

Correct.  Context gives you access to the element timestamp
<https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/ProcessFunction.java#L99>.
But it also gives you access to the current watermark via timerService
<https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/ProcessFunction.java#L104>
->
currentWatermark
<https://github.com/apache/flink/blob/a0f4239faee533545c6d923a944f242b519759d1/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/TimerService.java#L39>
.

On Tue, Jul 31, 2018 at 7:45 AM Julio Biason <ju...@azion.com> wrote:

> Thanks for the tips. Unfortunately, it seems `Context` only have
> information from the element being processed (
> https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/ProcessFunction.java#L91)
> and the RuntimeContext doesn't have access to any watermark information (
> https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/api/common/functions/RuntimeContext.java#L57
> ).
>
>

Re: Counting elements that appear "behind" the watermark

Posted by Julio Biason <ju...@azion.com>.
Awesome, thanks Elias!

On Tue, Jul 31, 2018 at 10:02 PM, Elias Levy <fe...@gmail.com>
wrote:

> Correct.  Context gives you access to the element timestamp
> <https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/ProcessFunction.java#L99>.
> But it also gives you access to the current watermark via timerService
> <https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/ProcessFunction.java#L104> ->
> currentWatermark
> <https://github.com/apache/flink/blob/a0f4239faee533545c6d923a944f242b519759d1/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/TimerService.java#L39>
> .
>
> On Tue, Jul 31, 2018 at 7:45 AM Julio Biason <ju...@azion.com>
> wrote:
>
>> Thanks for the tips. Unfortunately, it seems `Context` only have
>> information from the element being processed (https://github.com/apache/
>> flink/blob/master/flink-streaming-java/src/main/java/
>> org/apache/flink/streaming/api/functions/ProcessFunction.java#L91) and
>> the RuntimeContext doesn't have access to any watermark information (
>> https://github.com/apache/flink/blob/master/flink-core/
>> src/main/java/org/apache/flink/api/common/functions/
>> RuntimeContext.java#L57).
>>
>>


-- 
*Julio Biason*, Sofware Engineer
*AZION*  |  Deliver. Accelerate. Protect.
Office: +55 51 3083 8101 <callto:+555130838101>  |  Mobile: +55 51
<callto:+5551996209291>*99907 0554*