You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/05/04 17:37:07 UTC

[GitHub] [beam] ibzib commented on a change in pull request #11597: [BEAM-9874] Support clearing timers in portable batch mode (Spark/Flink)

ibzib commented on a change in pull request #11597:
URL: https://github.com/apache/beam/pull/11597#discussion_r419607989



##########
File path: runners/core-java/src/main/java/org/apache/beam/runners/core/InMemoryTimerInternals.java
##########
@@ -167,20 +165,17 @@ public void deleteTimer(StateNamespace namespace, String timerId, TimeDomain tim
   @Deprecated
   @Override
   public void deleteTimer(StateNamespace namespace, String timerId, String timerFamilyId) {
-    TimerData existing = existingTimers.get(namespace, timerId + '+' + timerFamilyId);
-    if (existing != null) {
-      deleteTimer(existing);
+    TimerData removedTimer = existingTimers.remove(namespace, timerId + '+' + timerFamilyId);
+    if (removedTimer != null) {
+      timersForDomain(removedTimer.getDomain()).remove(removedTimer);
     }
   }
 
   /** @deprecated use {@link #deleteTimer(StateNamespace, String, TimeDomain)}. */

Review comment:
       It seems strange that the deprecated method is the one being used, and the recommended method is not implemented.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org