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

Jingsong Lee commented on BEAM-1116:
------------------------------------

[~kenn] I found that {{onTimer()}} requires the {{BoundedWindow}} parameter. 
How to get {{BoundedWindow}} from the {{StateNamespace}} of {{TimerData}}?
{code}
private BoundedWindow getWindowFromNamespace(StateNamespace namespace) {
    if (namespace instanceof WindowNamespace) {
      return ((WindowNamespace) namespace).getWindow();
    } else if (namespace instanceof GlobalNamespace) {
      return GlobalWindow.INSTANCE;
    } else if (namespace instanceof WindowAndTriggerNamespace) {
      return ((WindowAndTriggerNamespace) namespace).getWindow();
    } else {
      throw new RuntimeException("Unknown StateNamespace type: "
          + namespace.getClass());
    }
  }
{code}
Is that right? Why does StateNamespace not provide {{getWindow()}} method?

> Support for new Timer API in Flink runner
> -----------------------------------------
>
>                 Key: BEAM-1116
>                 URL: https://issues.apache.org/jira/browse/BEAM-1116
>             Project: Beam
>          Issue Type: New Feature
>          Components: runner-flink
>            Reporter: Kenneth Knowles
>            Assignee: Jingsong Lee
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to