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/04/17 12:49:48 UTC

[GitHub] [beam] mxm commented on a change in pull request #11154: [BEAM-1819] Key should be available in @OnTimer methods

mxm commented on a change in pull request #11154: [BEAM-1819] Key should be available in @OnTimer methods
URL: https://github.com/apache/beam/pull/11154#discussion_r410197770
 
 

 ##########
 File path: runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/DoFnOperator.java
 ##########
 @@ -837,11 +837,15 @@ public void onProcessingTime(InternalTimer<ByteBuffer, TimerData> timer) {
 
   // allow overriding this in ExecutableStageDoFnOperator to set the key context
   protected void fireTimerInternal(Object key, TimerData timerData) {
-    fireTimer(timerData);
+    if (key instanceof java.nio.ByteBuffer) {
+      key = FlinkKeyUtils.decodeKey((ByteBuffer) key, keyCoder);
+    }
+
+    fireTimer(key, timerData);
   }
 
   // allow overriding this in WindowDoFnOperator
-  protected void fireTimer(TimerData timerData) {
+  protected void fireTimer(Object key, TimerData timerData) {
 
 Review comment:
   ```suggestion
     protected void fireTimer(ByteBuffer key, TimerData timerData) {
   ```

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


With regards,
Apache Git Services