[
https://issues.apache.org/jira/browse/BEAM-1819?focusedWorklogId=425320&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-425320
]
ASF GitHub Bot logged work on BEAM-1819:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Apr/20 13:23
Start Date: 20/Apr/20 13:23
Worklog Time Spent: 10m
Work Description: mxm commented on a change in pull request #11154:
URL: https://github.com/apache/beam/pull/11154#discussion_r411372859
##########
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);
Review comment:
Yes, it assumes that the key is of type ByteBuffer because the key type
we pass to Flink is always `ByteBuffer`. We shouldn't be adding `instanceof`
checks to the main code in order for tests to pass. Let's adapt the tests
instead. You need to ensure that the `KeySelector` used in the tests returns
`ByteBuffer`. I can help you in case you get stuck.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 425320)
Time Spent: 27h 40m (was: 27.5h)
> Key should be available in @OnTimer methods
> -------------------------------------------
>
> Key: BEAM-1819
> URL: https://issues.apache.org/jira/browse/BEAM-1819
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Reporter: Thomas Groh
> Assignee: Shehzaad Nakhoda
> Priority: Major
> Time Spent: 27h 40m
> Remaining Estimate: 0h
>
> Every timer firing has an associated key. This key should be available when
> the timer is delivered to a user's {{DoFn}}, so they don't have to store it
> in state.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)