arunpandianp commented on code in PR #36742:
URL: https://github.com/apache/beam/pull/36742#discussion_r2501281286
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/state/WindmillBag.java:
##########
@@ -165,18 +166,27 @@ public Windmill.WorkItemCommitRequest
persistDirectly(WindmillStateCache.ForKeyA
if (bagUpdatesBuilder == null) {
bagUpdatesBuilder = commitBuilder.addBagUpdatesBuilder();
}
- for (T value : localAdditions) {
- ByteStringOutputStream stream = new ByteStringOutputStream();
- // Encode the value
- elemCoder.encode(value, stream, Coder.Context.OUTER);
- ByteString encoded = stream.toByteString();
- if (cachedValues != null) {
- // We'll capture this value in the cache below.
- // Capture the value's size now since we have it.
- encodedSize += encoded.size();
- }
- bagUpdatesBuilder.addValues(encoded);
- }
+ final Windmill.TagBag.Builder finalBagUpdatesBuilder = bagUpdatesBuilder;
+ @Nullable
+ Object unused =
+ ThreadLocalByteStringOutputStream.withThreadLocalStream(
Review Comment:
Done.
--
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]