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


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/MultimapSideInput.java:
##########
@@ -183,6 +242,8 @@ private ByteString encodeKey(K k) {
               k, 
keysRequest.getStateKey().getMultimapKeysSideInput().getSideInputId()),
           e);
     }
-    return output.toByteString();
+    // Trim small buffers to an exact-sized LiteralByteString so sub-cache 
keys do not retain an

Review Comment:
   Clarified the comment in MultimapSideInput.encodeKey hat  
ByteStringOutputStream.toByteStringAndReset
    already checks shouldCopy(buffer.length, bufferPos) internally (copying 
small <= 128B and sparse larger buffers, wrapping dense larger ones).



-- 
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]

Reply via email to