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 2022/11/16 14:05:43 UTC

[GitHub] [beam] reuvenlax commented on a diff in pull request #22953: Fix for #22951

reuvenlax commented on code in PR #22953:
URL: https://github.com/apache/beam/pull/22953#discussion_r1024043582


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/GroupIntoBatches.java:
##########
@@ -424,13 +465,40 @@ public void processElement(
         BoundedWindow window,
         OutputReceiver<KV<K, Iterable<InputT>>> receiver) {
       LOG.debug("*** BATCH *** Add element for window {} ", window);
+      if (shouldCareAboutWeight()) {
+        final long elementWeight = weigher.apply(element.getValue());
+        if (elementWeight + storedBatchSizeBytes.read() > batchSizeBytes) {

Review Comment:
   this defeats the readLater optimization, since you're eagerly reading the value here (meaning also there's no point in the below readLater). you should add readLaters for minBufferedTs (if needed) and storedBatchSize earlier in the function.



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org