Re: Setting Timers in applyToKeyedState

2024-08-28 Thread Zakelly Lan
Hi Jose, You are right about using {{applyToKeyedState}} to register timers under {{KeyedBroadcastProcessFunction}}. I think the author overlooked this, and we could update the document. As for specifying a smaller keyset to apply function, I think this is a possible direction of optimization. Th

Re: Setting Timers in applyToKeyedState

2024-08-28 Thread Jose Vargas Badilla via user
On a slight tangent, it seems to me that the DataStream v2 API only exposes the ability to apply a function to all partitions, not a subset, which the current applyToKeyedState does allow. Is that accurate? If so, adding that ability to the v2 API would be helpful. For example, there can be a proce

Setting Timers in applyToKeyedState

2024-08-28 Thread Jose Vargas Badilla via user
Hi, I recently learned that timers can be set in the KeyedStateFunction that is passed to KeyedBroadcastProcessFunction.Context#applyToKeyedState. The "trick" is to store a reference to the timerService that is available in processElement. This is behavior I have not seen explicitly documented be