[
https://issues.apache.org/jira/browse/FLINK-28469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17628176#comment-17628176
]
Yun Gao commented on FLINK-28469:
---------------------------------
Hi [~Sandys-Lumsdaine] logically it is a bit hard to achieve that since the
timer service relies on the a global current key, but applyToKey does not
modify the current key. May I have a double confirmation of why you need this
functionality?
> Setting a timer within broadcast applyToKeyedState()
> ----------------------------------------------------
>
> Key: FLINK-28469
> URL: https://issues.apache.org/jira/browse/FLINK-28469
> Project: Flink
> Issue Type: Improvement
> Components: API / DataStream
> Affects Versions: 1.16.0
> Reporter: James
> Priority: Minor
>
> I know we can’t set a timer in the processBroadcastElement() of the
> KeyedBroadcastProcessFunction as there is no key.
>
> However, there is a context.applyToKeyedState() method which allows us to
> iterate over the keyed state in the scope of a key. So it is possible to add
> access to the TimerService onto the Context parameter passed into that
> delegate?
>
> Since the code running in the applyToKeyedState() method is scoped to a key
> we should be able to set up timers for that key too.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)