tvalentyn commented on code in PR #38422:
URL: https://github.com/apache/beam/pull/38422#discussion_r3211788598
##########
sdks/python/apache_beam/runners/worker/data_plane.py:
##########
@@ -472,6 +483,18 @@ def __init__(self, data_buffer_time_limit_ms=0):
self._closed = False
self._exception = None # type: Optional[Exception]
+ def is_backpressured(self):
+ # type: () -> bool
+ with self._to_send_lock:
+ return self._queued_bytes > self._max_queued_bytes
+
+ def _put_to_send_queue(self, element):
+ # type: (Union[beam_fn_api_pb2.Elements.Data,
beam_fn_api_pb2.Elements.Timers]) -> None
+ element_size = element.ByteSize()
Review Comment:
this might be expensive, but we could `_element_weight` from the other PR
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]