robertwb commented on code in PR #31581:
URL: https://github.com/apache/beam/pull/31581#discussion_r1637169726
##########
sdks/python/apache_beam/runners/worker/data_plane.py:
##########
@@ -639,8 +639,13 @@ def _write_outputs(self):
streams = [self._to_send.get()]
try:
# Coalesce up to 100 other items.
+ total_size_bytes = 0
Review Comment:
Or streams[0].ByteSize()?
##########
sdks/python/apache_beam/runners/worker/data_plane.py:
##########
@@ -639,8 +639,13 @@ def _write_outputs(self):
streams = [self._to_send.get()]
try:
# Coalesce up to 100 other items.
+ total_size_bytes = 0
for _ in range(100):
- streams.append(self._to_send.get_nowait())
+ data_or_timer = self._to_send.get_nowait()
+ total_size_bytes += data_or_timer.ByteSize()
+ streams.append(data_or_timer)
+ if total_size_bytes > _DEFAULT_SIZE_FLUSH_THRESHOLD:
Review Comment:
_DEFAULT_SIZE_FLUSH_THRESHOLD is fine. This was mostly to colocate lots of
tiny results for streaming pipelines (though that might be less valuable now
that we can inline them into the control messages).
--
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]