flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bowen Li (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (FLINK-8322) support getting number of existing timers in TimerService
Date Wed, 27 Dec 2017 07:25:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-8322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16304285#comment-16304285
] 

Bowen Li edited comment on FLINK-8322 at 12/27/17 7:24 AM:
-----------------------------------------------------------

This might be a followup of [this email thread|http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Why-TimerService-interface-in-ProcessFunction-doesn-t-have-deleteEventTimeTimer-td12719.html]

According to my research, this can be done by exposing {{numProcessingTimeTimers(N namespace)}}
and {{numEventTimeTimers(N namespace)}}. But their performance is both {{O[n]}}, which seems
to be a bit inefficient and thus falls to the same situation with {{delete()}} that we may
not want to expose to users. 

Well, we can do a tradeoff between storage and time, and use a map {{Map<Namespace, Integer>}}
to keep track of the number of timers for a given namespace. [~StephanEwen] [~aljoscha] What
do you think?


was (Author: phoenixjiangnan):
This might be a followup of [this email thread|http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Why-TimerService-interface-in-ProcessFunction-doesn-t-have-deleteEventTimeTimer-td12719.html]

According to my research, this can be done by exposing {{numProcessingTimeTimers(N namespace)}}
and {{numEventTimeTimers(N namespace)}}. But their performance is both {{O[n]}}, which seems
to be a bit inefficient and thus falls to the same situation with {{delete()}} that we may
not want to expose to users. 

[~StephanEwen] [~aljoscha] Any suggestions?

> 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)

Mime
View raw message