[
https://issues.apache.org/jira/browse/BEAM-9562?focusedWorklogId=419760&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-419760
]
ASF GitHub Bot logged work on BEAM-9562:
----------------------------------------
Author: ASF GitHub Bot
Created on: 09/Apr/20 21:01
Start Date: 09/Apr/20 21:01
Worklog Time Spent: 10m
Work Description: robertwb commented on pull request #11314: [BEAM-9562]
Send Timers over Data Channel as Elements
URL: https://github.com/apache/beam/pull/11314#discussion_r406474463
##########
File path:
sdks/python/apache_beam/runners/portability/fn_api_runner/execution.py
##########
@@ -355,20 +364,41 @@ def _build_process_bundle_descriptor(self):
items()),
environments=dict(
self.execution_context.pipeline_components.environments.items()),
- state_api_service_descriptor=self.state_api_service_descriptor())
+ state_api_service_descriptor=self.state_api_service_descriptor(),
+ timer_api_service_descriptor=self.data_api_service_descriptor())
def get_input_coder_impl(self, transform_id):
# type: (str) -> CoderImpl
coder_id = beam_fn_api_pb2.RemoteGrpcPort.FromString(
self.process_bundle_descriptor.transforms[transform_id].spec.payload
).coder_id
assert coder_id
+ return self.get_coder_impl(coder_id)
+
+ def _build_timer_coders_id_map(self):
+ timer_coder_ids = {}
+ for transform_id, transform_proto in (self._process_bundle_descriptor
+ .transforms.items()):
+ if transform_proto.spec.urn == common_urns.primitives.PAR_DO.urn:
+ pardo_payload = proto_utils.parse_Bytes(
+ transform_proto.spec.payload, beam_runner_api_pb2.ParDoPayload)
+ for id, timer_family_spec in pardo_payload.timer_family_specs.items():
+ timer_coder_ids[(transform_id, id)] = (
+ timer_family_spec.timer_family_coder_id)
+ return timer_coder_ids
+
+ def get_coder_impl(self, coder_id):
if coder_id in self.execution_context.safe_coders:
return self.execution_context.pipeline_context.coders[
self.execution_context.safe_coders[coder_id]].get_impl()
else:
return
self.execution_context.pipeline_context.coders[coder_id].get_impl()
+ def get_timer_coder_impl(self, transform_id, timer_family_id):
+ assert (transform_id, timer_family_id) in self._timer_coder_ids
Review comment:
The key error if it's not present below will be sufficient.
----------------------------------------------------------------
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: 419760)
> Remove timer from PCollection and treat timers as Elements
> -----------------------------------------------------------
>
> Key: BEAM-9562
> URL: https://issues.apache.org/jira/browse/BEAM-9562
> Project: Beam
> Issue Type: New Feature
> Components: sdk-java-harness, sdk-py-harness
> Reporter: Boyuan Zhang
> Assignee: Boyuan Zhang
> Priority: Major
> Fix For: 2.21.0
>
> Time Spent: 19.5h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)