[ https://issues.apache.org/jira/browse/FLINK-8322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16308201#comment-16308201 ]
Aljoscha Krettek commented on FLINK-8322: ----------------------------------------- Yes, I think one (maybe the best) solution is to keep an extra bit of state for keeping track of the number of timers. {{num*Timers()}} will probably get more expensive once we store timers not only on the heap but for example in RocksDB. (See FLINK-5544) > support getting number of existing timers in TimerService > --------------------------------------------------------- > > Key: FLINK-8322 > URL: https://issues.apache.org/jira/browse/FLINK-8322 > Project: Flink > Issue Type: Improvement > Components: DataStream API > Affects Versions: 1.4.0 > Reporter: Bowen Li > Assignee: Bowen Li > > We have the use cases where we want to use timers as scheduled threads - e.g. > add a timer to wake up x hours later and do something (reap old data usualy) > only if there's no existing timers, basically we only want at most 1 timer > exists for the key all the time -- This message was sent by Atlassian JIRA (v6.4.14#64029)