robertwb commented on a change in pull request #11314: [BEAM-9562] Send Timers
over Data Channel as Elements
URL: https://github.com/apache/beam/pull/11314#discussion_r405994886
##########
File path: sdks/python/apache_beam/runners/worker/bundle_processor.py
##########
@@ -745,6 +746,24 @@ def __init__(self,
self.process_bundle_descriptor = process_bundle_descriptor
self.state_handler = state_handler
self.data_channel_factory = data_channel_factory
+
+ # There is no guarantee that the runner only set
+ # timer_api_service_descriptor when having timers. So this field cannot be
+ # used as an indicator of timers.
+ if self.process_bundle_descriptor.timer_api_service_descriptor:
+ self.timer_data_channel = (
+ data_channel_factory.create_data_channel_from_url(
+ self.process_bundle_descriptor.timer_api_service_descriptor.url))
+ else:
+ self.timer_data_channel = None
+
+ # A mapping of
+ # {(transform_id, timer_family_id):
+ # {"timer_coder_impl": coder, "output_stream": stream}}
Review comment:
Optonal: [Named] tuples are usually easier to work with than dicts.
----------------------------------------------------------------
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]
With regards,
Apache Git Services