You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/04/08 21:33:21 UTC
[GitHub] [beam] robertwb commented on a change in pull request #11314:
[BEAM-9562] Send Timers over Data Channel as Elements
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_r405816460
##########
File path: sdks/python/apache_beam/runners/worker/bundle_processor.py
##########
@@ -562,45 +562,45 @@ class OutputTimer(object):
def __init__(self,
key,
window, # type: windowed_value.BoundedWindow
- receiver # type: operations.ConsumerSet
+ paneinfo,
+ timer_family_id,
+ timer_coder_impl,
+ output_stream
):
self._key = key
self._window = window
- self._receiver = receiver
+ self._paneinfo = paneinfo
+ self._timer_family_id = timer_family_id
+ self._output_stream = output_stream
+ self._timer_coder_impl = timer_coder_impl
def set(self, ts):
ts = timestamp.Timestamp.of(ts)
- # TODO(BEAM-9562): Plumb through actual timer fields.
- self._receiver.receive(
- windowed_value.WindowedValue((
- self._key,
- userstate.Timer(
- user_key='',
- dynamic_timer_tag='',
- windows=(self._window, ),
- clear_bit=False,
- fire_timestamp=ts,
- hold_timestamp=ts,
- paneinfo=windowed_value.PANE_INFO_UNKNOWN)),
- ts, (self._window, )))
+ timer = userstate.Timer(
+ user_key=self._key,
+ dynamic_timer_tag='',
+ windows=(self._window, ),
+ clear_bit=False,
+ fire_timestamp=ts,
+ hold_timestamp=ts,
+ paneinfo=self._paneinfo)
+ self._timer_coder_impl.encode_to_stream(timer, self._output_stream, True)
+ self._output_stream.maybe_flush()
def clear(self):
# type: () -> None
dummy_millis = int(common_urns.constants.MAX_TIMESTAMP_MILLIS.constant) + 1
clear_ts = timestamp.Timestamp(micros=dummy_millis * 1000)
- # TODO(BEAM-9562): Plumb through actual paneinfo.
- self._receiver.receive(
- windowed_value.WindowedValue((
- self._key,
- userstate.Timer(
- user_key='',
- dynamic_timer_tag='',
- windows=(self._window, ),
- clear_bit=False,
- fire_timestamp=timestamp.Timestamp.of(clear_ts),
- hold_timestamp=timestamp.Timestamp.of(0),
- paneinfo=windowed_value.PANE_INFO_UNKNOWN)),
- 0, (self._window, )))
+ timer = userstate.Timer(
+ user_key=self._key,
+ dynamic_timer_tag='',
+ windows=(self._window, ),
+ clear_bit=False,
+ fire_timestamp=clear_ts,
Review comment:
Don't bother setting these timestamps, or paneinfo.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services