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

ASF GitHub Bot commented on FLINK-10543:
----------------------------------------

hequn8128 commented on a change in pull request #6918: [FLINK-10543][table] 
Leverage efficient timer deletion in relational operators
URL: https://github.com/apache/flink/pull/6918#discussion_r238512298
 
 

 ##########
 File path: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/ProcessFunctionWithCleanupState.scala
 ##########
 @@ -58,6 +58,10 @@ abstract class 
ProcessFunctionWithCleanupState[IN,OUT](queryConfig: StreamQueryC
         val cleanupTime = currentTime + maxRetentionTime
         // register timer and remember clean-up time
         ctx.timerService().registerProcessingTimeTimer(cleanupTime)
+        // delete expired timer
+        if (curCleanupTime != null) {
+          ctx.timerService().deleteProcessingTimeTimer(curCleanupTime)
 
 Review comment:
   This is a good question. The `needToCleanupState` is useless in 
`GroupAggProcessFunction`, `RowTimeBoundedRangeOver`, etc. But it is used in 
`ProcTimeBoundedRangeOver`. 
   In `ProcTimeBoundedRangeOver`, both state cleanup and computation will 
register proctime timer, so that we still need this `needToCleanupState` to 
judge whether to clean up the state.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Leverage efficient timer deletion in relational operators
> ---------------------------------------------------------
>
>                 Key: FLINK-10543
>                 URL: https://issues.apache.org/jira/browse/FLINK-10543
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Fabian Hueske
>            Assignee: Hequn Cheng
>            Priority: Minor
>              Labels: pull-request-available
>
> FLINK-9423 added support for efficient timer deletions. This feature is 
> available since Flink 1.6 and should be used by the relational operator of 
> SQL and Table API.
> Currently, we use a few workarounds to handle situations when deleting timers 
> would be the better solution.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to