I experimented with
`AfterProcessingTime.pastFirstElementInPane().plusDelayOf(6.days)` which is
*almost* working, but delays elements on the last day depending on the
element timestamps from the first day.

I think I'd need something like
`AfterProcessingTime.pastStartOfWindow().plusDelayOf(6.days)`, but I'm
finding it difficult to understand how to create such a trigger, or if
something like that is even possible.

Regards,
Raman


On Fri, Mar 26, 2021 at 4:47 PM Raman Gupta <[email protected]> wrote:

> I have a 7-day sliding calendar window, sliding by 1 day. The intent is to
> process only elements that fall into the last day of a window, but still
> have access to the elements from the preceding six days.
>
> I created a sliding calendar window function, and trigger it like this:
>
> AfterWatermark.pastEndOfWindow()
>   .withEarlyFirings(AfterProcessingTime.pastFirstElementInPane())
>   .withLateFirings(AfterPane.elementCountAtLeast(1))
>
> Downstream of this pipeline I have a GBK and a DoFn that basically ignores
> elements until at least some of them are in the last day of the window.
>
> The above trigger works and the pipeline produces the expected output, but
> runs the GBK and downstream logic many more times than is necessary.
>
> Is there a way I can optimize the triggering here such that the early
> firings begin only when the watermark moves into the last day of the 7-day
> window?
>
> Thanks,
> Raman
>
>

Reply via email to