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