[ 
https://issues.apache.org/jira/browse/BEAM-5264?focusedWorklogId=140772&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-140772
 ]

ASF GitHub Bot logged work on BEAM-5264:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Sep/18 06:56
            Start Date: 04/Sep/18 06:56
    Worklog Time Spent: 10m 
      Work Description: charlesccychen commented on a change in pull request 
#6304: [BEAM-5264] Reference DirectRunner implementation of Python User State 
and Timers API
URL: https://github.com/apache/beam/pull/6304#discussion_r214800588
 
 

 ##########
 File path: sdks/python/apache_beam/runners/common.py
 ##########
 @@ -159,6 +159,28 @@ def __init__(self, obj_to_invoke, method_name):
     self.args = args
     self.defaults = defaults
 
+    self.has_userstate_arguments = False
+    self.state_args_to_replace = {}
+    self.timer_args_to_replace = {}
+    for kw, v in zip(args[-len(defaults):], defaults):
+      if v.__class__ == core.DoFn.StateParam:
+        self.state_args_to_replace[kw] = v.state_spec
+        self.has_userstate_arguments = True
+      elif v.__class__ == core.DoFn.TimerParam:
+        self.timer_args_to_replace[kw] = v.timer_spec
+        self.has_userstate_arguments = True
+
+  def invoke_with_userstate(self, user_state_context, key, window):
 
 Review comment:
   I considered consolidating this with `_invoke_per_window`, but it was hard 
to cleanly separate out logic that was not relevant to the timer firing case.  
I added a TODO to get the window param and (firing) timestamp.  How would a 
timer firing get a side input?

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 140772)

> Reference DirectRunner implementation of Python user state and timers API
> -------------------------------------------------------------------------
>
>                 Key: BEAM-5264
>                 URL: https://issues.apache.org/jira/browse/BEAM-5264
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>    Affects Versions: 2.6.0
>            Reporter: Charles Chen
>            Assignee: Charles Chen
>            Priority: Major
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> This issue tracks the reference DirectRunner implementation of the Beam 
> Python User State and Timer API, described here: 
> [https://s.apache.org/beam-python-user-state-and-timers].



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

Reply via email to