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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]